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

Controlling the Insertion of Multi-Qubit Gates in the Generation of Random Circuits #12059

Closed
sbrandhsn opened this issue Mar 21, 2024 · 2 comments · Fixed by #12483 · May be fixed by #12475
Closed

Controlling the Insertion of Multi-Qubit Gates in the Generation of Random Circuits #12059

sbrandhsn opened this issue Mar 21, 2024 · 2 comments · Fixed by #12483 · May be fixed by #12475
Assignees
Labels
unitaryhack Issues/PR participating (now or in the past) in the UnitaryHack event see https://unitaryhack.dev/

Comments

@sbrandhsn
Copy link
Contributor

What should we add?

The generation of random circuits should be extended by the ability to specify a distribution num_operand_distribution that specifies the ratio of 1-qubit, 2-qubit, ..., n-qubit gates in the random circuit. For instance, random_circuit with num_operand_distribution={1: 0.5, 2:0.5} should yield random circuits with roughly 50% single-qubit quantum gates and 50% two-qubit gates while disallowing n-qubit gates with n>2.

The parameter max_operands should take precedence, i.e. if max_operands is set, draw a random distribution num_operand_distribution. Raise an error if sum(num_operand_distribution.values()) != 1.0 or if max_operands is set at the same time as num_operand_distribution or if any key in num_operand_distribution is larger than the largest available n-qubit gate (see get_standard_gate_name_mapping).

Please also add tests to validate your changes and add a release note according to https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md

Note that this is a subtask of #11718. :-)

@sbrandhsn sbrandhsn added the unitaryhack Issues/PR participating (now or in the past) in the UnitaryHack event see https://unitaryhack.dev/ label Mar 21, 2024
@1ucian0
Copy link
Member

1ucian0 commented May 29, 2024

This issue is participating on UnitaryHack 2024, between May 29 and June 12, 2024.

Because the nature of the event, there is no need to request to be assigned: just go ahead and PR your fix. The first/best PR can get the bounty (or it could be shared if they complement each other).

shravanpatel30 added a commit to shravanpatel30/qiskit that referenced this issue May 30, 2024
@sbrandhsn sbrandhsn assigned sbrandhsn and unassigned sbrandhsn Jun 7, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 7, 2024
…eneration of Random Circuits #12059 (#12483)

* unitaryHACK Controlling the Insertion of Multi-Qubit Gates in the Generation of Random Circuits #12059

* Fixed linting issues

* Fixed long lines and unused variable

* Added requested changes

* Removed unused imports

* Added a test

* Added the stochastic process comment and edited releasenotes

* Update qiskit/circuit/random/utils.py

* lint...

---------

Co-authored-by: Sebastian Brandhofer <148463728+sbrandhsn@users.noreply.github.com>
@shravanpatel30
Copy link
Contributor

@sbrandhsn Thanks for reviewing and accepting the PR. Please assign this issue to me.

Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this issue Aug 1, 2024
…eneration of Random Circuits Qiskit#12059 (Qiskit#12483)

* unitaryHACK Controlling the Insertion of Multi-Qubit Gates in the Generation of Random Circuits Qiskit#12059

* Fixed linting issues

* Fixed long lines and unused variable

* Added requested changes

* Removed unused imports

* Added a test

* Added the stochastic process comment and edited releasenotes

* Update qiskit/circuit/random/utils.py

* lint...

---------

Co-authored-by: Sebastian Brandhofer <148463728+sbrandhsn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unitaryhack Issues/PR participating (now or in the past) in the UnitaryHack event see https://unitaryhack.dev/
Projects
None yet
3 participants