Skip to content

🐛 Value of qubits of state variables not editable in syrec-editor and not correctly matched in output state matching #541

@TooMuchDakka

Description

@TooMuchDakka

System and Environment Information

  • Windows 10 x64
  • Clang: 19.1.5
  • mqt-syrec: Latest commit of main branch (0f20935)
  • Python: 3.10.11

Bug Description

According to the RevLib 2.0.1 specification section 2.1, qubits generated for local SyReC module variables of type state are data qubits and their value thus editable in the simulation run editor of the syrec-editor and checked when determining whether the expected and actual output state of a simulation run match in both the C++ tests as well as the syrec-editor.

While the data qubits generated for the parameters of the defined main module of a SyReC module form a consecutive sequence of qubits starting with qubit 0 (i.e. the qubit range [0, N) with N being the first ancillary qubit), said qubit sequence is not the only containing data qubits due to the qubits generated for variables of type state also being considered as data qubits. However, the current C++ simulation tests, simulation run editor, input state generator as well as the simulation run execution dialogs/workers in the python syrec-editor assume that the data qubits are only defined in the qubit range [0, N).

Steps to Reproduce

  1. Perform a build from source of mqt.syrec
  2. Launch the installed syrec-editor executable
  3. Synthesize 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)
    
  4. Open the simulation view in the syrec-editor
  5. Either add a single simulation run or generate all simulation run combinations and check the displayed quantum registers or their generated values (the latter only when generating all simulation run combinations).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingc++Anything related to C++ codepythonAnything related to Python code

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions