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

Live conversion from QUA to Qiskit simulations #5

Closed
nulinspiratie opened this issue May 21, 2024 · 2 comments · Fixed by #10
Closed

Live conversion from QUA to Qiskit simulations #5

nulinspiratie opened this issue May 21, 2024 · 2 comments · Fixed by #10
Assignees
Labels

Comments

@nulinspiratie
Copy link
Contributor

nulinspiratie commented May 21, 2024

While writing a QUA program, it would be highly useful to see its effect on a simulated quantum system in real time.

Example

Slide1

Implementation details

Frontend details

simulation details

Here are useful APIs and programs used to generate the example:

  • Power Rabi program: This program is a single-dimensional sweep with one QUA variable a, and is a great program to verify the front-end.
  • Schedule Plotting: The schedules_to_plot argument accepts a list of indices of schedules to plot. These plotting mechanisms behind this function should be called/cached and reshaped in the background to display the schedule as a function of the QUA variable value on the slider.
results = simulate_program(
        qua_program=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] <-------- here!
)
  • Results plotting: Once the results are fetched, they can be plot on the y-axis, with the values that the QUA variable will take on on the x-axis.
    # make sure no single point is different to expected within 0.1 tolerance
    q1_state_probabilities = np.array(results[0])
    q2_state_probabilities = np.array(results[0])
    amps = np.arange(start, stop, step)

    for i, result in enumerate(results):
        plt.plot(np.arange(start, stop, step), results[i], '.-', label=f"Simulated Q{i}")
        plt.ylim(-0.05, 1.05)
    plt.legend()
    plt.show()

Open questions

  • There are different levels of "real time".
    • At a minimum, there should be a command that can be called that takes a QUA program, compiles and simulates it, and then displays a plot.
    • A step above this is a background process with an API that can receive a serialized QUA program and compile+simulate it
    • Another step above is that this background process watches a file for changes and then plots that.
    • What level of real time are we looking for?
  • How to add the config to this live converter?
  • Where should it plot the results? In the frontend web app or as a program?
@Piwakk
Copy link
Contributor

Piwakk commented Jun 17, 2024

Hi @nulinspiratie, just like #4, could I be assigned to the issue? Thanks!

@nulinspiratie
Copy link
Contributor Author

Apologies, I thought I was supposed to add you to the PR. Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants