# Explanation of the function of the circuit

I once experimented with the tool "quirk" and came to a gate, whose function I can not properly tap into. I'm working in the circuit with 4 bits, the last bit is negated, so from 0 to 1. On all 4 bits then I apply a Hadamard transformation. Then this special gate is used, whose function I can not explain.

Hence my question. Can someone explain what makes the gate? How does this work? I know so far the CNOT gate and the Toffoli gate, but this one seems to be something else?

I hope the question is understandable.

## 1 Answer

This gate is closely related to the CNOT gate that you've already learnt about. Where the CNOT gate says "apply NOT to the target if the control is in the state $$|1\rangle$$", this gate says "apply NOT to the target if all 3 control qubits are in the state $$|1\rangle$$". The three control qubits are the closed black circles, and the target qubit is the other one.

If you want to know more about this gate, it's probably worth starting with the "Toffoli gate", which is the same but with two control qubits.

• Thank you for your answer. Can you maybe do that a little further? So at the CNOT I noticed: the second bit is negated if the first bit is a one. Are there any sources that convert this gate into a Toffoli gate? So what interests me, how do you know that the gate works that way? Where can I read about it?
– user4961
Mar 25 '19 at 13:47
• @QuantaMag This is just standard notation. I know it because I've working in the field for a long time. As for where you can read more, the text book by Nielsen & Chuang is the standard starting point. In my version, you'd be interested in Figures 4.7 and 4.9. Mar 25 '19 at 14:12
• thanks for your help, I have found the appropriate text, which is helpful.
– user4961
Mar 26 '19 at 7:54