# Iterative Phase Estimation with noise vs standard Quantum Phase Estimation with noise

I am doing Qiskit Lab 4 about Iterative Phase Estimation. I created a circuit implementing IPE for theta = 1/3 (phase of 2pi/3). Here's the circuit:

It seems to do okay if I run it without noise in a QASM sim:

Then the lab compares how IPE performs compared to QPE when you add noise - in this lab they use NoiseModel.from_backend() from the Athens IBM computer to simulate the noise.

The lab guide says I'm supposed to get something like this:

In reality I get this:

I have zero idea how to approach this problem because I tried inputing several values of theta to simulate in QASM without noise and everything seems to be fine there. Any ideas?

For reference, the code implementing IPE is below:

import math
theta = 2/3*math.pi
IPE = QuantumCircuit(2)
cregs = []
IPE.x(1)
for i in range(n):
cregs.append(ClassicalRegister(1))
for i in range(n):
IPE.reset(0)
IPE.h(0)
IPE.crz(theta*(2**(n-i)),0,1)
if i > 0:
for j in range(i):
IPE.rz(-math.pi*2**(j-i),0).c_if(cregs[j],1)
IPE.h(0)
IPE.measure(0,cregs[i])


UPDATE: Apparently specifying the initial_layout during transpiling is crucial as it seems to have worked!

• Did you implement error mitigation? (maybe the their results have error mitigation) And how many shots did you use? Also you shouldn't expect an identical graph... – KAJ226 Apr 6 at 13:54
• @KAJ226 I did 20,000 shots, which should be enough to get a representative distribution... I am fairly sure they didn't do error mitigation, they would've written something in the notebook otherwise... The whole point of the exercise is to show IPE is more robust against noise, if I understand correctly. – Mykolas Sveistrys Apr 6 at 14:30
• This must due to the noise level that you added is different that what they did. Have you figured this out. – KAJ226 Apr 12 at 5:23
• ahh just saw your update. Yes, this is because different qubits have different error/noise... so you want to make sure you are consistent with the qubits you use... – KAJ226 Apr 12 at 5:26