You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where \(\alpha\) and \(\beta\) are complex numbers representing the probability amplitudes of the qubit being in the \(|0\rangle\) and \(|1\rangle\) states, respectively. The probabilities of measuring the qubit in either state are given by \(|\alpha|^2\) and \(|\beta|^2\), and they must satisfy the normalization condition:
14
+
{% raw %}
15
+
where $\alpha$ and $\beta$ are complex numbers representing the probability
16
+
amplitudes of the qubit being in the $|0\rangle$ and $|1\rangle$ states,
17
+
respectively. The probabilities of measuring the qubit in either state are given
18
+
by $|\alpha|^2$ and $|\beta|^2$, and they must satisfy the normalization condition:
19
+
{% endraw %}
15
20
16
21
$$|\alpha|^2 + |\beta|^2 = 1$$
17
22
18
23
## 3.2 Representing Qubits
19
24
20
-
Qubits can be visualized using the **Bloch sphere**, a geometric representation of the quantum state of a single qubit. The Bloch sphere is a unit sphere where the north and south poles represent the \(|0\rangle\) and \(|1\rangle\) states, respectively. Any point on the surface of the sphere represents a valid quantum state of the qubit.
25
+
Qubits can be visualized using the **Bloch sphere**, a geometric representation
26
+
of the quantum state of a single qubit. The Bloch sphere is a unit sphere where
27
+
the north and south poles represent the $|0\rangle$ and $|1\rangle$ states,
28
+
respectively. Any point on the surface of the sphere represents a valid quantum
29
+
state of the qubit.
21
30
22
-
The state of a qubit can also be described using a **state vector** in a two-dimensional complex vector space. For example, the state \(|0\rangle\) is represented as:
31
+
The state of a qubit can also be described using a **state vector** in a
32
+
two-dimensional complex vector space. For example, the state $|0\rangle$ is
@@ -51,7 +64,9 @@ In this example, we initialize a quantum circuit with one qubit using the qiskit
51
64
52
65
### Example: Applying a Hadamard Gate
53
66
54
-
The Hadamard gate ((H)) is a fundamental quantum gate that puts a qubit into a superposition state. Applying the Hadamard gate to a qubit initially in the (|0\rangle) state results in the state:
67
+
The Hadamard gate ((H)) is a fundamental quantum gate that puts a qubit into a
68
+
superposition state. Applying the Hadamard gate to a qubit initially in the
In this example, the Hadamard gate is applied to the qubit at index 0, and the circuit is executed to obtain the measurement results. The output will show the probabilities of measuring the qubit in the (|0\rangle) and (|1\rangle) states.
84
+
In this example, the Hadamard gate is applied to the qubit at index 0, and the
85
+
circuit is executed to obtain the measurement results. The output will show the
86
+
probabilities of measuring the qubit in the $|0\rangle$ and $|1\rangle$ states.
Copy file name to clipboardexpand all lines: website/quantum-computing-primer/04_quantum_gates/index.md
+6-3
Original file line number
Diff line number
Diff line change
@@ -36,10 +36,13 @@ print(result)
36
36
37
37
## 4.2 Multi-Qubit Gates
38
38
39
-
Multi-qubit gates operate on two or more qubits, enabling entanglement and more complex quantum operations. Some of the most common multi-qubit gates include:
39
+
Multi-qubit gates operate on two or more qubits, enabling entanglement and more
40
+
complex quantum operations. Some of the most common multi-qubit gates include:
40
41
41
-
-**CNOT Gate (Controlled-NOT)**: Flips the target qubit if the control qubit is in the state |1⟩.
42
-
-**Toffoli Gate (CCNOT)**: A controlled-controlled-NOT gate that flips the target qubit if both control qubits are in the state |1⟩.
42
+
-**CNOT Gate (Controlled-NOT)**: Flips the target qubit if the control qubit is
43
+
in the state $|1\rangle$.
44
+
-**Toffoli Gate (CCNOT)**: A controlled-controlled-NOT gate that flips the
45
+
target qubit if both control qubits are in the state $|1\rangle$.
43
46
-**SWAP Gate**: Exchanges the states of two qubits.
Copy file name to clipboardexpand all lines: website/quantum-computing-primer/07_quantum_algorithms/index.md
+15-6
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,20 @@ Quantum algorithms leverage the unique properties of quantum mechanics, such as
11
11
12
12
## 7.1 Deutsch-Jozsa Algorithm
13
13
14
-
The Deutsch-Jozsa algorithm is one of the earliest quantum algorithms that demonstrates the potential of quantum computing. It solves a specific problem exponentially faster than any classical algorithm.
14
+
The Deutsch-Jozsa algorithm is one of the earliest quantum algorithms that
15
+
demonstrates the potential of quantum computing. It solves a specific problem
16
+
exponentially faster than any classical algorithm.
15
17
16
18
### Problem Statement
17
-
Given a function \( f: \{0,1\}^n \rightarrow \{0,1\}\), determine whether the function is **constant** (returns the same value for all inputs) or **balanced** (returns 0 for half of the inputs and 1 for the other half).
19
+
Given a function $ f: \{0,1\}^n \rightarrow \{0,1\} $, determine whether the
20
+
function is **constant** (returns the same value for all inputs) or **balanced**
21
+
(returns 0 for half of the inputs and 1 for the other half).
18
22
19
23
### Quantum Solution
20
-
The Deutsch-Jozsa algorithm uses quantum parallelism to evaluate the function over all possible inputs simultaneously. It requires only **one query** to the function, whereas a classical algorithm would need \( 2^{n-1} + 1 \) queries in the worst case.
24
+
The Deutsch-Jozsa algorithm uses quantum parallelism to evaluate the function
25
+
over all possible inputs simultaneously. It requires only **one query** to the
26
+
function, whereas a classical algorithm would need $ 2^{n-1} + 1 $ queries in
27
+
the worst case.
21
28
22
29
### Implementation with `qumat`
23
30
Here’s how you can implement the Deutsch-Jozsa algorithm using `qumat`:
@@ -55,10 +62,12 @@ print(result)
55
62
56
63
## 7.2 Grover's Algorithm
57
64
58
-
Grover's algorithm is a quantum search algorithm that can search an unsorted database of \( N \) items in \( O(\sqrt{N}) \) time, compared to \( O(N) \) for classical algorithms.
65
+
Grover's algorithm is a quantum search algorithm that can search an unsorted
66
+
database of $ N $ items in $ O(\sqrt{N}) $ time, compared to $ O(N) $ for
67
+
classical algorithms.
59
68
60
69
### Problem Statement
61
-
Given an unsorted database of \( N \) items, find a specific item (marked by an oracle) with as few queries as possible.
70
+
Given an unsorted database of $ N $ items, find a specific item (marked by an oracle) with as few queries as possible.
62
71
63
72
### Quantum Solution
64
73
Grover's algorithm uses amplitude amplification to increase the probability of measuring the marked item. It consists of two main steps:
@@ -109,7 +118,7 @@ print(result)
109
118
```
110
119
111
120
### Explanation
112
-
- The oracle marks the desired state (e.g., `|110>`).
121
+
- The oracle marks the desired state (e.g., $|110\rangle$).
113
122
- The diffusion operator amplifies the probability of measuring the marked state.
114
123
- After running the algorithm, the marked state will have a higher probability of being measured.
0 commit comments