Skip to content

Conversation

eliarbel
Copy link
Member

Summary

This PR adds the random_clifford_circuit function to API docs. The function was added in #12347 and was mentioned in previous release notes.

Details and comments

@eliarbel eliarbel added 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 Changelog: None Do not include in changelog labels Mar 23, 2025
@eliarbel eliarbel added this to the 2.0.0 milestone Mar 23, 2025
@eliarbel eliarbel requested a review from a team as a code owner March 23, 2025 13:38
@qiskit-bot
Copy link
Collaborator

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

  • @Qiskit/terra-core

@coveralls
Copy link

coveralls commented Mar 23, 2025

Pull Request Test Coverage Report for Build 14037738841

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.
  • 140 unchanged lines in 6 files lost coverage.
  • Overall coverage increased (+0.004%) to 88.072%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/unitary_synthesis.rs 1 94.79%
crates/qasm2/src/lex.rs 3 92.73%
qiskit/visualization/counts_visualization.py 3 76.92%
qiskit/visualization/library.py 4 0.0%
qiskit/visualization/timeline/plotters/matplotlib.py 4 0.0%
qiskit/visualization/state_visualization.py 125 57.37%
Totals Coverage Status
Change from base Build 13998385695: 0.004%
Covered Lines: 72626
Relevant Lines: 82462

💛 - Coveralls

Copy link
Member

@alexanderivrii alexanderivrii left a comment

Choose a reason for hiding this comment

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

Thanks @eliarbel for doing this. I agree that random_clifford_circuit is sufficiently useful to appear in the API docs alongside random_circuit.

Two small questions.

random_circuit is also mentioned here in this file:

There is also a utility for generating random circuits:
* :func:`random.random_circuit`

Do you want to add a sentence about random clifford circuits there as well?

We also have a function random_iqp that generates a random IQP circuit: https://docs.quantum.ibm.com/api/qiskit/dev/qiskit.circuit.library.random_iqp. Do you think it should be also included in the docs? Other that that, I don't think we have any other "random circuit" functions but best to double-check.

@ShellyGarion
Copy link
Member

note that random_iqp already appears in the circuit library docs (https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.random_iqp) so it'll be difficult to move it.

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.

To avoid scope creep, I would settle for adding random_clifford_circuit to

There is also a utility for generating random circuits:
* :func:`random.random_circuit`
("There are also utilities to generate random circuits..."), and not bother about moving the random_iqp, as it is not part of the random submodule and there are a couple of other similar functions in the circuit library that would have to be moved (such as random_bitwise_xor).

@eliarbel
Copy link
Member Author

I agree with @ShellyGarion and @ElePT, I would keep the state as is and stay with these 2 functions in qiskit.circuit.random as random_clifford is general purpose and random_clifford_circuit is probably common enough hence could be also considered as general purpose.

Copy link
Member

@alexanderivrii alexanderivrii left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@alexanderivrii alexanderivrii added this pull request to the merge queue Mar 24, 2025
Merged via the queue into Qiskit:main with commit 08095d3 Mar 24, 2025
20 checks passed
mergify bot pushed a commit that referenced this pull request Mar 24, 2025
* Add random_clifford_circuit to API docs

* Add it also to the circuit module doc

(cherry picked from commit 08095d3)
github-merge-queue bot pushed a commit that referenced this pull request Mar 24, 2025
* Add random_clifford_circuit to API docs

* Add it also to the circuit module doc

(cherry picked from commit 08095d3)

Co-authored-by: Eli Arbel <46826214+eliarbel@users.noreply.github.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