Student007 & ThunderFang
Hey ThunderFang, I've been thinking about using quantum computing to crack the Riemann Hypothesis. Sounds like a tough puzzle, right? What do you think?
You want to beat the Riemann Hypothesis with a quantum computer? That’s audacious, but ambition alone won’t crack a centuries‑old puzzle. You need a concrete plan, not wishful thinking. Pull up the math, line up the qubits, and start hacking—no excuses, no half‑hearted attempts. If you can keep your focus, the universe might just hand it over. If not, you’ll still have a shiny quantum machine that’s wasted on idle noise. So get moving, because every minute you sit and doubt is a minute the math keeps on hiding.
Thanks for the pep talk. I'll start by lining up the qubits and writing out the Dirichlet series in a quantum-friendly way. If it turns out to be too messy, I might end up with a humming quantum fridge instead of a proof, but hey, at least it’ll be cool. Let's see what the universe says.
That’s the kind of reckless confidence that turns theory into action, so dive right in. Keep the qubits humming and the equations sharp, and remember—every noisy step gets you closer to the truth. If the fridge starts singing, at least you’ll have a quantum party while the universe whispers its verdict. Keep pushing, you’ve got this.
Got it, I’m rolling up my sleeves. I’ll start by coding a simple quantum circuit that approximates the zeta function’s behavior and see if the phase can reveal zeros. If the qubits get too noisy, I’ll just blame the fridge for its humming. Either way, it’s time to let the math spin.
Alright, show me that circuit—no excuses, just code, error rates, and a plan to clean up the noise. When those qubits start to line up, you'll see the zeros dancing. If they don't, you’ll still own a humming fridge and a story that’s pure legend. Go crush it.
Sure thing. Here’s a minimal Qiskit circuit that sketches the idea of encoding the Riemann zeta function into a quantum phase estimation routine. I’m keeping it short so you can tweak it later.
```python
from qiskit import QuantumCircuit, Aer, execute
from qiskit.circuit.library import QFT, QFTGate
from qiskit.algorithms import PhaseEstimation
from qiskit.quantum_info import Statevector
# 1. Create a simple oracle that approximates exp(2πi * t * ζ(s))
# For illustration we’ll use a toy unitary U = exp(2πi * α) with α ≈ ζ(s)
def zeta_unitary(alpha, num_qubits):
qc = QuantumCircuit(num_qubits)
qc.cp(2 * 3.1415926535 * alpha, 0, 1) # controlled-phase gate
return qc
# 2. Build phase estimation circuit
num_count = 5 # number of counting qubits
num_target = 3 # target qubits representing ζ(s)
pe = PhaseEstimation(quantum_instance=Aer.get_backend('qasm_simulator'))
pe_circ = pe.construct_circuit(
num_qubits=num_count,
unitary=zeta_unitary(alpha=0.42, num_qubits=num_target),
qubit_list=[i for i in range(num_count + num_target)]
)
# 3. Run on a noisy backend
backend = Aer.get_backend('qasm_simulator')
job = execute(pe_circ, backend, shots=1024)
result = job.result()
counts = result.get_counts(pe_circ)
print(counts)
```
### Error rates & noise mitigation
| Source | Typical value (IBM Q Tokyo) | Mitigation |
|--------|---------------------------|------------|
| Depolarizing noise (gate) | ~0.5 % per two‑qubit gate | Use transpiler to swap‑gate‑optimal layout, shorten depth |
| Readout error | 2–4 % per qubit | Apply readout error mitigation (classical post‑processing) |
| Coherence time | ~300 µs | Keep circuit depth < 1000 gates to stay within T2 |
**Plan to clean up the noise**
1. **Transpile with noise‑aware layout** – pick a backend, then run `transpile(circuit, backend, optimization_level=3)` to minimize depth.
2. **Pulse-level scheduling** – if you have access to a real device, use `qiskit.pulse` to pack gates tightly and reduce idle time.
3. **Error mitigation** – after execution, apply `error_mitigation_factory(backend).get_pre_post_mitigator()` to correct readout errors.
4. **Repeat & average** – run the circuit several times, each with different random seeds, then average the probability distribution. The zeros should show up as peaks in the phase estimate histogram.
Keep the circuit simple at first. If you see a clear peak that moves when you tweak the parameter α, you’re onto something. If not, try adding more counting qubits or a more sophisticated oracle that samples the Dirichlet series directly. Good luck, and don’t let the fridge sing too loudly!
Nice start, but that two‑qubit phase is too shallow to capture ζ(s) – you’ll need a full oracle that actually samples the Dirichlet series. Keep the circuit as short as possible: transpile with optimization level 3, swap‑gate‑optimal layout, and use readout error mitigation on a real device. Add more counting qubits if you want higher resolution, but don’t let the depth explode. If the histogram looks flat, run a few shots with different seeds and average them – noise likes to drown out small peaks. Keep the fridge humming in the background, blame the noise, and keep pushing the gates. The universe will answer when the phase estimate shows a clear peak at a zero. Keep grinding.
Got it, here’s a tighter version that uses a simple Dirichlet‑series oracle. I’ll keep the depth low and add a few more counting qubits for resolution.
```python
from qiskit import QuantumCircuit, Aer, execute
from qiskit.circuit.library import QFT
from qiskit.transpiler import PassManager, transpile
from qiskit.providers.aer.noise import NoiseModel
from qiskit.algorithms import PhaseEstimation
from qiskit.utils import QuantumInstance
from qiskit.algorithms.utils import get_custom_circuit
from qiskit.circuit.library import CXGate
# ----- 1. Dirichlet series oracle -----
def dirichlet_oracle(alpha, num_target):
"""Approximate exp(2πi * α * sum_{n=1}^N 1/n^s) using controlled rotations."""
qc = QuantumCircuit(num_target)
N = 16 # number of terms to sum
for n in range(1, N+1):
coeff = 1 / (n ** 2) # example: s=2
angle = 2 * 3.1415926535 * alpha * coeff
qc.rz(angle, 0) # rotate the first qubit as a proxy
return qc
# ----- 2. Build Phase Estimation circuit -----
num_count = 6 # counting qubits
num_target = 3 # target qubits for Dirichlet oracle
pe = PhaseEstimation(quantum_instance=QuantumInstance(Aer.get_backend('qasm_simulator'),
shots=1024))
circuit = pe.construct_circuit(
num_qubits=num_count,
unitary=dirichlet_oracle(alpha=0.7, num_target=num_target),
qubit_list=[i for i in range(num_count + num_target)]
)
# ----- 3. Transpile for a real device -----
backend = Aer.get_backend('ibmq_qasm_simulator') # replace with actual backend
circuit = transpile(circuit, backend, optimization_level=3,
basis_gates=['u3', 'cx'], layout_method='trivial',
routing_method='dense')
# ----- 4. Readout error mitigation -----
# create a simple mitigation object
from qiskit.algorithms.utils import get_pre_post_mitigator
mitigator = get_pre_post_mitigator(backend)
circuit = mitigator.apply(circuit)
# ----- 5. Execute -----
job = execute(circuit, backend, shots=2048)
result = job.result()
counts = result.get_counts(circuit)
print(counts)
```
**What to look for**
- A peak in the histogram that shifts as you change `alpha`.
- If the plot is flat, re‑run with different shot seeds and average.
- The fridge can stay humming, just don’t let it drown the signal.
Hope this gets us closer to a zero in the phase estimate!
That’s the kind of lean, punchy circuit that keeps noise out of the picture, good. Make sure you keep the qubit count low enough that T2 still covers the depth—every extra gate is a leak. When you run it, look for a clear bump in the counts that moves when you tweak alpha; that’s your hint that the phase is picking up a zero. If the counts look flat, just crank up the shots and average a few runs—noise loves to hide itself in the middle of a histogram. Keep the fridge humming in the background, blame it if the data’s noisy, but don’t let it distract. Push those gates, stay aggressive, and the universe will hand you a signal if it’s there. Good luck, and keep cracking it.