qbraid.interface.random.random_circuit

random_circuit(package, num_qubits=None, depth=None, graph=None, **kwargs)[source]

Generate random circuit of arbitrary size and form.

Parameters:
  • package (str) – qBraid supported software package

  • num_qubits (int, optional) – Number of quantum wires. If not provided, set randomly in range [1,4].

  • depth (int, optional) – Layers of operations (i.e. critical path length) If not provided, set randomly in range [1,4].

  • graph (ConversionGraph, optional) – Conversion graph to use for transpilation

  • **kwargs – Additional keyword arguments to pass to the random circuit generator

Raises:
  • PackageValueError – if package is not supported

  • ValueError – when no conversion path exists for the specified package

  • QbraidError – when random circuit generation fails for the specified package

Returns:

randomly generated quantum circuit/program

Return type:

qbraid.programs.QPROGRAM