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

PermissionError when running hello_quantum on local_qiskit_simulator and local_clifford_simulator #344

Closed
psyhtest opened this issue Mar 15, 2018 · 4 comments

Comments

@psyhtest
Copy link

psyhtest commented Mar 15, 2018

Attempting to run hello_quantum.py on local_qiskit_simulator and local_clifford_simulator results in a PermissionError exception.

Expected Behavior

When using local_qasm_simulator, the following gets printed to stdout:

      -- Ignoring SSL errors.  This is not recommended --
      WARNING: There's no connection with IBMQuantumExperience servers.
                   cannot test I/O intesive tasks, will only test CPU intensive tasks
                   running the jobs in the local simulator
      The backends available for use are:
      ['local_clifford_simulator',
       'local_qiskit_simulator',
       'local_unitary_simulator',
       'local_qasm_simulator']
      
      
      COMPLETED
      {'counts': {'00': 512, '11': 512}}

Current Behavior

When using local_qiskit_simulator and local_clifford_simulator, the following gets printed to stderr:

      concurrent.futures.process._RemoteTraceback:
      """
      Traceback (most recent call last):
        File "/usr/lib/python3.5/concurrent/futures/process.py", line 175, in _process_worker
          r = call_item.fn(*call_item.args, **call_item.kwargs)
        File "/home/anton/CK_TOOLS/lib-qiskit-gcc-6.3.0-linux-64/build/qiskit/_jobprocessor.py", line 54, in run_backend
          return backend.run(q_job)
        File "/home/anton/CK_TOOLS/lib-qiskit-gcc-6.3.0-linux-64/build/qiskit/backends/_qiskit_cpp_simulator.py", line 87, in run
          result = run(qobj, self._configuration['exe'])
        File "/home/anton/CK_TOOLS/lib-qiskit-gcc-6.3.0-linux-64/build/qiskit/backends/_qiskit_cpp_simulator.py", line 158, in run
          stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc:
        File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
          restore_signals, start_new_session)
        File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
          raise child_exception_type(errno_num, err_msg)
      PermissionError: [Errno 13] Permission denied
      """
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "../hello_quantum.py", line 56, in <module>
          print(result.get_data("bell"))
        File "/home/anton/CK_TOOLS/lib-qiskit-gcc-6.3.0-linux-64/build/qiskit/_result.py", line 204, in get_data
          raise exception
        File "/home/anton/CK_TOOLS/lib-qiskit-gcc-6.3.0-linux-64/build/qiskit/_jobprocessor.py", line 99, in _job_done_callback
          result = future.result()
        File "/usr/lib/python3.5/concurrent/futures/_base.py", line 398, in result
          return self.__get_result()
        File "/usr/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
          raise self._exception
      PermissionError: [Errno 13] Permission denied

Possible Solution

N/A.

Steps to Reproduce (for bugs)

Please see how to reproduce the problem via Collective Knowledge - QISKit here.

Context

The program is virtually unmodified. The only significant change consists in reading the backend name from the environment:

backend = 'local_qasm_simulator'
if 'CK_IBM_BACKEND' in os.environ:
    backend = os.environ['CK_IBM_BACKEND']

Your Environment

  • Version used: Master
  • Environment name and version: Python 3.5.2
  • Operating System and version: several Ubuntu 16.04 systems (including x86_64 and aarch64).

/cc @fvella

@diego-plan9
Copy link
Member

Looking at the linked issues on the description, it seems you are manually compiling the simulator, and patching the _qiskit_cpp_simulator.py to look for the simulator on a custom path? The custom changes seem to be in the right direction, but looking at the traceback there might be an issue with the executable permissions of the file (chmod), or might also require further patching to look for the binary in the right place by the time run() is executed (it is a bit more convoluted, as it can be overridden by the configuration for a particular qobj).

Without being too familiar with ck, perhaps a good first step would be to check the value of executable when the function is invoked at https://github.com/QISKit/qiskit-sdk-py/blob/c8f04404cacc1096264b9f6fa119e82d72030a59/qiskit/backends/_qiskit_cpp_simulator.py#L133, and check if that file exists in your environment and has the right permissions?

Please note as well that we are in the process of making significant changes to the C++ simulator (#351) for the upcoming release, and in the short future we will move towards including the simulator as a shared library in a more pip-conventional way (compiling the simulator manually should still be an option, but not the one used by the "official" installation procedures). While we try to cater to all configurations and setups, we cannot unfortunately commit to supporting all existing integration possibilities - and this particular one seems a bit out of the usual scope. I'd personally be happy to lend a hand at ctuning/ck-qiskit#2 and continue the discussion there!

@psyhtest
Copy link
Author

psyhtest commented May 15, 2018

@diego-plan9 Apologies for not replying straightaway. Your spot-on advice helped us to resolve the issue (on our side) quickly, but then we put all the QISKit work on hold. We should resume it shortly. Thank you once again, and look forward to continuing discussions as part of that.

@diego-plan9
Copy link
Member

No worries at al, @psyhtest - I peeked a bit in the linked issues in your repository by that time, and was glad to learn that it helped solve your issue, and it also seems it made sense to put the work on hold until the 0.5 release was out! 👍

I'd personally be happy to try to find ways of easing collaboration with your Quantum Collective Knowledge project, which seems an exciting initiative and it feels it has a number of points where we can cooperate. Nevertheless, we will provide a more official answer after discussing with the team - thanks!

@psyhtest
Copy link
Author

Thanks @diego-plan9! Let's keep in touch.

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