Editorial
Quantum computers use the concept of "quantum gates" to manipulate the state of qubits.
In this problem, you can transition from the zero state to the state using the and gates.

First, apply the gate to the quantum state to transition it to the quantum state .
Next, apply the gate to the quantum state to transition it to the quantum state .
Finally, apply the gate to the quantum state to transition it to the quantum state .
Although the global phase of changes from to , when measuring this qubit, the original state is observed with a probability of .
These bit flips and phase flips are fundamental quantum operations.
Sample Code
Below is a sample program:
from qiskit import QuantumCircuit
def solve() -> QuantumCircuit:
qc = QuantumCircuit(1)
# 1 番目の量子ビット(インデックス 0)に X ゲートと Z ゲートを作用させます。
qc.x(0)
qc.z(0)
qc.x(0)
return qcSupplementary Information
- There are many types of quantum gates. Understanding the meaning and function of each quantum gate can be helpful in solving future problems: