QuTech-Delft / OpenQL

OpenQL: A Portable Quantum Programming Framework for Quantum Accelerators. https://dl.acm.org/doi/10.1145/3474222
https://openql.readthedocs.io
Other
99 stars 44 forks source link

Mapping graph visualizer #390

Closed tmeer closed 3 years ago

tmeer commented 3 years ago

The mapping graph visualizer provides a way to follow the movements of the virtual qubits throughout the execution of the circuit.

It does so by adding an additional struct parameter to the definition of a gate in gate.h. When the mapper adds a swap gate, this struct is filled with the real and virtual qubits involved in the swap. This struct is then propagated through all the gates the swap decomposes into, thereby making each gate involved in the swap identifiable. The visualizer then uses this information to construct the mapping graph.

Note that the swap information is not propagated through a clifford optimization. Doing so would contaminate gates outside of a swap that are optimized together with gates from inside a swap with the swap parameters. This does not have any effect on the visualization of the mapping graph.

jvanstraten commented 3 years ago

Hm. Not sure why this wasn't merged, I guess I expected someone else to look at it too. An easy-fix merge conflict snuck in, so I fixed that. Will merge when CI finishes.