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

Create frontend interface #9

Merged
merged 4 commits into from
Jun 5, 2024
Merged

Conversation

Piwakk
Copy link
Contributor

@Piwakk Piwakk commented Jun 3, 2024

Closes: #4 (as part of unitaryHACK 2024)

Implement a FastAPI backend and a Dash frontend (http://127.0.0.1:8000/frontend/) to visualize the simulated results and the Qiskit Pulse Schedule of a QUA program.

Requirements in #4 are respected. One non-trivial issue remains: the code for plotting the simulated results is not transmitted through the API, so it has to be the same for all programs, which is obviously not possible. I'm not sure about what would be the best here (the current implementation uses the plotting code of test_rabi.py).

Run uvicorn quaqsim.api.backend:app, run _main.py and go to http://127.0.0.1:8000/frontend/ to test.

Note: _main.py is included in this PR temporarily, as a way to quickly test the API.

image

Piwakk added 2 commits May 31, 2024 23:33
`simulate_program()` only uses a `qm.Program` to extract a
`program_ast.program.Program`. Allow passing a
`program_ast.program.Program` directly. Since a `qm.Program` is hard to
serialize, this eases the interactions with an API.
@CLAassistant
Copy link

CLAassistant commented Jun 3, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@nulinspiratie nulinspiratie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic Piwakk! I managed to get it working locally, and it looks good and matches the requirements.
I agree with your comment regarding plotting, it requires some more thinking, but that's for a future PR.

Before approving, I found that a few new packages are introduced, could you add these to the requirements? The packages are requests, fastapi, uvicorn, dash_bootstrap_components.

And again, nicely done!

@Piwakk
Copy link
Contributor Author

Piwakk commented Jun 4, 2024

Fantastic Piwakk! I managed to get it working locally, and it looks good and matches the requirements. I agree with your comment regarding plotting, it requires some more thinking, but that's for a future PR.

Before approving, I found that a few new packages are introduced, could you add these to the requirements? The packages are requests, fastapi, uvicorn, dash_bootstrap_components.

And again, nicely done!

Thanks for the feedback! 😊 I've added the dependencies.

@Piwakk Piwakk requested a review from nulinspiratie June 4, 2024 17:30
Copy link
Contributor

@nulinspiratie nulinspiratie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@nulinspiratie nulinspiratie merged commit ae46694 into qua-platform:main Jun 5, 2024
1 check passed
@Piwakk Piwakk deleted the frontend branch June 5, 2024 21:07
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 this pull request may close these issues.

Create frontend interface
3 participants