Hybrid-Quantum-Classical-Neural-Networks-for-Diabetic-Retinopathy icon indicating copy to clipboard operation
Hybrid-Quantum-Classical-Neural-Networks-for-Diabetic-Retinopathy copied to clipboard

TypeError: (): incompatible function arguments

Open itstechaj opened this issue 1 year ago • 0 comments

Hi, while running this line** test_circuit.run([1,2,1,4,5,6,8])** in your HQCNNmultiqubit2outputs.ipynb in colab, error happened.

Error is : -

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[<ipython-input-8-f4fcf7b0b0f1>](https://localhost:8080/#) in <cell line: 1>()
----> 1 test_circuit.run([1,2,1,4,5,6,8])
      2 
      3 test_circuit._circuit.draw()

7 frames
[<ipython-input-4-f5ba61093b30>](https://localhost:8080/#) in run(self, thetas)
     54 
     55     #execution
---> 56     counts = job.result().get_counts(self._circuit)
     57 
     58     expects = np.zeros(8)

[/usr/local/lib/python3.10/dist-packages/qiskit_aer/jobs/utils.py](https://localhost:8080/#) in _wrapper(self, *args, **kwargs)
     40         if self._future is None:
     41             raise JobError("Job not submitted yet!. You have to .submit() first!")
---> 42         return func(self, *args, **kwargs)
     43 
     44     return _wrapper

[/usr/local/lib/python3.10/dist-packages/qiskit_aer/jobs/aerjob.py](https://localhost:8080/#) in result(self, timeout)
    112             concurrent.futures.CancelledError: if job cancelled before completed.
    113         """
--> 114         return self._future.result(timeout=timeout)
    115 
    116     @requires_submit

[/usr/lib/python3.10/concurrent/futures/_base.py](https://localhost:8080/#) in result(self, timeout)
    449                     raise CancelledError()
    450                 elif self._state == FINISHED:
--> 451                     return self.__get_result()
    452 
    453                 self._condition.wait(timeout)

[/usr/lib/python3.10/concurrent/futures/_base.py](https://localhost:8080/#) in __get_result(self)
    401         if self._exception:
    402             try:
--> 403                 raise self._exception
    404             finally:
    405                 # Break a reference cycle with the exception in self._exception

[/usr/lib/python3.10/concurrent/futures/thread.py](https://localhost:8080/#) in run(self)
     56 
     57         try:
---> 58             result = self.fn(*self.args, **self.kwargs)
     59         except BaseException as exc:
     60             self.future.set_exception(exc)

[/usr/local/lib/python3.10/dist-packages/qiskit_aer/backends/aerbackend.py](https://localhost:8080/#) in _execute_circuits_job(self, circuits, parameter_binds, run_options, job_id, format_result)
    444             aer_circuit.circ_id = circ_id
    445 
--> 446         config = generate_aer_config(circuits, self.options, **run_options)
    447 
    448         # Run simulation

[/usr/local/lib/python3.10/dist-packages/qiskit_aer/backends/aer_compiler.py](https://localhost:8080/#) in generate_aer_config(circuits, backend_options, **run_options)
    458         if hasattr(config, key) and value is not None:
    459             value = _validate_option(key, value)
--> 460             setattr(config, key, value)
    461     return config
    462 

TypeError: (): incompatible function arguments. The following argument types are supported:
    1. (self: qiskit_aer.backends.controller_wrappers.AerConfig, arg0: List[List[Tuple[Tuple[int, int], List[float]]]]) -> None

Invoked with: <qiskit_aer.backends.controller_wrappers.AerConfig object at 0x7e5532b9a230>, [[[(3, 0), 1], [(4, 0), 1], [(6, 0), 2], [(7, 0), 1], [(9, 0), 1], [(11, 0), 5], [(12, 0), 4], [(14, 0), 6], [(15, 0), 8]]]

I think this error is because of the updates in the version of qiskit.

I searched for this error and changed codes but still doesn't work, can you please help me how to resolve this.? @DicksonWu654 I am adding the link of colab notebook for your reference : visit notebook

itstechaj avatar Aug 08 '23 05:08 itstechaj