Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
4.84k stars 2.29k forks source link

Improve the Generation of Random Circuits #11718

Open sbrandhsn opened 5 months ago

sbrandhsn commented 5 months ago

What should we add?

The current generation of randomized circuits is fairly inflexible as it only allows to specify a limited number of circuit characteristics: the number of qubits, depth, maximum number of qubits in a quantum gate, and a couple of options allowing for measurements, conditional operations or resets in the random circuit. Ideally, the generation of random circuits would allow more parameters as an input, e.g. the structure of a circuit, the amount of parameterizable quantum gates, or a finer definition on the permissible types of quantum gates. I would like to use this issue to first discuss which parameters would be reasonable inputs and then track the progress on this.

I have a couple of parameters in mind:

doublehoon commented 4 months ago

Hi, I'm interested in this issue. I have also made modifications to the gateset directly in the library code of my local environment while generating random circuits. However, one concern is determining how precisely to implement those parameters because it might seem challenging. Could you provide any specific examples where you felt those parameters were necessary? I believe it would be beneficial to set appropriate goals and gradually add parameters as needed!

sbrandhsn commented 4 months ago

Hi @doublehoon awesome! I think this issue is deliberately defined in a broad way to allow and discuss all kinds of contributions. Some of the discussed parameters are also conflicting or correlating with each other, e.g. the number of CNOT gates might likely correlate with the density/sparsity of the quantum circuit. So, finding a general method that addresses all of these parameters seems difficult. Although this might be possible in a general way for small-scale instances with blackbox optimization techniques such as genetic algorithms.

Are you particularly interested in one set of parameters? I can imagine that it would be worthwhile to have different random circuit generators that each target a different aspect of the described parameters. An user could then select the best suited generator for their task or follow-up work can be done to combine the generators in a certain way.

sbrandhsn commented 4 months ago

Maybe https://arxiv.org/abs/2402.13352 can be used as a basis. :-)