QuantumBFS / Yao.jl

Extensible, Efficient Quantum Algorithm Design for Humans.

Home Page:https://yaoquantum.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

integrate YaoBlocks with IBMQClient and OpenQASM

Roger-luo opened this issue · comments

This issue has been tagged for a bounty during #unitaryHACK

Although, these two packages were initially made for YaoLang, supporting them for YaoBlocks should be simple to implement since YaoBlocks only supports pure quantum circuit programs.

now with the v0.3 release of IBMQClient, the API should be stable. One could integrate YaoBlocks with IBMQClient by transforming the quantum blocks to the corresponding Qobj schema defined here: https://yaoquantum.org/IBMQClient.jl/dev/schema/

for OpenQASM 2.0, one can refer to the AST here:

https://github.com/QuantumBFS/OpenQASM.jl/blob/master/src/types.jl

I think some work in similar direction has been done here https://github.com/Sov-trotter/IBMQJulia.jl/blob/main/src/qobj.jl.
I'd love to work on this issue?

On initial though I think we can dispatch a single transform function to the specific schema constructors? Is it the right way to go?

Yes, I think it in general should work in the same way in the previous implementation. On the other hand, I think we should create a Yao branded package for this since this is quite Yao specific (unlike the REST API wrapper), e.g YaoBlocksQASM and YaoBlocksQobj

Yeah that makes sense.
I am also wondering what this integration should look like?
Do we provide methods like in the previous implementation which just needs the qbir circuit as input or something more like https://yaoquantum.org/IBMQClient.jl/dev/#Usage where one has to create the qobj manually?

Secondly I have created the package here. Shopuld I move it to the QuantumBFS org?

Do we provide methods like in the previous implementation which just needs the qbir circuit

Yes, the input is a QBIR circuit, and the output is QASM and Qobj

Secondly I have created the package here. Shopuld I move it to the QuantumBFS org?

Yes, please move them to QuantumBFS org, you will also need a repo for QASM.

@Sov-trotter remember to let me review the PR when you submit them to YaoBlocksXXX, since we need to link that with unitary hack tag

Yeah.
Unfortunately there isn't any major PR for YaoBlocksQobj since I was working on it before moving it to the org.(only https://github.com/QuantumBFS/YaoBlocksQobj.jl/pulls?q=is%3Apr+is%3Aclosed)

As for YaoBlocksQASM there is QuantumBFS/YaoBlocksQASM.jl#1.

I merged the PRs after verifying the results. I would love if you can review both the packages. @Roger-luo

Hey @Roger-luo! I just wanted to clarify what all is left to be done in order to have these tasks qualify for the bounty, since I am abit preoccupied with other projects, I wish to solve some of the issues later.

The Qobj one is roughly done, there's only last main issue need to resolve here

QuantumBFS/YaoBlocksQASM.jl#9
QuantumBFS/YaoBlocksQASM.jl#8

Is it okay if I take them up slowly(beyond the timeline of UnitaryHack)?

@Sov-trotter I think these two issues is quite simple to finish, they were supposed to be in the comment the initial PRs, and there are still a few days by the end of UnitaryHack IIRC? It'll be easier if we can just wrap up them quickly. But I'm OK as long as you promised to resolve them afterwards, or it will be unfair to other contributors.

Hey @Roger-luo is the work so far approved for the bounty?

yes, but you need to finish up the QASM conversion afterwards.

Yeah. Sure.

@Sov-trotter and @Roger-luo let me know when there is a PR I can reference for the results page on the unitaryHACK website!

@crazy4pi314 can we link to these two packages? this issue actually creates two packages (the QASM one still needs some work as disscussed above tho)

https://github.com/QuantumBFS/YaoBlocksQobj.jl
https://github.com/QuantumBFS/YaoBlocksQASM.jl

added to the top of the results page! Thanks @Roger-luo and @Sov-trotter 👏