BQSKit / bqskit

Berkeley Quantum Synthesis Toolkit
Other
108 stars 31 forks source link

Reproduce the problem: Frontier emptied. Returning best known circuit with 0 layers and cost: 2.500003e-01. #204

Closed jinleic closed 7 months ago

jinleic commented 8 months ago

This file can reproduce the error.

knn_n41_compiled.txt

It is a short circuit with many ccx gates, which might make it hard to partition.

edyounis commented 7 months ago

Can you check if the 1.1.1 branch fixes this?

jinleic commented 7 months ago

Yes, it fixes the problem with compiled knn_n41_compiled.txt where the gate set is {cx,sx,x,rz}

However, if a raw knn_n41.qasm is used as input, it still pops the frontier bug. knn_n41.txt

This raw knn_n41.qasm contains CSWAP gates. I noticed that the line to fix the problem is

            if circuit.num_qudits != 2:
                # Guard on >2 qubit to prevent high-error glitches
                continue

Maybe a three-qubit gate could not be handled by this line.

edyounis commented 7 months ago

As discussed, this has been fixed with the recent 1.1.1 branch. Thanks for the bug report