Contents
What does a CX gate do?
It performs the NOT operation (equivalent to applying an X gate) on the second qubit only when the first qubit is |1⟩ and otherwise leaves it unchanged. In my mind I need 2 inputs for a CX gate A & B as ( q[0] and q[1] ) so that it can control B and NOT A, and also a third qubit as an output.
How does CNOT gate work?
Operation. , the TARGET output of the CNOT gate yields the result of a classical NOT gate. This gate flips the last qubit of the register if and only if a built-in function, with the first n qubits as input, returns a 1. The function-controlled NOT gate is an essential element of the Deutsch–Jozsa algorithm.
How are matrix representations of quantum logic gates used?
Using this matrix we can use matrix multiplication to see how the Pauli-X gate operates on an input state. For example if our input state is |1〉: We then multiply the column vector corresponding to |1〉by the Pauli-X matrix: Which = |0〉which is correct as the X gate flips |1〉to |0〉and vice versa. Likewise if our input state is |0〉:
What is the matrix of the Hadamard gate?
The Hadamard gate (H-gate) is a fundamental quantum gate. It allows us to move away from the poles of the Bloch sphere and create a superposition of | 0⟩|0⟩ and | 1⟩|1⟩. It has the matrix: H = 1 √2[1 1 1 − 1]
Which is the computational basis of the X gate?
In fact, the computational basis (the basis formed by the states | 0⟩ |0⟩ and | 1⟩|1⟩) is often called the Z-basis. This is not the only basis we can use, a popular basis is the X-basis, formed by the eigenstates of the X-gate. We call these two vectors | + ⟩|+⟩ and | − ⟩|−⟩:
When to use the identity matrix in quantum logic?
The identity gate is the identity matrix, usually written as I, and is defined for a single qubit as where I is basis independent and does not modify the quantum state. The identity gate is most useful when describing mathematically the result of various gate operations or when discussing multi-qubit circuits. and act on a single qubit.