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

RuntimeJobFailureError got an unexpected keyword argument 'dynamic' #230

Closed
GBisi opened this issue Dec 18, 2023 · 6 comments
Closed

RuntimeJobFailureError got an unexpected keyword argument 'dynamic' #230

GBisi opened this issue Dec 18, 2023 · 6 comments

Comments

@GBisi
Copy link

GBisi commented Dec 18, 2023

Currently, I cannot launch the circuits because I always get this error:

File "/venv/lib/python3.11/site-packages/pytket/backends/backend.py", line 392, in run_circuit
    return self.run_circuits(
           ^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/pytket/backends/backend.py", line 417, in run_circuits
    results = self.get_results(handles, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/pytket/backends/backend.py", line 360, in get_results
    return [self.get_result(handle, **kwargs) for handle in handles]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/pytket/backends/backend.py", line 360, in <listcomp>
    return [self.get_result(handle, **kwargs) for handle in handles]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/pytket/extensions/qiskit/backends/ibm.py", line 581, in get_result
    res = job.result(timeout=kwargs.get("timeout", None))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/qiskit_ibm_runtime/runtime_job.py", line 222, in result
    raise RuntimeJobFailureError(f"Unable to retrieve job result. {error_message}")
qiskit_ibm_runtime.exceptions.RuntimeJobFailureError: "Unable to retrieve job result. TypeError: main() got an unexpected keyword argument 'dynamic"

The code I use does not pass any additional arguments

circuit = backend.get_compiled_circuit(circuit)
return backend.run_circuit(circuit, n_shots=shots)
@CalMacCQ
Copy link
Contributor

Thank you for raising this as an issue.

@cqc-melf I think you have also encountered this error?

@CalMacCQ
Copy link
Contributor

Could you please share the version of pytket-qiskit you are using? Also if its convenient for you to share a code snippet that would also be helpful.

@GBisi
Copy link
Author

GBisi commented Dec 18, 2023

Sure!

Here is a working fragment:

import pytket.circuit

import pytket.extensions.qiskit as pytket_qiskit
from qiskit_ibm_provider import IBMProvider
from qiskit_ibm_runtime import QiskitRuntimeService

ibmq_token = "my_token"
IBMProvider.save_account(token=ibmq_token, overwrite=True)
QiskitRuntimeService.save_account(channel="ibm_quantum", token=ibmq_token, overwrite=True)

pytket_circuit = pytket.circuit.Circuit(2)
pytket_circuit.H(0)
pytket_circuit.CX(0,1)
pytket_circuit.measure_all()

backend = pytket_qiskit.IBMQBackend("ibmq_qasm_simulator")
circuit = backend.get_compiled_circuit(pytket_circuit)
print(backend.run_circuit(circuit, n_shots=1000))

The output from the terminal is:

/venv/lib/python3.11/site-packages/qiskit_ibm_runtime/options/options.py:153: UserWarning: Key 'dynamic' is an unrecognized option. It may be ignored.
  warnings.warn(f"Key '{key}' is an unrecognized option. It may be ignored.")
Job status is RUNNING
Job status is ERROR

and then the exception reported above.

This is, instead, the log in the IBM Quantum dashboard:
{"status": "Failed", "reason": "TypeError: main() got an unexpected keyword argument 'dynamic'", "reason_code": null, "reason_internal": null}

Finally, the versions I'm using are:

pytket==1.22.0
pytket-qiskit==0.45.0

@GBisi GBisi closed this as completed Dec 18, 2023
@GBisi GBisi reopened this Dec 18, 2023
@GBisi GBisi closed this as completed Dec 18, 2023
@GBisi GBisi reopened this Dec 18, 2023
@GBisi GBisi closed this as completed Dec 18, 2023
@GBisi GBisi reopened this Dec 18, 2023
@CalMacCQ
Copy link
Contributor

Thank you, that is helpful. I'll take a look.

@CalMacCQ
Copy link
Contributor

I managed to reproduce your error by using your package versions.

Surprisingly the error was resolved by upgrading to pytket-qiskit==0.46. I will have to look into this more to find out the cause.

@GBisi
Copy link
Author

GBisi commented Dec 18, 2023

Wow, great thanks! With the 0.46 even in my PC now it works! Thanks again!

@GBisi GBisi closed this as completed Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants