Grover's Search Algorithm for |11⟩ state

68b7e756-edb3-4775-a954-aa84472f92f9
4.0
Description

This circuit implements Grover's algorithm to find the |11⟩ state in a 2-qubit system.

Qiskit Circuit Code
Python
```python
from qiskit import QuantumCircuit

# Create a quantum circuit with 2 qubits and 2 classical bits
qc = QuantumCircuit(2, 2)

# Apply Hadamard gates to both qubits to create superposition
qc.h(0)
qc.h(1)

# Oracle: Flip the sign of the |11⟩ state
qc.cz(0, 1)

# Apply Hadamard gates again
qc.h(0)
qc.h(1)

# Apply X gates to both qubits
qc.x(0)
qc.x(1)

# Apply Hadamard, CNOT, and Hadamard gates for the Grover diffuser
qc.h(1)
qc.cx(0, 1)
qc.h(1)

# Apply X gates again
qc.x(0)
qc.x(1)

# Apply Hadamard gates to complete the diffusion operator
qc.h(0)
qc.h(1)

# Measure the qubits
qc.measure([0, 1], [0, 1])
```
Quantum Execution Results
ibm_kyiv
unknown
1024 shots
Measurement Counts
{
  "00": 1,
  "01": 9,
  "10": 14,
  "11": 1000
}
Raw Result Data
Download Results
Back to Home