Part II: Introducing quantum logic gates
Preface
Quantum Logic Gates and Computational Foundations
Role of Quantum Logic Gates
Quantum logic gates manipulate quantum information (qubit states), analogous to classical gates (AND, OR, NOT) in conventional computing.
They serve as the fundamental building blocks of quantum computation and enable tasks like quantum teleportation.
Quantum vs. Classical Gates
-
Similarity: Some quantum gates are inspired by classical logic gates.
-
Key Differences:
Quantum gates exploit superposition and entanglement to process information non-classically.
These "seemingly minor" differences enable exponential computational advantages (e.g., Shor’s algorithm, Grover’s search).
Key Insight
The unique capabilities of quantum gates underpin quantum computing’s potential to surpass classical limits.
While learning gates is foundational yet demanding, it unlocks insights into revolutionary applications like cryptography-breaking and large-scale optimization.
The quantum NOT gate
It has the same function like classical gate such as:
when does it apply to a general superposition state which is \(\alpha\vert 0\rangle+\beta\vert1\rangle\)
it acts linearly on the quantum state
so:
The notation X is served as the quantum NOT gate
Quantum Circuit Representation.
In a quantum circuit we depict an X gate as follows:

The line from left to right is what’s called a quantum wire.
the left is the input,the right is the output,so we get something like:

Matrix Representation
in the matrix representation,\(\alpha\vert0\rangle+\beta\vert1\rangle\) can be considered as the vector\(\begin{bmatrix}\alpha \\ \beta\end{bmatrix}\).
Therefore:
In fact, all quantum gates can be thought of as matrices
Function
the X gate is a mathematical function,taking the input states to output states.
As mentioned earlier,the function is the matrix,exhibiting the linear properties
Quantum wires: why the simplest quantum circuit is often also the hardest to implement
It's a single quantum wire:

This circuit is just a single qubit being preserved in time
as we discussed before,the left is input,the right is the output.

if the qubit go through the wire,nothing will change
Mathematically, this circuit is trivial. But physically it's far from trivial. ln many physical systems, the quantum wire is actually one of the hardest quantum computations to implement!
(Reason:quantum states are Often incredibly fragile.)
The tension
-
Contradiction Between Quantum Wires and Quantum Gates
The Neutrino Case Study:
\(\\\)
Advantage: Neutrinos barely interact with other matter, enabling long-term stable storage of quantum states (e.g., passing undisturbed through a lead block).
\(\\\)
Disadvantage: Weak interactions make it impossible to manipulate their quantum states, thus hindering quantum gate implementation.-
Universal Conflict:
Quantum Storage Requirement: Qubits require weak environmental coupling to minimize decoherence (maintaining stability).
Quantum Gate Requirement: Quantum operations demand strong controllable coupling for precise state manipulation.
-
Core Conflict:
Systems acting as "perfect quantum wires" (weak coupling) struggle to support quantum gate construction (requiring strong coupling), and vice versa.
\(\\\)
-
-
Quantum Computer Design Strategies
Dynamic Coupling Design:
\(\\\)
Systems are designed to default to weak coupling (protecting quantum states) but trigger strong coupling on demand (executing gate operations).
\(\\\)
Implementation Methods: Examples include external controls like lasers or microwave pulses to temporarily enhance inter-qubit interactions.
A multi-gate quantum circuit
simple example:

It's no pressure to know that there is no difference between the input and the output.
so:

From the matrix perspective
XX is the multi-gate quantum circuit
therefore:
The Hadamard gate
It clearly involves quantum effects
here's what is does for the quantum basis states:
It also contains the linear property
for the general states:
Like X gate,the circuit representation of H:

the matrix of H:
so if H act on the \(\vert 1 \rangle\):
if H act on the \(\vert 0 \rangle\),you can write down by yourself
What makes the Hadamard gate interesting as a quantum gate? What can we use it to do?
What the Hadamard and similar gates do is expand the range of operations that it’s possible for a computer to perform. That expansion makes it possible for the computer to take shortcuts, as the computer “moves” in a way that’s not possible in a conventional classical computer. And, we hope, that may enable us to solve some computational problems faster.
Practice
let's analyze a simple circuit:

If we approach this from the matrix perspective,the HH will be:
therefore,the input and the out put is the same

if we use the definition to calculate it,the thing will be trouble but the outcome is also the same
Exercise

Key Analysis
J
- Non-Unitary Matrix:
Quantum gates must be unitary matrices \(U†U=I\) to ensure probability conservation. Verifying the unitarity of
J:
proving that \(J\) is not unitary
- Information Loss:
Applying
J to the input state \(\frac{\vert 0 \rangle-\vert 1 \rangle}{\sqrt{2}}\) results in the zero vector, implying complete loss of quantum information, which violates the reversibility requirement of quantum gates.
HX

it's about the order of the matrix muliplication
Measuring a qubit
for a quantum state \(\alpha \vert 0 \rangle + \beta \vert 1 \rangle\),there is no way to figure out \(\alpha\) and \(\beta\) if they start out unknown.
To put the state a slightly different way, the quantum state of any system – whether it be a qubit or a some other system – is not directly observable.
what can we figure out from the quantum state?
measurement in the computational basis
is the way we typically extract information from our quantum computers
Suppose a qubit is in the state
\(α∣0⟩+β∣1⟩\)When you measure this qubit in the computational basis it gives you a classical bit of information: it gives you the outcome 0 with probability
\(∣α∣^2\), and the outcome 1 with probability \(∣β∣^2\)
if it exists the physical system,after the measurement interaction for the qubit,for instance,we may get the outcome 0-which we can use to do other things and to control other preocesses
(A fundamental fact about this measurement process is that it disturbs the state of the quantum system)
A key point to note is that after the measurement, no matter what the outcome,
α and β are gone. No matter whether the posterior state is ∣0⟩ or ∣1⟩, there is no trace of α or β. And so you can’t get any more information about them. In that sense, α and β are a kind of hidden information – the measurement doesn’t tell you what they were.
It's useful to have a way of denoting measurements in the quantum circuit model.

The m is a classical bit denoting the measurement result – either
0 or 1 – and we use the double wire to indicate the classical bit m going off and being used to do something else.
General single-qubit gates
In particular,a general single-qubit gate can be represented as a $2 \times 2 $ unitary matrix,U.
The unitary matrix U has to satisfy $$U^{\dagger} U=I$$
among it,\(U^{\dagger}\) is called the complex
transpose of \(U\):
for example:
(Note that the † is also sometimes called the dagger operation, or Hermitian conjugation, or just the conjugation operation. We’ll use all three terms on occasion.
Exercise
Can you find an example of a 2×2 matrix that is unitary, and is not I, X, or H?
The Wolfgang Pauli introduced two matrices
,Y and Z, which are also useful quantum gates
it takes \(\vert 0 \rangle\) to \(i\vert 1 \rangle\) and \(\vert 1 \rangle\) to \(-i\vert 0 \rangle\)
it leaves \(\vert 0 \rangle\) unchanged,and takes \(\vert 1 \rangle\) to \(-\vert 1 \rangle\)
Rotation matrix:
It’s just the ordinary rotation of the 2-dimensional plane by an angle θ
What does it mean for a matrix to be unitary?
It turns out that unitary matrices preserve the length of their inputs
in other words,if we take any vector\(\vert \psi \rangle\) and compute the length \(||U\vert \psi \rangle||\) it's always equal to the length \(||\vert \psi \rangle ||\) of the original vector
In a sense, the unitary matrices are a complex generalization of real rotations and reflections.
Prove: \(||U\vert \psi \rangle||=||\vert \psi \rangle ||\)
From the normalization perspective,both of them are equal to 1
First,compute \(||U\vert \psi \rangle||\)
but computing \(||U\vert \psi \rangle||^2\) is easier.
Expanding \((U\psi)_j\):
so:
(attention:the \(U_{jl}\) is a element ,not a matrix)
apply the unitarity of U:
then
\( \delta_{kl} = \begin{cases} 1 & k = l \\ 0 & k\neq l \end{cases} \)
final:
That completes the proof that unitary matrices are length-preserving.
Theorem:Let M be a matrix.Then \(||M\vert \psi \rangle||=||\vert \psi \rangle ||\) for all vectors \(\vert \psi \rangle\) if and only if M is unitary.
this tells us why quantum gates must be unitary
Why are unitaries the only matrices which preserve length?
suppose we have a vector \(\vert \psi \rangle\):
then in quantum mechanics:
it’s often called the Dirac bra-ket notation, or sometimes just the Dirac notation.
then the smart one have found that:
the we can express the length in another way with the DIirac notation:
We expand it into the matrix:
an other useful identity is that if M is a matrix and \(\vert \psi \rangle\) is ket, then:
Proof:
The way to prove the identity is to apply the definitions.
We're going to look at the \(j\)th component of the left - hand side,\((M|\psi\rangle)_j^{\dagger}\), and we’ll show it’s equal to the \(j\)th component of the right - hand side.
By definition, the \(j\)th row component \((M|\psi\rangle)_j^{\dagger}\) is equal to the complex conjugate of the \(j\)th column component of \(M|\psi\rangle\), \((M|\psi\rangle)_j^{*}\).
That column component is \(\sum_{k}M_{jk}^{*}\psi_{k}^{*}\). We can move the \(\psi\) terms to the left, and swap the indices on the \(M\) term to convert the \(*\) to a dagger, giving \(\sum_{k}\psi_{k}^{*}M_{kj}^{\dagger}\).
That’s just the \(j\)th component of the row vector \(\langle\psi|M^{\dagger}\), as we set out to show.
unit vector
\(\vert e_j \rangle\),means the vector with a 1 in the \(j\)th component,and 0s everywhere else,for a qubit:
From the elementary linear algebra,if M is a matrix,then \(M\vert e_k \rangle\) is just the \(k\)th column of M
- \(\langle e_j\vert M \vert e_k \rangle\) is the \(jk\)th entry of M
proof:
$\langle e_j\vert M $is just the \(j\)th row of M
then $\langle e_j\vert M \vert e_k \rangle $is just the \(k\)th column of the \(j\)th row of M
Proof:
we assume M is length_preserving,
first,to understand the diagonal elements
because of the length-preserving
\(||M\vert e_j \rangle||^2=||\vert e_j \rangle||^2=1\)
moreover:
have a look at th off-diagonal elements
\((M^{\dagger}M)_{jk},j \neq k\)
to relate \((M^{\dagger}M)_{jk}\) to the length of some vector \(M\vert \psi \rangle\),we can consider \(\vert \psi \rangle\) as \(\vert e_j \rangle +\vert e_k \rangle\),since that involves both the \(j\)th and \(k\)th directions
because we only though j,k directions,which is belongs to [1,n],n is the maximum number of directions
From the length_preserving property we have:
we also have :
then we get:
if we used \(\vert \psi \rangle=\vert e_j \rangle + i\vert e_k \rangle\)
through the computation:
up to now,we have the two equation:
so:
Conclusion:
The controlled-NOT gate
To compute,we can't only use one single qubits to interact with one another.
So we find the quantum gates which involve two qubits——controlled-NOT(or CNOT) gate:

- The wire with the small, filled dot on it (the top wire, in this example) is called the control qubit
- The wire with the larger,unfilled circle on it is called the target qubit
In a two-bit system,we have four computational basis states,corresponding to the four possible states:\(\vert 00 \rangle,\vert 01 \rangle,\vert 10 \rangle,\vert 11 \rangle\)
And we can also have superposition of them:
\(\alpha \vert 00 \rangle+\beta\vert 01 \rangle +\gamma \vert 10 \rangle+\delta \vert 11 \rangle\)
Similar to the single-qubit,the probability amplitudes \(\alpha,\beta,\gamma,\delta\)are complex numbers,obeying the normalization condition
The controlled-NOT (CNOT) gate, a quantum analog of the classical controlled-NOT logic gate, performs conditional state inversion. Its operation is defined over computational basis states as:
where the first qubit acts as the control and the second as the target. The gate applies the Pauli-X operator to the target qubit iff the control qubit is in the
\(∣1⟩\) state, preserving quantum coherence through unitary implementation.
Summing up all four of the equations above in a single equation:
(x,y is 0 or 1)
property:
- act linearly
- unitary
- length-preserving
just as the before
Exercise
- how does it work on three qubits?

answer:
- if we apply a Hadmard gate to the first qubit on the CNOT gate,such as:

finally,the output is:
This output state is a highly non-classical state-it's actually a typo of state called an entangled state
More generally, if we have single-qubit states \(α∣0⟩+β∣1⟩\) and \(γ∣0⟩+δ∣1⟩\), then the combined state when the two qubits are put together is just:
- try to prove if we put ∣+−⟩ in CNOT gates, then ∣−−⟩ comes out

浙公网安备 33010602011771号