tqsd / QuNetSim

A quantum network simulation framework.
https://tqsd.github.io/QuNetSim/
MIT License
118 stars 52 forks source link

Python not recognizing get_qubit/get_qubits despite being most up to date version. #148

Closed nskjellum closed 1 year ago

nskjellum commented 2 years ago

Describe the bug I have installed qunet sim using pip into my python venv, which installed version (0.1.2.post3). I have attempted to use the up to date get_qubit, get_data_qubits, functions, but these are not recognized when I attempt to use them. It provides the following error:

AttributeError: 'Host' object has no attribute 'get_qubits'

To Reproduce Steps to reproduce the behavior:

  1. Install qunetsim.
  2. Create program that uses "get_qubits" correctly and execute.

Expected behavior Method should be accepted attribute of host.

System:

stephendiadamo commented 2 years ago

I haven't yet updated the PyPI library yet, I can do this in the coming days. In the mean time, you can use the source code directly since it will be the latest release.

NadineM1012 commented 1 year ago

I have the same issue : AttributeError: 'Host' object has no attribute 'get_qubits' with python version = 3.9.16 running on google colab

stephendiadamo commented 1 year ago

Hello, sorry, I no longer have the ability to merge PRs without a secondary reviewer and so this will need some more time. The pip version is still out of date. To overcome this, you can use QuNetSim from source (i.e., clone it).

marcjofreProf commented 1 year ago

Most of the examples have some errors that prevent them from running.

I have the same issue: AttributeError: 'Host' object has no attribute 'get_qubit'

How can it be installed in google Colab the latest release?

marcjofreProf commented 1 year ago

I have the same issue : AttributeError: 'Host' object has no attribute 'get_qubits' with python version = 3.9.16 running on google colab

I seems that if I change to get_data_qubit, things seem to work. Then there are other error appearing

stephendiadamo commented 1 year ago

I have the same issue : AttributeError: 'Host' object has no attribute 'get_qubits' with python version = 3.9.16 running on google colab

I seems that if I change to get_data_qubit, things seem to work. Then there are other error appearing

Yes, the PyPi version is not up to date with the documentation. The change is simply a refactor of the method name. This is the temporary workaround. We will update the PyPi version this week. Sorry for the trouble.

stephendiadamo commented 1 year ago

The PyPi version has been updated and the problem solved.

marcjofreProf commented 1 year ago

Thanks. The newest pypi release does not install properly:

raceback (most recent call last):

File "/usr/local/lib/python3.9/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 2, in <cell line: 1> import qunetsim

File "/usr/local/lib/python3.9/dist-packages/qunetsim/init.py", line 1, in from .components import Host, Network

File "/usr/local/lib/python3.9/dist-packages/qunetsim/components/init.py", line 1, in from .host import Host

File "/usr/local/lib/python3.9/dist-packages/qunetsim/components/host.py", line 1368 ) ^ SyntaxError: unmatched ')'

stephendiadamo commented 1 year ago

Please try again, it's been fixed in a second new version.

Thanks, Stephen

On Thu, Apr 20, 2023 at 12:07 PM marcjofreProf @.***> wrote:

Thanks. The newest pypi release does not install properly:

raceback (most recent call last):

File "/usr/local/lib/python3.9/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code exec(code_obj, self.user_global_ns, self.user_ns)

File "" https://localhost:8080/#, line 2, in <cell line: 1> import qunetsim

File "/usr/local/lib/python3.9/dist-packages/qunetsim/init.py", line 1, in from .components import Host, Network

File "/usr/local/lib/python3.9/dist-packages/qunetsim/components/init.py", line 1, in from .host import Host

File "/usr/local/lib/python3.9/dist-packages/qunetsim/components/host.py", line 1368 ) ^ SyntaxError: unmatched ')'

— Reply to this email directly, view it on GitHub https://github.com/tqsd/QuNetSim/issues/148#issuecomment-1516066078, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJDSBOYXH7W7NMJFBRVWRLXCEDELANCNFSM6AAAAAAR27ENCE . You are receiving this because you modified the open/close state.Message ID: @.***>

marcjofreProf commented 1 year ago

Now seem to work

thanks