Skip to content

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Dec 3, 2024

e.g. why we use different gate types and what's the advantages

Summary

With #13046 the designated workflow with the circuit library changed. This PR adds a section to the docs explaining this new structure. While not fully done, I'm already opening this draft PR for people to have a look at the text.

Details and comments

This includes some other minor changes:

  • add a TOC for the different sections
  • consistently sort the standard gates (before this was partially sorted, partially chaotic)
  • move the documentation of get_standard_gate_name_mapping under Standard gates
  • always mention the circuit functions and gates before the old circuits

To do

  • Add some more examples to the sections
  • Move the template circuits to a separate page
  • Can we find a better name/structure for "particular quantum circuits"?

@Cryoris Cryoris added documentation Something is not clear or an error documentation Changelog: None Do not include in changelog labels Dec 3, 2024
@Cryoris Cryoris added this to the 2.0.0 milestone Dec 3, 2024
@coveralls
Copy link

coveralls commented Dec 3, 2024

Pull Request Test Coverage Report for Build 14103023447

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 574 unchanged lines in 11 files lost coverage.
  • Overall coverage decreased (-0.003%) to 88.073%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/unitary_synthesis.rs 1 94.79%
qiskit/circuit/library/standard_gates/r.py 1 97.56%
crates/accelerate/src/basis/basis_translator/mod.rs 2 88.97%
qiskit/synthesis/multi_controlled/mcx_synthesis.py 4 98.53%
qiskit/circuit/library/standard_gates/x.py 5 98.33%
qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py 6 95.8%
crates/qasm2/src/lex.rs 9 91.23%
crates/qasm2/src/parse.rs 12 97.15%
qiskit/transpiler/target.py 16 94.22%
crates/accelerate/src/target_transpiler/mod.rs 64 82.03%
Totals Coverage Status
Change from base Build 14034596400: -0.003%
Covered Lines: 72745
Relevant Lines: 82596

💛 - Coveralls

@ShellyGarion
Copy link
Member

Currently all the standard gates are ordered alphabetically. Does it make sense to order them according to the number of qubits (0,1,2,3,many) and then maybe according to the number of parameters (0,1,2,3)?

@ShellyGarion
Copy link
Member

copy here a comment about organizing the oracles (grover, phase, bitflip) in their own section:

#13769 (comment)

@ShellyGarion ShellyGarion self-assigned this Feb 10, 2025
@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Mar 5, 2025
@mtreinish
Copy link
Member

Since this is just documentation it can merge after 2.0.0rc1 is tagged before the final release. I've pre-emptively tagged it as stable backport potential because we'll need to backport it to stable/2.0 once that's created when we tag 2.0.0rc1.

@mtreinish mtreinish added the on hold Can not fix yet label Mar 5, 2025
Copy link
Member

@ShellyGarion ShellyGarion left a comment

Choose a reason for hiding this comment

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

It's a great start! need to rebase with main branch. I also have some comments.

@Cryoris Cryoris marked this pull request as ready for review March 24, 2025 15:54
@Cryoris Cryoris requested a review from a team as a code owner March 24, 2025 15:54
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

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

@Cryoris Cryoris removed the on hold Can not fix yet label Mar 24, 2025
Copy link
Member

@ShellyGarion ShellyGarion left a comment

Choose a reason for hiding this comment

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

Nicely written! I only have a few comments.

Comment on lines 25 to 27
Elements in the circuit library are provided as :class:`.QuantumCircuit`\ s or
:class:`~.circuit.Instruction`\ s, allowing them to be easily investigated or plugged into other
circuits. This enables fast prototyping and circuit design circuit at higher levels of abstraction.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Elements in the circuit library are provided as :class:`.QuantumCircuit`\ s or
:class:`~.circuit.Instruction`\ s, allowing them to be easily investigated or plugged into other
circuits. This enables fast prototyping and circuit design circuit at higher levels of abstraction.
The components in the circuit library are either :class:`.QuantumCircuit`\ s or
:class:`~.circuit.Instruction`\ s, allowing them to be easily manipulated and plugged into other
circuits. This enables fast prototyping and circuit design at higher levels of abstraction.

Cryoris and others added 2 commits March 27, 2025 09:58
Thank you Elena!

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
@ShellyGarion ShellyGarion self-requested a review March 27, 2025 10:40
Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

LGTM too. Just to be sure, did you also want to address the missing TO-DOs? (this can anyways be done in a follow-up)

@Cryoris Cryoris added this pull request to the merge queue Mar 28, 2025
@Cryoris
Copy link
Contributor Author

Cryoris commented Mar 28, 2025

Todo's are for a follow up, thanks! 🙂

Merged via the queue into Qiskit:main with commit 4675335 Mar 28, 2025
20 checks passed
mergify bot pushed a commit that referenced this pull request Mar 28, 2025
* Explain circlib design

e.g. why we use different gate types and what's the advantages

* separate old circuits and new gates

* alt text & broken links

* Apply suggestions from code review

Thank you Elena!

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* more review comments

---------

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
(cherry picked from commit 4675335)
github-merge-queue bot pushed a commit that referenced this pull request Mar 28, 2025
* Explain circlib design

e.g. why we use different gate types and what's the advantages

* separate old circuits and new gates

* alt text & broken links

* Apply suggestions from code review

Thank you Elena!

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* more review comments

---------

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
(cherry picked from commit 4675335)

Co-authored-by: Julien Gacon <jules.gacon@googlemail.com>
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 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
None yet
Development

Successfully merging this pull request may close these issues.

6 participants