Skip to content

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

@sbrandhsn

Description

@sbrandhsn

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. :-)

Metadata

Metadata

Labels

unitaryhackIssues/PR participating (now or in the past) in the UnitaryHack event see https://unitaryhack.dev/

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions