Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support QASM -> Blocks #9

Open
Roger-luo opened this issue May 18, 2021 · 4 comments · May be fixed by #13
Open

support QASM -> Blocks #9

Roger-luo opened this issue May 18, 2021 · 4 comments · May be fixed by #13

Comments

@Roger-luo
Copy link
Member

currently missing QASM -> Blocks pass, you will need to define a qasm_str macro to support the syntax that YaoLang has.

@Sov-trotter
Copy link
Member

I wonder what advantage would a macro have than a method. Since the qasm output is just a list, it's fairly simple to convert it back to blocks?

@Roger-luo
Copy link
Member Author

Roger-luo commented May 26, 2021

so what you actually want to have in the macro is to generate a new julia function that returns a block, when you see gate statements in the QASM AST.

Or you won't be able to support subroutines defined by QASM.

@Sov-trotter
Copy link
Member

Though I am still not clear about how this macro should work, I am assuming something on the lines of https://github.com/QuantumBFS/YaoTargetQASM.jl/blob/master/src/frontend.jl???

@Roger-luo
Copy link
Member Author

The YaoTargetQASM implementation should be similiar to this one except that you don't need to support classical function and control flows, which makes things a lot simpler.

I'm expecting when you see a gate statement in QASM, convert it to a Julia function that returns the corresponding blocks, e.g consider how would you compile this file: https://github.com/QuantumBFS/YaoTargetQASM.jl/blob/master/test/qelib1.inc#L4

@Sov-trotter Sov-trotter linked a pull request May 29, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants