Closed Observeur closed 3 years ago
Hello Observeur,
You need to first define a function for a multiple-controlled gate, which is as follows,
def MCT(nb_control): return CNOT.ctrl(nb_control-1) prog=Program() qbits=prog.qalloc(4) \\as you need a CCCNOT, you can generalize it as per your requirement N=3 \\ I have taken 3 as you need 3-controlled Toffoli, it can be generalized further prog.apply(MCT(N), qbits[0] , qbits[1], qbits[2], qbits[3])
Hope this will help you.
Best regards, Amit.
Thank you !! it works !
Hello,
I search the command for apply multiple control on a gate :
exemple for CNOT, we have the tofoly for CCNOT, but how make a CCCNOT ?
I have try to use "prog.cc_apply(cbits[0], CCNOT, qbits[0], qbits[1], qbits[2])" but that seems to not working ...
Idealy, i would like to define a group of Qbits for control ...
Is there already a command for doing that ? (don't have find in the tutorial ... )
Thank you !