control for some operation. For example, the controlled NOT gate (or CNOT or CX) acts on 2 qubits, and performs the NOT operation on the second qubit only when the first qubit is and otherwise leaves it unchanged. With respect to the basis it is represented by the Hermitian unitary matrix: The CNOT (or controlled Pauli-X) gate can be described as the gate that maps the basis states , where is XOR. The CNOT can be expressed in the Pauli basis as: Being a Hermitian unitary operator, CNOT has the property and , and is involutory. More generally if U is a gate that operates on a single qubit with matrix representation then the controlled-U gate is a gate that operates on two qubits in such a way that the first qubit serves as a control. It maps the basis states as follows. The matrix representing the controlled U is When U is one of the Pauli operators, X,Y, Z, the respective terms "controlled-X", "controlled-Y", or "controlled-Z" are sometimes used. Sometimes this is shortened to just CX, CY and CZ. In general, any single qubit unitary gate can be expressed as , where H is a Hermitian matrix, and then the controlled U is Control can be extended to gates with arbitrary number of qubits and functions in programming languages. Functions can be conditioned on superposition states. Classical control Gates can also be controlled by classical logic. A quantum computer is controlled by a classical computer, and behave like a coprocessor that receives instructions from the classical computer about what gates to execute on which qubits. Classical control is simply the inclusion, or omission, of gates in the instruction sequence for the quantum computer. Phase shift gates The phase shift is a family of single-qubit gates that map the basis states and . The probability of measuring a or is unchanged after applying this gate, however it modifies the phase of the quantum state. This is equivalent to tracing a horizontal circle (a line of latitude), or a rotation along the z-axis on the Bloch sphere by radians. The phase shift gate is represented by the matrix: where is the phase shift with the period . Some common examples are the T gate where (historically known as the gate), the phase gate (also known as the S gate, written as S, though S is sometimes used for SWAP gates) where