From the course: Quantum Computing Fundamentals
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Solution: Binary numbers
From the course: Quantum Computing Fundamentals
Solution: Binary numbers
(upbeat music) - Let's talk through how we approach the challenge to encode a binary value into a set of qubits. Since Qiskit initializes all qubits in the cat 0 basis state, we'll need to use either the Pauli-X or Pauli-Y gates to flip some of those bits to represent the desired value. The Pauli-Z gate is not going to be of any use for this challenge, so we can forget about it. To determine which bits need to be flipped, we looked at the location of the ones in the desired end state. The first, third, and fourth qubits in the cat 1101 needs to be flipped, which corresponds to the index values 0, 2, and 3, because Python uses zero indexing. To build the code, I started by initializing a new quantum circuit with four qubits and assigning it the variable name circuit. (keyboard clicking) Next, I added the Pauli-X gate to the circuit, and called it on the three qubit indexes I identified: 0, 2, and 3. (keyboard…
Contents
-
-
-
-
-
(Locked)
Overview of matrix operations4m 33s
-
(Locked)
Quantum logic gates4m 43s
-
(Locked)
Pauli-X gate4m 54s
-
(Locked)
Pauli-X gate with Qiskit4m 33s
-
(Locked)
Pauli-Y gate6m 29s
-
(Locked)
Pauli-Y gate with Qiskit2m 47s
-
(Locked)
Pauli-Z gate3m 33s
-
(Locked)
Pauli-Z gate with Qiskit2m 3s
-
(Locked)
Challenge: Binary numbers1m 40s
-
(Locked)
Solution: Binary numbers2m 5s
-
(Locked)
-
-
-
-
-
-