quantumlib/Qualtran

Fix bugs in ECAdd Circuit

Opened this issue · 0 comments

There are a few bugs with the ECAdd circuit from https://arxiv.org/abs/2306.08585. The inputs and outputs are fine, but in steps 2, 5, and 6 some of the flag bits are freed before they are set correctly back to zero. The circuit shows that none of the qubits are freed when dirty, however this is not the case. The following bugs exist:

  1. Step 2: lam = lam_r undoes f1 when it should only happen if lam is set to lam_r
  2. Step 5: free dirty reg lam when a,b=x,y (not sure why)
  3. Step 6: free dirty reg when x,y = 0,0
    1. when b = y = 0, but x != 0: f2 never gets flipped back
    2. when p1 = p2 and f4 not set f4 gets flipped on