indian-institute-of-science-qc / qiskit-aakash

This repository contains a new backend which can simulate noisy quantum logic circuits using the density matrix formalism.
https://doi.org/10.1142/S0129183122501030
Apache License 2.0
29 stars 21 forks source link

Testing of Terra Upgrade Branch #10

Open SamarthH opened 2 years ago

SamarthH commented 2 years ago

Hi all. At this point, the terra_upgrade branch is functional and runs all examples with the expected output and passes all tests. I would like to know if you have any other tests that you would like to perform before we can merge this into the main repository.

SamarthH commented 2 years ago

@biplab37 @obliviateandsurrender

biplab37 commented 2 years ago

Installation Issues

>>> import qiskit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/biplab/Desktop/Code/python/qiskit-aakash/qiskit/__init__.py", line 21, in <module>
    import qiskit._accelerate
ModuleNotFoundError: No module named 'qiskit._accelerate'

To avoid this error following file qiskit/_accelerate.cpython-310-x86_64-linux-gnu.so is required but the file is not generated by default.

Processing ./qiskit-aakash
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /root/venv/bin/python /root/venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpw8nu9rkm
       cwd: /tmp/pip-req-build-uz_5nflc
  Complete output (32 lines):
  Traceback (most recent call last):
    File "/root/venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/root/venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/root/venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/usr/local/lib/python3.7/site-packages/setuptools/build_meta.py", line 155, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "/usr/local/lib/python3.7/site-packages/setuptools/build_meta.py", line 135, in _get_build_requires
      self.run_setup()
    File "/usr/local/lib/python3.7/site-packages/setuptools/build_meta.py", line 150, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 103, in <module>
      "aqc = qiskit.transpiler.synthesis.aqc.aqc_plugin:AQCSynthesisPlugin",
    File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 456, in __init__
      k: v for k, v in attrs.items()
    File "/usr/local/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 293, in __init__
      self.finalize_options()
    File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 807, in finalize_options
      ep(self)
    File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 813, in _finalize_setup_keywords
      ep.require(installer=self.fetch_build_egg)
    File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2472, in require
      items = working_set.resolve(reqs, env, installer, extras=self.extras)
    File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 777, in resolve
      raise VersionConflict(dist, req).with_context(dependent_req)
  pkg_resources.VersionConflict: (setuptools 57.5.0 (/usr/local/lib/python3.7/site-packages), Requirement.parse('setuptools>=58.0'))
  ----------------------------------------
ERROR: Command errored out with exit status 1: /root/venv/bin/python /root/venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpw8nu9rkm Check the logs for full command output.
SamarthH commented 2 years ago

That is possibly because either you have not installed Rust, or Rust is not in your PATH. Please check that. Once you have updated your path, please try to reinstall. That will work.

obliviateandsurrender commented 2 years ago

Is Rust a dependency for the updated Terra? I do remember Qiskit moving towards retworkx from networkx for better speedups.

biplab37 commented 2 years ago

That is possibly because either you have not installed Rust, or Rust is not in your PATH. Please check that. Once you have updated your path, please try to reinstall. That will work.

My bad, I've installed rust but it was not in the path. It works in my desktop but not in Colab etc. (even after installing rustc).

SamarthH commented 2 years ago

Yes, Rust is a dependency for the updated Terra. I am unsure as to how one would make this work in Colab

biplab37 commented 2 years ago

I did some basic test and the code works so far. I want to do a few more tests.

There should be a way to make this work in Colab or Binder. I will look for it meanwhile if someone find a way leave a comment here.

C-DAC uses the master branch in their supercomputer(at least that's what I am told). I will give them a heads up before going through the process of merging this to the master branch.

SamarthH commented 2 years ago

Please do. Thanks a lot!

SamarthH commented 2 years ago

@biplab37 While giving a heads-up to the people at CDAC, please do not forget to mention that the output format has changed ever so slightly. Now it is an object, not a dictionary

obliviateandsurrender commented 2 years ago

I think the output has always been a Result object. We should be able to manually change it to a dictionary, just in case, something breaks.

SamarthH commented 2 years ago

Now the output is a Result object with the Result.results being an ExperimentalData object

biplab37 commented 2 years ago

If anyone else did not find any obvious mistake then we can merge the terra-upgrade branch with the master branch. This will also fix the installation issue (#8).

SamarthH commented 2 years ago

So, there are some issues that we see which we are trying to fix right now. Once they are done we would let you know