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

need a disassembler to replace qobj_to_circuits #1952

Closed
ajavadia opened this issue Mar 11, 2019 · 2 comments · Fixed by #2137
Closed

need a disassembler to replace qobj_to_circuits #1952

ajavadia opened this issue Mar 11, 2019 · 2 comments · Fixed by #2137
Assignees
Labels
API affects user-facing API change good first issue Good for newcomers
Milestone

Comments

@ajavadia
Copy link
Member

What is the expected enhancement?

We need a function qiskit.compiler.disassemble() that takes an assembled qobj and returns the components:

circuits, run_config, user_qobj_header = disassemble_qobj(qobj)

Currently we have a converter for this (qobj_to_circuits), but this is not really a conversion as the two entities are quite different. So this should be deprecated.

@kdk
Copy link
Member

kdk commented Mar 13, 2019

Just to clarify, since this is a first issue, am I right in thinking that the goal here is splitting out the run_config and user_qobj_header, not in covering differences in the qobj instruction and Terra circuit API (conditionals, memory/registers, bfuncs, ...) beyond what's already covered by qobj_to_circuits?

qobj has a superset of the functionality supported by the Terra circuits API, so a general disassembly won't always be trivial. We could limit scope to terra-generated qobj, without conditionals, (effectively what's covered by qobj_to_circuits now) and raise an exception for anything more complicated.

@ajavadia
Copy link
Member Author

ajavadia commented Apr 4, 2019

Yes I think you are right. This issue is more about returning all the other stuff (header, config), not only the circuit (as qobj_to_circuit does).

Some things like 'registers' will not have equivalents in the circuit, so I think they may get lost. But I think conditionals are fine no? At least the simple conditionals we have now.

@ajavadia ajavadia added the API affects user-facing API change label Apr 16, 2019
@kdk kdk added this to the 0.8 milestone Apr 16, 2019
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Apr 16, 2019
This commit adds a new dissassembler module that has a single
dissasemble function. This is used to take an input qobj and return the
circuits, run_config, and user headers which are stored in it.

Fixes Qiskit#1952
ajavadia pushed a commit that referenced this issue Apr 24, 2019
* Add dissasembler to dissassemble a compiled qobj

This commit adds a new dissassembler module that has a single
dissasemble function. This is used to take an input qobj and return the
circuits, run_config, and user headers which are stored in it.

Fixes #1952

* Add tests

* Add header asserts

* Fix lint

* Fix tests

* Fix lint

* Deprecate qobj_to_circuits

* Fix typos

* Disable cyclic-import pylint rule

This rule is completely broken and often just returns false postives.
The latest example can be found here:

https://travis-ci.com/Qiskit/qiskit-terra/jobs/194288168

We can just rely on python to catch a cyclic import issues, because
it'll raise an error if it's not resolvable.

* Revert "Disable cyclic-import pylint rule"

This reverts commit 7e614ec.

* Update import paths
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this issue Jul 30, 2019
* Add dissasembler to dissassemble a compiled qobj

This commit adds a new dissassembler module that has a single
dissasemble function. This is used to take an input qobj and return the
circuits, run_config, and user headers which are stored in it.

Fixes Qiskit#1952

* Add tests

* Add header asserts

* Fix lint

* Fix tests

* Fix lint

* Deprecate qobj_to_circuits

* Fix typos

* Disable cyclic-import pylint rule

This rule is completely broken and often just returns false postives.
The latest example can be found here:

https://travis-ci.com/Qiskit/qiskit-terra/jobs/194288168

We can just rely on python to catch a cyclic import issues, because
it'll raise an error if it's not resolvable.

* Revert "Disable cyclic-import pylint rule"

This reverts commit 7e614ec.

* Update import paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API affects user-facing API change good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants