Skip to content

✨ Display value of ancillary qubits in simulation run editor of python syrec-editor application #542

@TooMuchDakka

Description

@TooMuchDakka

Problem Statement

Assuming that I have synthesized the following SyReC program:

module incr(inout a(4)) wire t(4)
++= a

module test(in a(4)) wire b(4), c(4)
 call incr(b)

module main(inout a(2), in b(4), out c(2)) wire d(4), e(4) state f(4) wire g(4)
 call test(b)

I am now simulating simulation runs that were either defined manually or imported from a .json file and see in the associated dialog that some missmatches between expected and actual output states were detected for some simulation runs as shown in the screenshot below:

Image

Determining which operation/quantum gate caused the output state missmatch would be quite cumbersome with the syrec-editor since the dialogs are only displaying the values of the quantum registers containing non-ancillary qubits and no debugger being available in the syrec-editor,

Proposed Solution

It would be nice, as long as no debugger is available, to display the value of the ancillary qubits in the simulation run editor that at the moment only shows the quantum registers storing non-ancillary qubits to aid with debugging since this dialog already offers functionality to search/filter quantum registers/qubits instead of the user having to manually determine the value of the qubits in a quantum register.

Image

However, one should keep the following points in mind when implementing a solution:

  • The label generated for the quantum registers storing the qubits of local variables do not match the identifier of the associated variable to prevent duplicate quantum register labels. Should one then display the qubit inline information to aid the user to determine which variable is associated with the quantum register and which statement caused its creation. The existing qubit inline information view in the editor view does something similar but remember that the generation of the qubit inline information can be toggled in the synthesis settings.
  • At the moment the dialogs created in the editor view -> quantum circuit simulation dialog -> simulation run editor dialog QtWidget hierarchy are created as modal dialogs (i.e. only interactions with the last dialog of the dialog chain are allowed thus the editor-view/quantum circuit simulation dialog cannot be moved as long as the simulation run editor dialog is open). Additionally, all child dialogs of the quantum circuit simulation dialog are opened and centered in the middle of the screen thus potentially occluding an already opened dialog (i.e. its parent dialog).
  • The value of the ancillary qubits should not be editable in the simulation run editor due to the ancillary qubits being expected to be initialized to 0 when performing a simulation.
  • Should the quantum registers for qubits storing intermediate results be displayed? At the moment ancillary qubits are not reused but this could change in the future.
  • The displayed value of the actual ancillary qubit when opening the simulation run editor after a simulation run is the value at the end of the simulation so any intermediate values (i.e. when reusing a local variable) are lost without a debugger. Should one add a tooltip to inform the user about this behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestpythonAnything related to Python codeusabilityAnything related to usability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions