Giter VIP home page Giter VIP logo

Comments (29)

rraymondhp avatar rraymondhp commented on August 18, 2024 4

Hi,
Thank you for pointing this. I also got the same error when running the notebook. It is due to a bug in compiler that swap measurement to the middle of the computation but the devices do not support such operation yet. I confirmed that I can avoid the error by inserting barrier before measurement, like:

#put barrier before measurement
qc.barrier(qr)
# measure
for j in range(16):
    qc.measure(qr[j], cr[j])

# run and get results
results = qp.execute(["smiley_writer"], backend='ibmqx5', shots=1024, timeout=240)
stats = results.get_counts("smiley_writer")

I cannot run the real device now because it is under maintenance though.

from qiskit-tutorials.

indisoluble avatar indisoluble commented on August 18, 2024 1

Hi @rraymondhp, thanks a lot for your answer!!! Very helpful.

BTW, I just realised that this same problem was reported in IBM Q Experience Community too: Code not working on IBMQX5.

Thanks again for your help.

from qiskit-tutorials.

aaita92 avatar aaita92 commented on August 18, 2024 1

from qiskit-tutorials.

indisoluble avatar indisoluble commented on August 18, 2024

I found this other issue in qiskit-sdk-py that seems to be related: Unexpected result qasm simulator with coupling map (stable) #181

from qiskit-tutorials.

pherrman avatar pherrman commented on August 18, 2024

I get the same error

from qiskit-tutorials.

aaita92 avatar aaita92 commented on August 18, 2024

I get the same error

from qiskit-tutorials.

hotstaff avatar hotstaff commented on August 18, 2024

I get same error. Thank you @rraymondhp.

from qiskit-tutorials.

tanweer-ali avatar tanweer-ali commented on August 18, 2024

@rraymondhp I added the barrier statement just like you mentioned in the quantum-emoticon sample.

#put barrier before measurement
qc.barrier(qr)

for j in range(16):
    qc.measure(qr[j], cr[j])

results = qp.execute(["smiley_writer"], backend='ibmqx5', shots=1024)
stats = results.get_counts("smiley_writer")

It did run once without error.

But now i get the following error:

---------------------------------------------------------------------------
QISKitError                               Traceback (most recent call last)
<ipython-input-2-de74e9d080e0> in <module>()
     34 # run and get results
     35 results = qp.execute(["smiley_writer"], backend='ibmqx5', shots=1024)
---> 36 stats = results.get_counts("smiley_writer")

/ibmq/anaconda/lib/python3.6/site-packages/qiskit/_result.py in get_counts(self, name)
    231         """
    232         try:
--> 233             return self.get_data(name)['counts']
    234         except KeyError:
    235             raise QISKitError('No counts for circuit "{0}"'.format(name))

/ibmq/anaconda/lib/python3.6/site-packages/qiskit/_result.py in get_data(self, name)
    204                 raise exception
    205             else:
--> 206                 raise QISKitError(str(exception))
    207 
    208         try:

QISKitError: 'QISkit Time Out'

from qiskit-tutorials.

rraymondhp avatar rraymondhp commented on August 18, 2024

Hi,
It is likely because there are too many job queue for the ibmqx5. The last time I heard there were about 1000+ jobs waiting in line. Please wait and try to run your job again later.

I will try to see the workaround.

P.S. My colleagure run ibmqx5 just now and it completed just fine...

from qiskit-tutorials.

francabrera avatar francabrera commented on August 18, 2024

@rraymondhp the queues are fine right now, wouldn't it be because the time-out set is too short for the experiment?

from qiskit-tutorials.

rraymondhp avatar rraymondhp commented on August 18, 2024

Yes, it is because of the timeout=60 in the default notebook. I have just confirmed that by having the timeout=300 or larger, I could run in just fine. @tanweer-ali
Thanks @francabrera !

from qiskit-tutorials.

tanweer-ali avatar tanweer-ali commented on August 18, 2024

@rraymondhp Thankyou for the timeout tip.
That worked!

Now the next section of the code which is supposed to draw the plots
i get the following output:

0.2109375	S
0.1796875	SÊ
<matplotlib.figure.Figure at 0x7faf03915278>

And i don't see any plots

from qiskit-tutorials.

rraymondhp avatar rraymondhp commented on August 18, 2024

You're welcome @tanweer-ali
This is an issue with permutation of qubit measurements that we are still working to fix.
This is the workaround as noted in my notebook below:
https://github.com/jaygambetta/qiskit-tutorial/blob/rr-quantum-emoticon-nopermutation/hello_world/quantum_emoticon-without_permutation.ipynb

We also had a discussion on the slack channel about this.
https://qiskit.slack.com/archives/C7SJ0PJ5A/p1519833287000006

Sorry for the inconvenience!

from qiskit-tutorials.

tanweer-ali avatar tanweer-ali commented on August 18, 2024

@rraymondhp Thank you!
How do i join the slack channel? my email is not signed up for it ?
I am still looking into your other link.

from qiskit-tutorials.

indisoluble avatar indisoluble commented on August 18, 2024

Closing this issue. Fixed in Qiskit/qiskit#347

from qiskit-tutorials.

amandeep1988 avatar amandeep1988 commented on August 18, 2024

#put barrier before measurement
qc.barrier(qr)

measure

for j in range(16):
qc.measure(qr[j], cr[j])

run and get results

results = qp.execute(["smiley_writer"], backend='ibmqx5', shots=1024, timeout=300)
stats = results.get_counts("smiley_writer")

Even after putting barrier before measurement . we are still getting error. please tell solution

Got a 400 code response to https://quantumexperience.ng.bluemix.net/api/Jobs?access_token=MZgk97UyjskiUbqxKJmEPYKB46DDjdyJb0DiQ7gBu2HcP8A17H0Ps1s7I6PNBGzK: {"error":{"status":400,"message":"Generic error","code":"GENERIC_ERROR"}}
Got a 400 code response to https://quantumexperience.ng.bluemix.net/api/Jobs?access_token=MZgk97UyjskiUbqxKJmEPYKB46DDjdyJb0DiQ7gBu2HcP8A17H0Ps1s7I6PNBGzK: {"error":{"status":400,"message":"Generic error","code":"GENERIC_ERROR"}}
Got a 400 code response to https://quantumexperience.ng.bluemix.net/api/Jobs?access_token=MZgk97UyjskiUbqxKJmEPYKB46DDjdyJb0DiQ7gBu2HcP8A17H0Ps1s7I6PNBGzK: {"error":{"status":400,"message":"Generic error","code":"GENERIC_ERROR"}}
Got a 400 code response to https://quantumexperience.ng.bluemix.net/api/Jobs?access_token=MZgk97UyjskiUbqxKJmEPYKB46DDjdyJb0DiQ7gBu2HcP8A17H0Ps1s7I6PNBGzK: {"error":{"status":400,"message":"Generic error","code":"GENERIC_ERROR"}}
Got a 400 code response to https://quantumexperience.ng.bluemix.net/api/Jobs?access_token=MZgk97UyjskiUbqxKJmEPYKB46DDjdyJb0DiQ7gBu2HcP8A17H0Ps1s7I6PNBGzK: {"error":{"status":400,"message":"Generic error","code":"GENERIC_ERROR"}}

from qiskit-tutorials.

rraymondhp avatar rraymondhp commented on August 18, 2024

Hi @amandeep1988
It's strange because clicking the links (https://...) at your post I can see the counts/outputs of your results. Let me see what is wrong. Have you updated your qiskit to the latest version of 0.5.6?

Please also change your token, as it has been revealed to public by your post.

from qiskit-tutorials.

amandeep1988 avatar amandeep1988 commented on August 18, 2024

from qiskit-tutorials.

amandeep1988 avatar amandeep1988 commented on August 18, 2024

@rraymondhp
Now, it gives timed out error.
Sometimes it gives Got a 400 code response........... or either timeout error even after setting timeout to 600.

from qiskit-tutorials.

rraymondhp avatar rraymondhp commented on August 18, 2024

Hi @amandeep1988

600 secs are too short. please refer to the tutorial below for how to queue without setting timeout.

https://nbviewer.jupyter.org/github/QISKit/qiskit-tutorial/blob/master/hello_world/quantum_world.ipynb

from qiskit-tutorials.

amandeep1988 avatar amandeep1988 commented on August 18, 2024

from qiskit-tutorials.

rraymondhp avatar rraymondhp commented on August 18, 2024

hi,

my point is to replace the timeout function as below:

lapse = 0
interval = 10
while not job_exp.done:
    print('Status @ {} seconds'.format(interval * lapse))
    print(job_exp.status)
    time.sleep(interval)
    lapse += 1
print(job_exp.status)
plot_histogram(job_exp.result().get_counts(qc))

If you don`t need to draw circuits you can just disable the drawer. or use the matplotlib drawer as detailed here:

https://nbviewer.jupyter.org/github/QISKit/qiskit-tutorial/blob/master/reference/tools/matplotlib_circuit_drawer.ipynb

from qiskit-tutorials.

amandeep1988 avatar amandeep1988 commented on August 18, 2024

from qiskit-tutorials.

amandeep1988 avatar amandeep1988 commented on August 18, 2024

from qiskit-tutorials.

rraymondhp avatar rraymondhp commented on August 18, 2024

I will look into it later and reopen the issue.
Is it possible to have your notebook so I can test it myself?

from qiskit-tutorials.

amandeep1988 avatar amandeep1988 commented on August 18, 2024

from qiskit-tutorials.

rraymondhp avatar rraymondhp commented on August 18, 2024

Hi,
I cannot recreate your problem in my environment. There is a possibility you do not import Qconfig.py appropriately. The lowest_pending_job() function requires you to register your APItoken first before running it.

Best regards

from qiskit-tutorials.

rraymondhp avatar rraymondhp commented on August 18, 2024

I am closing this issue. Please raise a new issue if you still have the problem.

from qiskit-tutorials.

profversaggi avatar profversaggi commented on August 18, 2024

ImportError Traceback (most recent call last) in ()----> 1 from qiskit.tools.visualization import plot_histogram ~\Anaconda3\lib\site-packages\qiskit\tools\visualization_init_.py in () 8 """Main QISKit visualization methods.""" 9 ---> 10 from ._circuit_visualization import circuit_drawer, plot_circuit, generate_latex_source,\ 11 latex_circuit_drawer, matplotlib_circuit_drawer, qx_color_scheme 12 from ._state_visualization import plot_state ~\Anaconda3\lib\site-packages\qiskit\tools\visualization_circuit_visualization.py in () 33 import numpy as np 34 ---> 35 from PIL import Image, ImageChops 36 37 from qiskit import QuantumCircuit, QISKitError, load_qasm_file ~\Anaconda3\lib\site-packages\PIL\Image.py in () 58 # Also note that Image.core is not a publicly documented interface, 59 # and should be considered private and subject to change.---> 60 from . import _imaging as core 61 if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None): 62 raise ImportError("The _imaging extension was built for another " ImportError: DLL load failed: The specified module could not be found. Module not found and cannot execute histogram.

On Thu, Jul 12, 2018 at 10:18 AM, Rudy Raymond @.***> wrote: Hi @amandeep1988 https://github.com/amandeep1988 600 secs are too short. please refer to the tutorial below for how to queue without setting timeout. https://nbviewer.jupyter.org/github/QISKit/qiskit-tutorial/ blob/master/hello_world/quantum_world.ipynb — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#88 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AMWPfeEL5fomVXyuXGTRGHHGV-E3foFXks5uFtUVgaJpZM4RzFoc .
-- Thanks & Regards Amandeep Singh

Were you ever able to resolve this - I'm getting the same error "ImportError: DLL load failed: The specified module could not be found."

from qiskit-tutorials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.