pyzx icon indicating copy to clipboard operation
pyzx copied to clipboard

input qasm file format

Open anitalu724 opened this issue 2 years ago • 4 comments

Hi, thanks for the useful tool for implementing ZX-calculus. I'm wondering if it is possible to enter all formats of qasm files, since I found out that some gates like P-gate, CP-gate, and so on are not supported by the load function provided in this tool. Thanks~

anitalu724 avatar Apr 26 '22 06:04 anitalu724

That would certainly be possible. Is there a specific library that uses these gates? I don't really know what a 'P' gate is namely (I'm assuming 'CP' is just a controlled-P gate)

jvdwetering avatar Apr 26 '22 11:04 jvdwetering

In my viewpoint, qasm format is kind of free style. However, in the tool Qiskit provided by IBM, there are a couple of gate definitions. Qiskit Gate Library The output qasm files of Qiskit contain some of these gates which are not supported in PyZX.

anitalu724 avatar Apr 26 '22 12:04 anitalu724

That list you link does not mention a P gate, unless I missed it?

jvdwetering avatar Apr 26 '22 22:04 jvdwetering

Sorry, I didn't explain it clearly enough. P-gate is equivalent to PhaseGate in the Qiskit Gate Library. Some papers and tutorial called PhaseGate "P-gate" for short.

anitalu724 avatar Apr 27 '22 01:04 anitalu724

Hi, @anitalu724,

I am working on #156 which is going to add support for most of the OpenQASM standard library gates. Besides p and cp, was there anything else you needed?

dlyongemallo avatar Sep 20 '23 06:09 dlyongemallo

As of PR #156 both p and cp are supported, along with the most common qasm gates, so unless there are other requested gates, this issue can be closed.

dlyongemallo avatar Oct 06 '23 07:10 dlyongemallo