Open efratshabtai opened 2 months ago
Following this since I'll use this feature immediately when it becomes available.
Seems like this is already working.
In which version of CUDA-Q? I think I have 0.8 running and it's not working there.
My mistake, I found an error in my code that was causing the problem. It works for me now.
Thanks @mmvandieren. Closing this now.
I can clarify what is meat by this issue. It does not appear to do what is required.
For example, here is a QFT mirror circuit that consists of an initialization step, followed by a QFT, then an inverse QFT (defined as kernels). When I create this circuit in Qiskit using sub-circuits, and then print it, it shows the sub-circuits with their names "qft" and "inv_qft" ... it does not print the gate implementation for these kernels. In this code, I then print the two kernels independently, giving me a lot of control as to what level of detail I want to display. The first image below is what I get when I independently print the top-level circuit and the two sub-circuits.
In CUDAQ, I have not found a way to accomplish the same thing. When I print the top-level circuit using the draw function, it always expands the circuit to include all the underlying gates, as in the second image below. You can imagine if I have a large circuit with many instances of the same kernel underneath but with different parameters, there would be much repetition. What I need is to be able to see just the instance of the sub-kernels, and then decide whether I want to print them or not.
In the second issue, you will see also an attempt to create a barrier using swap gates, just for the purposes of making the diagram clearer. In Qiskit the barrier operation does this and makes the circuit diagrams look better. Issue #1887 asks for barrier, but I had used this hacky technique since we do not have them.
1) The Qiskit version with sub-circuits and barriers:
2) The cudaq version with hacky barriers and all gates expanded:
Can this Issue be reopened?
Reopening the issue to investigate further.
Required prerequisites
Describe the feature
Nested kernels are currently not supported in CUDA-Q circuit visualization.