LegacYFTw/QuDiet

multi_controlled_toffoli is not working properly!

Closed this issue · 3 comments

Screenshot from 2024-01-20 22-05-36

When only one CONTROL is ON, the TARGET bit flips and also the multi_controlled_toffoli function is just a wrapper around the toffoli function.

Hi, thanks for using our software. I'm tagging @arnavdas88 to look into this if possible :)

@Biswayan375 , You can check the code now,

from qudiet.core.quantum_circuit import QuantumCircuit

N = 5
qc = QuantumCircuit(

    # Represents the dimension of each quantum register
    qregs=[4 for _ in range(N)] + [2],

    # Represents the initial states
    init_states=[0 for _ in range(N+1)],
)

qc.h(5)
qc.toffoli(([1, 2, 3, 5], 4), 1)

qc.measure_all()

print(qc.run())

This works properly!! The MCT have been merged with toffoli implementation for now! Commit: e321713