Graph Representation of quantum circuit

Sorry for cross-posting. I put this underDiscussionson the cudaq Github repo, but perhaps this is a better place to discuss this.

I’m tasked with implementing a quantum circuit-cutting algorithm in cudaq (decomposing a quantum circuit into subcircuits and using classical computation to “combine” their results). We have a reference implementation in qiskit but we’d like to move to cudaq to leverage multiple gpus (and stay close to the Nvidia ecosystem).

My question is - what might be a possible roadmap for us to do this? qiskit provides a DAG view of the circuit object that one can manipulate (and thus create sub-circuits). I didn’t find any such possibility in the CudaQ Python API. Is this correct, or maybe I’m missing something? We were hoping to do this in Python, but if dropping down to the C++/IR level is the only way to do this, we’d like to know..

The graph examples I see in cuda-academic are of course for solving classical graph problems using quantum circuits, but don’t provide the graph representation of the circuit (kernel) itself.

Scanning the code, I saw some stuff in Device.h that might be related to this, but I don’t see it exposed through pybind11, (and that header file is not even part of the release files, so I’m guessing all that code is meant to be internal?).

Thanks!

If this is going to be tricky to do entirely in cudaq python, I’m leaning towards having our users start off in the qiskit world, create their qiskit.QuantumCircuit there, perform cutting or any other circuit manipulations. Our code could then, under the hood, create an AST using the structure of the circuit (or resulting subcircuits), and pass it on to the cudaq.kernel function (normally used as a decorator, but I see that it can work with AST trees as well), and then we should have access to the CudaQ ecosystem.