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

Doc fix ZZ_feature_maps #13231

Merged
merged 11 commits into from
Oct 2, 2024
Merged

Conversation

Shivansh20128
Copy link
Contributor

Summary

I have added docstrings for data, entanglement_blocks, num_parameters, and parameters properties in the ZZ_Feature_Map documentation. Also, I updated the code example where to concatenate two circuits, the "+" has been replaced with the "compose" operation.
#Closes #12431

Details and comments

Also updated some formatting in the code example as the "copy to clipboard" button also copied the arrows which needed to be removed explicitly.

@Shivansh20128 Shivansh20128 requested a review from a team as a code owner September 27, 2024 11:51
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Sep 27, 2024
@qiskit-bot
Copy link
Collaborator

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 following people are relevant to this code:

  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia

@coveralls
Copy link

coveralls commented Sep 27, 2024

Pull Request Test Coverage Report for Build 11128933879

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 26 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 88.839%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 8 91.23%
crates/qasm2/src/parse.rs 18 95.77%
Totals Coverage Status
Change from base Build 11126578403: -0.03%
Covered Lines: 74115
Relevant Lines: 83426

💛 - Coveralls

Copy link
Contributor

@Cryoris Cryoris 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 contribution @Shivansh20128 🙂 For the derived methods whose documentation don't show up correctly (data, num_parameters, etc.) could you just copy-paste the docstring from the parent class? It would be good if they are consistent.

@@ -19,7 +19,7 @@


class ZZFeatureMap(PauliFeatureMap):
r"""Second-order Pauli-Z evolution circuit.
r"""Second-order Pauli-Z evolution circuit: Using the Pauli-Z gate to create entanglement between pairs of qubits allowing them to evolve.
Copy link
Contributor

Choose a reason for hiding this comment

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

The first line is just a very brief summary, I would keep it as is 🙂

Suggested change
r"""Second-order Pauli-Z evolution circuit: Using the Pauli-Z gate to create entanglement between pairs of qubits allowing them to evolve.
r"""Second-order Pauli-Z evolution circuit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. I will revert it back. I modified it because it was unclear to me what it meant, so I thought it could be unclear to others as well.

@Shivansh20128
Copy link
Contributor Author

Thanks for the contribution @Shivansh20128 🙂 For the derived methods whose documentation don't show up correctly (data, num_parameters, etc.) could you just copy-paste the docstring from the parent class? It would be good if they are consistent.

Okay, I will do that.
Thanks for the review.

Cryoris
Cryoris previously approved these changes Oct 1, 2024
Copy link
Contributor

@Cryoris Cryoris 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 fix!

@Cryoris Cryoris added documentation Something is not clear or an error documentation Changelog: None Do not include in changelog labels Oct 1, 2024
@Cryoris
Copy link
Contributor

Cryoris commented Oct 1, 2024

Ah actually it seems the CI is complaining, could you run black to correctly format the files?

@Shivansh20128
Copy link
Contributor Author

Thanks for the review. I ran the black command and it did some reformatting. I hope it should not give an error now.

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

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

Great, thanks for the fix!

@Cryoris Cryoris added this pull request to the merge queue Oct 2, 2024
Merged via the queue into Qiskit:main with commit f1b2580 Oct 2, 2024
15 checks passed
@Shivansh20128 Shivansh20128 deleted the doc_fix_ZZ_Feature_Maps branch October 2, 2024 07:18
@Cryoris Cryoris added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Oct 3, 2024
@Cryoris
Copy link
Contributor

Cryoris commented Oct 3, 2024

@Mergifyio backport stable/1.2

Copy link
Contributor

mergify bot commented Oct 3, 2024

backport stable/1.2

🟠 Pending

  • Backport to branch stable/1.2 in progress

mergify bot pushed a commit that referenced this pull request Oct 3, 2024
* initial formatting changes

* .compose used for concatination of two circuits

* updated docstring data property

* updated entanglement_blocks docstring

* updated docstring of num_parameters

* updates docstring of parameters

* update _zz_feature_map.py documentation

* update changes to ZZ_Feature_Map

* update doc strings matched with parent class

* _zz_feature_map.py reformatted

(cherry picked from commit f1b2580)

# Conflicts:
#	qiskit/circuit/library/data_preparation/zz_feature_map.py
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Oct 3, 2024
* initial formatting changes

* .compose used for concatination of two circuits

* updated docstring data property

* updated entanglement_blocks docstring

* updated docstring of num_parameters

* updates docstring of parameters

* update _zz_feature_map.py documentation

* update changes to ZZ_Feature_Map

* update doc strings matched with parent class

* _zz_feature_map.py reformatted
github-merge-queue bot pushed a commit that referenced this pull request Oct 3, 2024
* Doc fix ZZ_feature_maps (#13231)

* initial formatting changes

* .compose used for concatination of two circuits

* updated docstring data property

* updated entanglement_blocks docstring

* updated docstring of num_parameters

* updates docstring of parameters

* update _zz_feature_map.py documentation

* update changes to ZZ_Feature_Map

* update doc strings matched with parent class

* _zz_feature_map.py reformatted

(cherry picked from commit f1b2580)

# Conflicts:
#	qiskit/circuit/library/data_preparation/zz_feature_map.py

* merge conflicy & other typos

---------

Co-authored-by: Shivansh Mittal <88429611+Shivansh20128@users.noreply.github.com>
Co-authored-by: Julien Gacon <jules.gacon@googlemail.com>
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Oct 7, 2024
* initial formatting changes

* .compose used for concatination of two circuits

* updated docstring data property

* updated entanglement_blocks docstring

* updated docstring of num_parameters

* updates docstring of parameters

* update _zz_feature_map.py documentation

* update changes to ZZ_Feature_Map

* update doc strings matched with parent class

* _zz_feature_map.py reformatted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Improve ZZFeatureMap API docs
4 participants