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

Feature request: integration with Yao ecosystem #16

Open
kshyatt-aws opened this issue Dec 7, 2022 · 21 comments
Open

Feature request: integration with Yao ecosystem #16

kshyatt-aws opened this issue Dec 7, 2022 · 21 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kshyatt-aws
Copy link
Member

Describe the feature you'd like
Integrate Braket.jl and Yao.jl to allow Yao users to run circuits/AHS programs on Braket.

Is this feature already present in the Python SDK?
No.

How would this feature be used? Please describe.
Would allow Yao users to seamlessly run their existing quantum circuits on real QPUs. Would also enable Bloqade users to run AHS programs directly on QuEra's Aquila device.

cc: @Roger-luo @GiggleLiu

@kshyatt-aws kshyatt-aws added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 7, 2022
@Roger-luo
Copy link
Collaborator

For reference a good starting point is to look at the schema translation project for IBM Q: https://github.com/QuantumBFS/YaoBlocksQobj.jl and for OpenQASM: https://github.com/QuantumBFS/YaoBlocksQASM.jl

@ruihao-li
Copy link

Hi @kshyatt-aws, @egolias1 and I are interested in working on this, potentially as a Hackathon project for QHack. Before getting started, we would like to ask if you want this feature to be something integrated in Braket.jl or a standalone package like the two projects highlighted by @Roger-luo? Thank you.

@kshyatt-aws
Copy link
Member Author

Hello,

That's awesome 🤩 . To my mind, it would make sense to start as a separate, standalone package - that way you don't need to rely on me to merge things or to unblock CI for you. Once you're up and running we can consider whether it would make sense to fold it in here as a subpackage (like PyBraket), add it to the Yao org, or keep it independent.

This is really exciting! Please don't hesitate to reach out at any time if you run into issues or need clarification on something.

@ruihao-li
Copy link

Great! Thanks for the clarification. That makes sense.

Would you still be on the Discord channel for the QHack period in case we encounter any technical difficulties? If not, what would be the best way to reach you? @kshyatt-aws

@kshyatt-aws
Copy link
Member Author

Absolutely, I plan to be in the QHack discord throughout the event. You can also reach out to me on Julia slack (kshyatt there).

@ruihao-li
Copy link

Awesome! Thanks Katharine.

@Roger-luo
Copy link
Collaborator

Please also feel free to ask questions in Julia slack at #yao-dev channel or just post issues under Yao's repo.

@ruihao-li
Copy link

Hi @kshyatt-aws, @Roger-luo, I just finished prototyping the Yao-to-Braket translation here. At this point it does not contain support for Bloqade. It basically follows the two projects provided by Roger. I just wanted to get some initial feedbacks from you to see if I'm on the right track and if this is the implementation you wanted. Any comments/suggestions are greatly appreciated!

@Roger-luo
Copy link
Collaborator

Thanks @ruihao-li It looks quite nice, it would be nicer if you could setup a CI and write some tests for the package, so we can know the detailed interface of what you write and guarantee the correctness of the implementation. You can copy paste the CI configurations from here: https://github.com/Roger-luo/Configurations.jl/blob/main/.github/workflows/tests.yml

@ruihao-li
Copy link

Thanks @Roger-luo for the suggestions! I added the CI. I have some preliminary tests inside. Is there any particular tests you have in mind?

@Roger-luo
Copy link
Collaborator

No, I think the current test looks good already, I just want to make sure the test coverage is high enough. I think since now Julia has weakdeps, it might make sense to move that package to Braket.jl as an extension package (or in Yao repo) now, so when someone does using Braket, Yao this package will get loaded automatically. What do @kshyatt-aws think?

@kshyatt-aws
Copy link
Member Author

Amazing! I'll take a detailed look tomorrow but it's awesome to see this.

@kshyatt-aws
Copy link
Member Author

OK! I think in terms of tests, it would be great to re-implement as many of the Yao easybuild tests as are feasible. Ideally the ones you can run on the local simulators through PyBraket, so that you don't need to spend credits.

Additional ideas:

  • Take some of the simulator tests in this package's test/integ/ and port them to Yao, but still run them on the Braket (local) simulators, to make sure circuit and result translation work
  • Similarly, reimplement some of the non-AHS, non-PennyLane examples and check the results are consistent.

Does the plugin wrap any of the Braket "quality of life" features, such as cost tracking or Hybrid Jobs? I don't think these are necessary for a first release but if there is a nice way to integrate them, that would be great.

PS. don't forget to make a PR to the Yao docs once this is released to update

Using Yao, we can simulate the qubits, without having a quantum computer(based on the known mathematical and physics rules), although the support to run your circuits on Yao using real qubits is coming to Yao soon.

😉

In tems of the weakdeps idea suggested by @Roger-luo , I think that would be great. It might make sense for this to live in the Yao org initially but we can discuss once the tests are in place.

@ruihao-li
Copy link

Thanks for the great suggestions, @kshyatt-aws! I will start working on the tests and think about the "quality of life" features you mentioned (which the plugin does not support right now) after the March Meeting.

@kshyatt-aws
Copy link
Member Author

Great. Please reach out if you run into any issues, and enjoy March Meeting!

@Roger-luo
Copy link
Collaborator

@ruihao-li please feel free to tag me to transfer the repo to Yao org, we might be able to accept it as part of a Yao extension since the implementation is quite simple. But probably need to wait on 1.9 is out as release

@ruihao-li
Copy link

@Roger-luo Sure thing. Thanks. When do you think it's a good time to make the transfer? After more tests are implemented, or after Julia 1.9 is out?

@Roger-luo
Copy link
Collaborator

After Julia 1.9 is out is better, so we don't need to change the CI, but perhaps you could open a PR first and we can merge it (and give a final test) when it's out.

@kshyatt-aws
Copy link
Member Author

Just coming back to (gently) ping @ruihao-li - any updates? Anything I can help with?

@ruihao-li
Copy link

@kshyatt-aws Sorry for being silent for a while. I was unfortunately sick last week and had some personal matters to attend to. My plan for now is to revise the implementation and open a PR for making it a Yao extension by the end of this week. Then more tests can be added. What do you think?

@kshyatt-aws
Copy link
Member Author

No worries! Sorry to hear you were sick, hope things are better now. The plan sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants