-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[WIP] Qobj class, schema validation, and update backends to accept qobj #415
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 tasks
Add placeholders and reminders for qobj class and validation (original author: @ajavadia, rewrote the commit due to rebase).
Reintroduce a basic `QObj` class, along with subobjects and helper classes, based on a simplification of the one introduced in Qiskit#144. The required attributes in the specification are treated as mandatory arguments for the constructor, leaving the optinal and the unspecified as kwargs.
Revise the `QObjStructure.as_dict()` function in order to make it generic (at the base class level) and recursive: the public attributes of a structure are traversed, handling lists and delegating into each subobject. Use `SimpleNameSpace` for simplifying the handling of `kwargs` on the constructors via standard Python facilities. Update several QObj structures to reflect the current schema. Add a test for QObj instantation and `as_dict()` comparison.
Revise `compiler.compile()` in order to return a `QObj` instance. The functionality of the previous `compile()` (kept as `compile_non_qobj` temporarily) is split into two helper functions (`_build_qobj`) for isolating the handling of the compiler configuration and the creation of the objects. Update `JsonBackend` with the changes to the schema (`operations` becomes `instructions`). Update the `local_qasm_simulator` with the changes to the schema and accepting a `QObj` at `run()`. Update `Result` with the changes to the schema.
Make the `QObjStructures` pickable via `__reduce__`, in order to allow passing them to the futures. Update `QuantumProgram._run_internal()`, `JobProcessor.run_backend()` in order to pass QObjs to the backends. The rest of the codebase has not been updated yet (in particular, the backends other than the QASM simulator, and the tests), in order to focus on the functionality and reconcile back when the rest of the branches are merged.
9 tasks
9 tasks
Closing this WIP in order to issue a new one without conflicts and with only the |
Anthony-Gandon
added a commit
to Anthony-Gandon/qiskit-terra
that referenced
this pull request
Apr 1, 2022
Fixes Qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally.
Anthony-Gandon
added a commit
to Anthony-Gandon/qiskit-terra
that referenced
this pull request
Apr 1, 2022
Fixes Qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally.
mergify bot
added a commit
that referenced
this pull request
Apr 8, 2022
* Added support for non-hermitian operators in AerPauliExpectation Fixes #415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Added support for non-hermitian operators in AerPauliExpectation Fixes #415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Update test/python/opflow/test_aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update aer_pauli_expectation.py Use a generator instead of list * Update qiskit/opflow/expectations/aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update releasenotes/notes/add-support-non-hermitian-op-aerpauliexpectation-653d8e16de4eca07.yaml Co-authored-by: Julien Gacon <gaconju@gmail.com> * Add a test case for PauliOp * Change the test cases from using ~StateFn() to using StateFn(, is_measurement=True) * Fix the formatting Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mergify bot
added a commit
that referenced
this pull request
Aug 24, 2022
* Added support for non-hermitian operators in AerPauliExpectation Fixes #415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Added support for non-hermitian operators in AerPauliExpectation Fixes #415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Update test/python/opflow/test_aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update aer_pauli_expectation.py Use a generator instead of list * Update qiskit/opflow/expectations/aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update releasenotes/notes/add-support-non-hermitian-op-aerpauliexpectation-653d8e16de4eca07.yaml Co-authored-by: Julien Gacon <gaconju@gmail.com> * Add a test case for PauliOp * Change the test cases from using ~StateFn() to using StateFn(, is_measurement=True) * Fix the formatting * Working point for QEOM * Small changes + Release note * Undesired change * Undesired change * Indentation error * Parenthesis * Minor changes in docstring * Minor changes in docstring Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT
pushed a commit
to ElePT/qiskit
that referenced
this pull request
Jun 27, 2023
* Added support for non-hermitian operators in AerPauliExpectation Fixes Qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Added support for non-hermitian operators in AerPauliExpectation Fixes Qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Update test/python/opflow/test_aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update aer_pauli_expectation.py Use a generator instead of list * Update qiskit/opflow/expectations/aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update releasenotes/notes/add-support-non-hermitian-op-aerpauliexpectation-653d8e16de4eca07.yaml Co-authored-by: Julien Gacon <gaconju@gmail.com> * Add a test case for PauliOp * Change the test cases from using ~StateFn() to using StateFn(, is_measurement=True) * Fix the formatting * Working point for QEOM * Small changes + Release note * Undesired change * Undesired change * Indentation error * Parenthesis * Minor changes in docstring * Minor changes in docstring Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT
pushed a commit
to ElePT/qiskit-algorithms-test
that referenced
this pull request
Jul 17, 2023
* Added support for non-hermitian operators in AerPauliExpectation Fixes Qiskit/qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Added support for non-hermitian operators in AerPauliExpectation Fixes Qiskit/qiskit#415 QEOM creates a dictionary of operators to evaluate on the groundstate. When using the noisy simulators (qasm_simulator or aer_simulator), one could either use PauliExpectation (with noise) or AerPauliExpectation (without noise). PauliExpectation works with non-hermitian operators but internal methods of AerPauliExpectation raised an Error. This is a workaround to this limitation. Note that using include_custom=True on qasm allows the VQE to use a local AerPauliExpectation without using the "expectation" input. This does not apply to QEOM and one should explicitly define the "expectation" input of the VQE for it to apply globally. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Add a test case for non-hermitian operators. * Update test/python/opflow/test_aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update aer_pauli_expectation.py Use a generator instead of list * Update qiskit/opflow/expectations/aer_pauli_expectation.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Update releasenotes/notes/add-support-non-hermitian-op-aerpauliexpectation-653d8e16de4eca07.yaml Co-authored-by: Julien Gacon <gaconju@gmail.com> * Add a test case for PauliOp * Change the test cases from using ~StateFn() to using StateFn(, is_measurement=True) * Fix the formatting * Working point for QEOM * Small changes + Release note * Undesired change * Undesired change * Indentation error * Parenthesis * Minor changes in docstring * Minor changes in docstring Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a replacement for two previous PRs (#144 and #326) that attempted to implement features related to qobj. In light of recent changes to the qiskit core, and recent changes to the qobj spec itslef, we are going to attempt to integrate qobj as an object in the qiskit flow, pass a serialized form of it to backends, and validate them against updated schemas.
@diego-plan9 and @ewinston can you please help port over the files from your previous PRs that we should have here? @atilag can you please ensure the jobprocessor and tests are up to date? I will work on the schemas and parsing of the results received from backends.
Description
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: