softwareQinc / staq

Full-stack quantum processing toolkit
https://iopscience.iop.org/article/10.1088/2058-9565/ab9359/pdf
MIT License
152 stars 28 forks source link

Questions: "Input layout" and "Output layout"; swap and steiner #26

Closed DevelopDaily closed 3 years ago

DevelopDaily commented 3 years ago

Could you please clarify a few concepts?

In the previous issue (#20), when the swapmapping algorithm is used, the "Output layout" is produced in addition to the "Input layout". Could you please explain the concepts? I thought, when the physical circuit is sent out to a real device for a run, there would be only one layout?

You suggested we use the steiner. It does work better for us so far. Are there any circumstances where the swap is supposed to have an advantage?

meamy commented 3 years ago

Regarding the first question, it's only really relevant in the case when you want to test the circuit on specific inputs. In particular, if you want to test a circuit with a qubit x beginning in some state |psi>, if x is mapped to q[i] in the beginning and q[j] at the end, the simulator would need to begin with q[i] in state |psi>. I don't imagine this situation would arise very often, but at least the information is there if someone needs it.

As for circumstances where swap would have an advantage, it's a bit tricky to know offhand it seems. The only thing that comes to mind as being an obvious better case for swap is when the circuit is already (1) CX minimal, and (2) close to conforming to the architecture.

DevelopDaily commented 3 years ago

Thanks. I'll use the non-trivial circuits to test swap more.