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

Clifford simulator result() fails on any circuit #1119

Closed
mtreinish opened this issue Oct 17, 2018 · 0 comments · Fixed by #1125
Closed

Clifford simulator result() fails on any circuit #1119

mtreinish opened this issue Oct 17, 2018 · 0 comments · Fixed by #1125
Projects

Comments

@mtreinish
Copy link
Member

mtreinish commented Oct 17, 2018

Informations

  • Qiskit Terra version: Latest master
  • Python version: 3.7
  • Operating system: Linux

What is the current behavior?

When attempting to call execute() with the backend being the clifford simulator it always fails.

This was hit in trying to add some new tests that ran on all backends:

https://travis-ci.org/Qiskit/qiskit-terra/jobs/442859915#L1694

1: concurrent.futures.process._RemoteTraceback: 
1: """
1: Traceback (most recent call last):
1:   File "/opt/python/3.5.6/lib/python3.5/concurrent/futures/process.py", line 175, in _process_worker
1:     r = call_item.fn(*call_item.args, **call_item.kwargs)
1:   File "/home/travis/build/Qiskit/qiskit-terra/qiskit/backends/aer/qasm_simulator.py", line 151, in _run_job
1:     if 'config' in qobj:
1: TypeError: argument of type 'Qobj' is not iterable
1: """
1: 
1: The above exception was the direct cause of the following exception:
1: 
1: Traceback (most recent call last):
1:   File "/home/travis/build/Qiskit/qiskit-terra/test/python/test_result.py", line 136, in test_add_aer
1:     result_a = qiskit.execute(qc1, backend).result()
1:   File "/home/travis/build/Qiskit/qiskit-terra/qiskit/backends/aer/aerjob.py", line 37, in _wrapper
1:     return func(self, *args, **kwargs)
1:   File "/home/travis/build/Qiskit/qiskit-terra/qiskit/backends/aer/aerjob.py", line 92, in result
1:     return self._future.result(timeout=timeout)
1:   File "/opt/python/3.5.6/lib/python3.5/concurrent/futures/_base.py", line 405, in result
1:     return self.__get_result()
1:   File "/opt/python/3.5.6/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
1:     raise self._exception
1: TypeError: argument of type 'Qobj' is not iterable

Steps to reproduce the problem

Build any circuit and run execute() and result() on it with the clifford simulator backend. For example:

import qiskit
                          
qr = qiskit.QuantumRegister(2)
cr = qiskit.ClassicalRegister(2)
qc = qiskit.QuantumCircuit(qr, cr)

qc.h(qr[0])
qc.measure(qr, cr)
    
qiskit.execute(qc, 'clifford_simulator').result()

What is the expected behavior?

The circuit runs on the simulator.

Suggested solutions

Fix the underlying issue

mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Oct 22, 2018
The qobj conversion for the clifford simulator was incorrectly treating
a qobj object as a dict and trying to access it like one. This commit
fixes this by converting an input qobj object into a dict, performing
the transforms and then making a new qobj from that dit to pass to
run().

Fixes Qiskit#1119
@jaygambetta jaygambetta added this to To do in BasicAer via automation Oct 22, 2018
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Nov 1, 2018
This commit adds some additional tests that loop over all available
backends to verify that certain common results operations work on all
the available backends. It turns out during the course of a normal test
run we don't verify that results operations work with all the available
(in-repo) backends. This has led to issues like Qiskit#1119 and Qiskit#1116 because
we didn't have this verification. This adds the start of the testing
coverage needed, it only adds coverage for adding results. But, we can
expand this to cover additional results operations in the future.
BasicAer automation moved this from To do to Done Nov 2, 2018
jaygambetta pushed a commit that referenced this issue Nov 2, 2018
The qobj conversion for the clifford simulator was incorrectly treating
a qobj object as a dict and trying to access it like one. This commit
fixes this by converting an input qobj object into a dict, performing
the transforms and then making a new qobj from that dit to pass to
run().

Fixes #1119
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this issue Jul 30, 2019
The qobj conversion for the clifford simulator was incorrectly treating
a qobj object as a dict and trying to access it like one. This commit
fixes this by converting an input qobj object into a dict, performing
the transforms and then making a new qobj from that dit to pass to
run().

Fixes Qiskit#1119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
BasicAer
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant