Closed sbrandhsn closed 1 month ago
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).
@sbrandhsn Thanks for reviewing and accepting the PR. Please assign this issue to me.
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
withnum_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. ifmax_operands
is set, draw a random distributionnum_operand_distribution
. Raise an error ifsum(num_operand_distribution.values()) != 1.0
or ifmax_operands
is set at the same time asnum_operand_distribution
or if any key innum_operand_distribution
is larger than the largest available n-qubit gate (seeget_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. :-)