-
Notifications
You must be signed in to change notification settings - Fork 5
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 #4
Comments
Hi! I have started to work on this issue as part of unitaryHACK 2024. However, I've come across a bug in serialization / deserialization of a Program. One can reproduce the issue by inserting a serialization / deserialization step in def test_simultaneous_rabi(transmon_pair_backend, transmon_pair_qua_config, config_to_transmon_pair_backend_map):
start, stop, step = -2, 2, 0.1
with program() as prog:
a = declare(fixed)
with for_(a, start, a < stop - 0.0001, a + step):
play("x90"*amp(a), "qubit_1")
play("x90"*amp(a), "qubit_2")
align("qubit_1", "qubit_2", "resonator_1", "resonator_2")
measure("readout", "resonator_1", None)
measure("readout", "resonator_2", None)
new_prog = dill.loads(dill.dumps(prog))
results = simulate_program(
qua_program=new_prog,
qua_config=transmon_pair_qua_config,
qua_config_to_backend_map=config_to_transmon_pair_backend_map,
backend=transmon_pair_backend,
num_shots=10_000,
# schedules_to_plot=[0]
)
# plt.show() The error:
I've the same error when using Versions of seemingly relevant libraries:
Has someone encountered this error before? @nulinspiratie did you have something else in mind when mentioning “a binary Dill object (the qua.program object)”? |
Hi @Piwakk! I see that you're trying to serialize the program itself, and although I can't comment on why it's not serializable, I know it's not the most friendly data structure and not everything that's valid in that object is supported for Qua-Qsim. I suggest if you want to serialize the program, you should serialize the program AST: It is the object created on line 21 here in the first pass of the compiler:
Although this data structure is currently hidden a couple of layers down into the |
Hi @Piwakk great to have you on board! I wasn't aware that serializing a QUA program would cause issues. I agree with @deanpoulos that serializing |
Hi @nulinspiratie, would it be possible to be assigned to this issue? I think UnitaryHACK needs it to know I've solved it. Thanks! |
Also in this one, apologies but it's fixed now |
Create a web app to interact with simulation results
The current Qiskit backend can compile a QUA program into a Qiskit Pulse Schedule.
After the compilation, the Pulse Schedule can be run on a simulated quantum system, providing results in the form of arrays.
Encapsulating the compiler and simulator into a web app would allow the outputs (Pulse Schedule + simulated results) to be visualized in a webpage.
External programs such as an IDE can submit QUA programs to be simulated on the web app backend, and the results are then viewed on the web frontend, enabling seamless integration into existing workflows.
This feature can serve as a base for issues #5 and #6
Requirements
Dash and FastAPI
It is recommended that both the Pulse Schedule and Simulated results are displayed on a webpage using Plotly Dash.
However, suitable alternative solutions can also be proposed.
To combine this into a web app with an API, Dash should be embedded into FastAPI.
For details see Embedding Dash dashboards in FastPI framework
This allows external programs to submit QUA programs, configurations, and other necessary settings.
FastAPI API calls
/api/submit_qua_configuration
- Submit QUA configurationsimulate
is called/api/submit_qua_program
- Submit a QUA programsimulate
is called/api/submit_quantum_system
- Submit the simulation quantum system/api/submit_channel_map
- Submit the qua → qiskit channel map/api/simulate
- Simulate system using the latest QUA program, configuration, etc.num_shots
Default is 1000TransmonPairBackendFromQUA
/api/status
- Check simulation status/api/reset
- Forget QUA configuration, program, quantum_system, channel_map, results, and any visuals on the frontendAcceptance criteria
api/simulate
should start the simulationThe text was updated successfully, but these errors were encountered: