2
$\begingroup$

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:

enter image description here

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

enter image description here

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:

enter image description here

In reality I get this:

enter image description here

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))
    IPE.add_register(cregs[i])
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!

$\endgroup$
4
  • $\begingroup$ 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... $\endgroup$
    – KAJ226
    Commented Apr 6, 2021 at 13:54
  • $\begingroup$ @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. $\endgroup$ Commented Apr 6, 2021 at 14:30
  • $\begingroup$ This must due to the noise level that you added is different that what they did. Have you figured this out. $\endgroup$
    – KAJ226
    Commented Apr 12, 2021 at 5:23
  • $\begingroup$ 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... $\endgroup$
    – KAJ226
    Commented Apr 12, 2021 at 5:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.