trishullab / Quasimodo

MIT License
6 stars 6 forks source link

Issue with the MCX gate using CFLOBDD backend #9

Closed s-jobra closed 5 months ago

s-jobra commented 5 months ago

Hi, I just wanted to let you know that it looks like there is some issue with CFLOBDDs and the MCX gate as well, specifically when i run this

#include "quantum_circuit.h"

int main()
{
    CFLOBDDQuantumCircuit qc;
    qc.setNumQubits(3);
    std::vector<long int> controllers = {0, 2};
    qc.ApplyMCXGate(controllers, 1);

}

it crashes with

Hash of a non-canonical ReturnMapHandle occurred
Aborted
cs14b052 commented 5 months ago

Looks like it was an older version. Please check now.

s-jobra commented 5 months ago

Hmm I still get the same error for the above mentioned example.

cs14b052 commented 5 months ago

Fixed it. The issue was that the current code has been written with the assumption of the index of controllers < controlled. I fixed it now. However, there may be other gates like this. I will try and fix them one-by-one.

s-jobra commented 5 months ago

Thank you very much!