Skip to content

🐛 Synthesis of right shift does not generate correct gate sequence #258

@TooMuchDakka

Description

@TooMuchDakka

Environment information

  • OS: Windows
  • C++ Compiler: clang 17.0.3
  • MQT-Core: 3.0.2
  • MQT-Syrec: Main branch commit 2ba6873

Description

A shift expression using the right shift operation is currently synthesized as a sequence of CNOT gates while ignoring the defined shift amount of the operation. A simulation of the following SyReC program:

module main(in a(4), out b(4)) 
b ^= ~(a >> 2) 

with the input state a=1 (0001), b=0 leads to the result a=1, b=14 (1110)

Expected behavior

For the given input state a=1, b=0 the expected output state is a=1, b=15 (1111).

How to Reproduce

  1. Install mqt.syrec version 1.21.1 via pip install mqt.syrec==1.21.1
  2. Launch the syrec-editor python application and copy the SyReC circuit from the bug description into the code editor
  3. Select either the cost or line aware synthesis radio button and then press the 'Build' button

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions