Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job never finishes #1917

Open
Caddy8 opened this issue Sep 11, 2024 · 3 comments
Open

Job never finishes #1917

Caddy8 opened this issue Sep 11, 2024 · 3 comments
Labels
bug Something isn't working server action Need actions from the server side

Comments

@Caddy8
Copy link

Caddy8 commented Sep 11, 2024

Describe the bug
Job never finishes when using EstimatorV2 with a parametrized circuit, custom gates and pulse calibrations.

Steps to reproduce
This is a simple example to reproduce this error:

from qiskit import QuantumCircuit, pulse, transpile
from qiskit.circuit import Gate, Parameter
from qiskit.pulse.library import Gaussian
from qiskit_ibm_runtime import QiskitRuntimeService, EstimatorV2 as Estimator
from qiskit.quantum_info import SparsePauliOp
 
service = QiskitRuntimeService(channel="ibm_quantum")
backend = service.least_busy(operational=True, simulator=False)
estimator = Estimator(mode=backend)

print(backend)

Second block:

parameters = [Parameter(f'{i}') for i in range(3)]

circ = QuantumCircuit(1, 1)
custom_gate = Gate('my_custom_gate', 1, [parameters[0], parameters[1], parameters[2]])
circ.append(custom_gate, [0])
circ.measure(0, 0)
 
circ.draw('mpl')

def pulse_builder(a,b,c):
    with pulse.build(backend, name='custom') as my_schedule:
        pulse.play(Gaussian(duration=a, amp=b, sigma=c), pulse.drive_channel(0))
    return my_schedule
 
circ.add_calibration('my_custom_gate', [0], pulse_builder(parameters[0], parameters[1], parameters[2]), [parameters[0], parameters[1], parameters[2]])
 
circ = transpile(circ)

circ.draw('mpl', idle_wires=False)

Last block:

hamiltonian = SparsePauliOp.from_list(
    [("Y", -0.3980), ("Z", -0.0113), ("X", 0.1810)]
)
Params = [64,0.2,8]
pub = (circ, [hamiltonian], [Params])
result = estimator.run([pub]).result()

Expected behavior
This should return a result and not remain in the 'running' state 'forever'. I waited for several minutes until I cancelled the job. This job should only take a couple of seconds.

Suggested solutions

Additional Information
This problem does not occur if I use the SamplerV2 instead of the EstimatorV2.
This does not throw a python error.

  • qiskit-ibm-runtime version:
  • 0.25.0
  • Python version:
  • 3.10.14
  • Operating system:
  • Windows 11 Pro, Version 23H2
@Caddy8 Caddy8 added the bug Something isn't working label Sep 11, 2024
@kt474
Copy link
Member

kt474 commented Sep 17, 2024

Hi @Caddy8

I ran your code snippets without any issues. Since you're running a job on real hardware there's a good chance that your job was in queue waiting to run. You can check the status of your jobs here https://quantum.ibm.com/workloads

@Caddy8
Copy link
Author

Caddy8 commented Sep 17, 2024

Hi @kt474
Thank you on the update in this topic. I checked the status of my job on [https://quantum.ibm.com/workloads] and I meant the 'running' state on that website under 'Status timeline' after 'Pending' was completed. I have attached a screenshot of this job running for over 2 minutes (it started 7:10 pm and at the time of the screenshot it was 7:13 pm) with the added line of code estimator.options.default_shots=10 so that the job should take practically not time.
Just to be sure I also ran the code without that added line and again the job does not finish. (Screenshot also attached, this has the pending time of nearly 9 minutes.)
Bildschirmfoto 2024-09-17 um 19 13 12
Bildschirmfoto 2024-09-17 um 19 26 47

@kt474
Copy link
Member

kt474 commented Sep 17, 2024

Ah sorry, I can replicate your issue now. I'll follow up with the appropriate team

@kt474 kt474 added the server action Need actions from the server side label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server action Need actions from the server side
Projects
None yet
Development

No branches or pull requests

2 participants