Simon's Algorithm with Secret String '11'

0f42788c-c5f6-45ae-ae17-82d5d318a3e7
4.0
Description

This circuit implements Simon's Algorithm for a secret string '11', identifying that two inputs produce the same output if they are bit-wise XOR is '11'.

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

# Simon's Algorithm Implementation with 4 qubits and 2 classical bits
qc = QuantumCircuit(4, 2)

# Apply Hadamard gates to the first two qubits (input register)
qc.h([0, 1])

# Oracle for the secret string s = '11'
# Implementing f(x) = f(y) iff x ⊕ y = s
qc.barrier()

# Apply CNOT gates representing the oracle function
qc.cx(0, 2)
qc.cx(1, 2)
qc.cx(0, 3)
qc.cx(1, 3)

qc.barrier()

# Apply Hadamard gates to the first two qubits again
qc.h([0, 1])

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