-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add support for BackendV2 #102
Add support for BackendV2 #102
Conversation
3a91895
to
0f64268
Compare
ba44bda
to
e6f0559
Compare
e6f0559
to
a6a6719
Compare
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
9e8f975
to
f109588
Compare
bda4cd3
to
4e93267
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my side.
a0b5203
to
a69c632
Compare
Don't forget to update this tutorial, which has a giant "TODO - finish when BackendV2 is done" lol |
13ab2ea
to
b251783
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some initial comments from a quick first pass over the PR
466e655
to
9a58b48
Compare
I’ve revoked the exposed tokens
…s_lo_range Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
… validate right now
76d9265
to
9ff7da4
Compare
… to construct Target object
Pull Request Test Coverage Report for Build 1867802536
💛 - Coveralls |
* Add backend converter script from Matthew Co-Authored-By: Matthew Treinish <mtreinish@kortar.org> * FakeBackendV2, FakeQasmBeckendV2, FakeJakartaV2 in progress * Temporary fix for circular import * First try of implementing FakeJakartaV2 based on FakeQasmBackendV2/FakeBackendV2 * Implement FakeQasmBackend methods into FakeBackendV2 * Implement FakePulseBackend methods into FakeBackendV2 * Import missing PulseDefaults and adjust _get_conf_from_json method position * Adjust _get_config_from_dict method position * Fix target property Need to take closer look at _convert_to_target method * Fix _default_options method * Add FakeProviderV2 for V2 fake backends * Remove FakeQasmBackendV2 class * Copy run method from FakeBackendV1 * change configuration to self._configuration * Update backend_converter.py Based on the latest version on Qiskit/qiskit-ibm-runtime#102 Co-Authored-By: Rathish Cholarajan <rathishc24@gmail.com> * @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target * Add dtm * Add qubit properties * Add drive, measure and acquire channels. * Fix test_fake_backends * Fix ConfigurableFakeBackend circular import problem * Fix configurable_backend circular import problem * FakeAlmadenV2 * FakeArmonkV2 * FakeAthensV2 * FakeBelemV2 * FakeBoeblingenV2 * Add fake backends (except rueschlikon, tenerife and tokyo) * import fake v2 backends in __init__.py * add fake backends to mock.backend.__init__ and fake provider * Fix typos * Add defs files to manila, poughkeepsie, rome and santiago * Fix FakeCambridgeV2 * Add Hanoi and Kolkata to FakeProviderV2 * Handle no pulse backends in V2 * Fix getting qubit properties from properties bug * Fix _parse_inst_map for BackendV2 with no pulse support * Revert "Update backend_converter.py" This reverts commit 2438935. * Revert " @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target" This reverts commit eec4a49. * Use dicts instead of conf, props, defs objects * remove channels * add type hints * Use dict.get instead of brackets * clean up backend_converter.py * construct target using defs files if it exist * Fix typo in target.acquire_alignment * Handle BackendV2 in transpiler._parse_inst_map * Comment out backends in fake provider and Aer run method for testing * undo typo fix for target.acquire_alignment * Revert "Comment out backends in fake provider and Aer run method for testing" This reverts commit 2127b34. * Copy NoiseModel.from_backend() method from Aer * modify NoiseModel.from_backend method to support V2 backend * Build V2 backend noise model from self._props_dict * black reformatting * Move V2 backend code to above V1 and Legacy * Clean up FakeBackendV2 for testing * Order FakeBackendV2 to match BackendV2 * Uncomment out fake backends from fake provider v1 and fake legacy provider * Remove unused imports * Remove FakeTokyoV2 import * Remove warnings for missing conf, props and defs files * Remove lazy loading of target * Remove lazy loading of qubit properties * Remove deprecation warning for standard_gates option in noise model * linting for fake_backend.py * linting for backend_converter.py * fix `Redefining name 'warnings' from outer scope` error * lint: rename qubit_props_dict_from_props_dict * Raise error for pulse simulation * remove warnings flag * Move V2 to in front of V1 * revert changes in transpiler._parse_inst_map The changes are now in a separate PR: #7765 * remove warnings flag * fix 'no-else-raise' error * Add docstring to FakeBackendV2 * rename `kwargs` to `options` in .run method following BackendV2 * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * rearrange raising error for pulse job * Add a TODO comment for removing PulseDefaults * fix typo * black reformat * Add release note. * Fix no else raise error * Add blank new line in release note * black formatting * fix release note missing black tick * Rename FakeProviderV2 to FakeProviderForBackendV2 * Re-export FakeProviderForBackendV2 to qiskit.providers.fake_provider * black reformatting Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…iskit#102) * fix passing optimizer via dicts * fix VQE if running with aux_ops Co-authored-by: Julien Gacon <gaconju@gmail.com>
* Add backend converter script from Matthew Co-Authored-By: Matthew Treinish <mtreinish@kortar.org> * FakeBackendV2, FakeQasmBeckendV2, FakeJakartaV2 in progress * Temporary fix for circular import * First try of implementing FakeJakartaV2 based on FakeQasmBackendV2/FakeBackendV2 * Implement FakeQasmBackend methods into FakeBackendV2 * Implement FakePulseBackend methods into FakeBackendV2 * Import missing PulseDefaults and adjust _get_conf_from_json method position * Adjust _get_config_from_dict method position * Fix target property Need to take closer look at _convert_to_target method * Fix _default_options method * Add FakeProviderV2 for V2 fake backends * Remove FakeQasmBackendV2 class * Copy run method from FakeBackendV1 * change configuration to self._configuration * Update backend_converter.py Based on the latest version on Qiskit/qiskit-ibm-runtime#102 Co-Authored-By: Rathish Cholarajan <rathishc24@gmail.com> * @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target * Add dtm * Add qubit properties * Add drive, measure and acquire channels. * Fix test_fake_backends * Fix ConfigurableFakeBackend circular import problem * Fix configurable_backend circular import problem * FakeAlmadenV2 * FakeArmonkV2 * FakeAthensV2 * FakeBelemV2 * FakeBoeblingenV2 * Add fake backends (except rueschlikon, tenerife and tokyo) * import fake v2 backends in __init__.py * add fake backends to mock.backend.__init__ and fake provider * Fix typos * Add defs files to manila, poughkeepsie, rome and santiago * Fix FakeCambridgeV2 * Add Hanoi and Kolkata to FakeProviderV2 * Handle no pulse backends in V2 * Fix getting qubit properties from properties bug * Fix _parse_inst_map for BackendV2 with no pulse support * Revert "Update backend_converter.py" This reverts commit 2438935d218bf3e1059bef185d77c426cc0978d3. * Revert " @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target" This reverts commit eec4a49f590399c15a90c4579844009cc9d0dc20. * Use dicts instead of conf, props, defs objects * remove channels * add type hints * Use dict.get instead of brackets * clean up backend_converter.py * construct target using defs files if it exist * Fix typo in target.acquire_alignment * Handle BackendV2 in transpiler._parse_inst_map * Comment out backends in fake provider and Aer run method for testing * undo typo fix for target.acquire_alignment * Revert "Comment out backends in fake provider and Aer run method for testing" This reverts commit 2127b345b63e9dea1bbdbd44b397f1d14089213b. * Copy NoiseModel.from_backend() method from Aer * modify NoiseModel.from_backend method to support V2 backend * Build V2 backend noise model from self._props_dict * black reformatting * Move V2 backend code to above V1 and Legacy * Clean up FakeBackendV2 for testing * Order FakeBackendV2 to match BackendV2 * Uncomment out fake backends from fake provider v1 and fake legacy provider * Remove unused imports * Remove FakeTokyoV2 import * Remove warnings for missing conf, props and defs files * Remove lazy loading of target * Remove lazy loading of qubit properties * Remove deprecation warning for standard_gates option in noise model * linting for fake_backend.py * linting for backend_converter.py * fix `Redefining name 'warnings' from outer scope` error * lint: rename qubit_props_dict_from_props_dict * Raise error for pulse simulation * remove warnings flag * Move V2 to in front of V1 * revert changes in transpiler._parse_inst_map The changes are now in a separate PR: Qiskit/qiskit#7765 * remove warnings flag * fix 'no-else-raise' error * Add docstring to FakeBackendV2 * rename `kwargs` to `options` in .run method following BackendV2 * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * rearrange raising error for pulse job * Add a TODO comment for removing PulseDefaults * fix typo * black reformat * Add release note. * Fix no else raise error * Add blank new line in release note * black formatting * fix release note missing black tick * Rename FakeProviderV2 to FakeProviderForBackendV2 * Re-export FakeProviderForBackendV2 to qiskit.providers.fake_provider * black reformatting Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add backend converter script from Matthew Co-Authored-By: Matthew Treinish <mtreinish@kortar.org> * FakeBackendV2, FakeQasmBeckendV2, FakeJakartaV2 in progress * Temporary fix for circular import * First try of implementing FakeJakartaV2 based on FakeQasmBackendV2/FakeBackendV2 * Implement FakeQasmBackend methods into FakeBackendV2 * Implement FakePulseBackend methods into FakeBackendV2 * Import missing PulseDefaults and adjust _get_conf_from_json method position * Adjust _get_config_from_dict method position * Fix target property Need to take closer look at _convert_to_target method * Fix _default_options method * Add FakeProviderV2 for V2 fake backends * Remove FakeQasmBackendV2 class * Copy run method from FakeBackendV1 * change configuration to self._configuration * Update backend_converter.py Based on the latest version on Qiskit/qiskit-ibm-runtime#102 Co-Authored-By: Rathish Cholarajan <rathishc24@gmail.com> * @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target * Add dtm * Add qubit properties * Add drive, measure and acquire channels. * Fix test_fake_backends * Fix ConfigurableFakeBackend circular import problem * Fix configurable_backend circular import problem * FakeAlmadenV2 * FakeArmonkV2 * FakeAthensV2 * FakeBelemV2 * FakeBoeblingenV2 * Add fake backends (except rueschlikon, tenerife and tokyo) * import fake v2 backends in __init__.py * add fake backends to mock.backend.__init__ and fake provider * Fix typos * Add defs files to manila, poughkeepsie, rome and santiago * Fix FakeCambridgeV2 * Add Hanoi and Kolkata to FakeProviderV2 * Handle no pulse backends in V2 * Fix getting qubit properties from properties bug * Fix _parse_inst_map for BackendV2 with no pulse support * Revert "Update backend_converter.py" This reverts commit 2438935d218bf3e1059bef185d77c426cc0978d3. * Revert " @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target" This reverts commit eec4a49f590399c15a90c4579844009cc9d0dc20. * Use dicts instead of conf, props, defs objects * remove channels * add type hints * Use dict.get instead of brackets * clean up backend_converter.py * construct target using defs files if it exist * Fix typo in target.acquire_alignment * Handle BackendV2 in transpiler._parse_inst_map * Comment out backends in fake provider and Aer run method for testing * undo typo fix for target.acquire_alignment * Revert "Comment out backends in fake provider and Aer run method for testing" This reverts commit 2127b345b63e9dea1bbdbd44b397f1d14089213b. * Copy NoiseModel.from_backend() method from Aer * modify NoiseModel.from_backend method to support V2 backend * Build V2 backend noise model from self._props_dict * black reformatting * Move V2 backend code to above V1 and Legacy * Clean up FakeBackendV2 for testing * Order FakeBackendV2 to match BackendV2 * Uncomment out fake backends from fake provider v1 and fake legacy provider * Remove unused imports * Remove FakeTokyoV2 import * Remove warnings for missing conf, props and defs files * Remove lazy loading of target * Remove lazy loading of qubit properties * Remove deprecation warning for standard_gates option in noise model * linting for fake_backend.py * linting for backend_converter.py * fix `Redefining name 'warnings' from outer scope` error * lint: rename qubit_props_dict_from_props_dict * Raise error for pulse simulation * remove warnings flag * Move V2 to in front of V1 * revert changes in transpiler._parse_inst_map The changes are now in a separate PR: Qiskit/qiskit#7765 * remove warnings flag * fix 'no-else-raise' error * Add docstring to FakeBackendV2 * rename `kwargs` to `options` in .run method following BackendV2 * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * rearrange raising error for pulse job * Add a TODO comment for removing PulseDefaults * fix typo * black reformat * Add release note. * Fix no else raise error * Add blank new line in release note * black formatting * fix release note missing black tick * Rename FakeProviderV2 to FakeProviderForBackendV2 * Re-export FakeProviderForBackendV2 to qiskit.providers.fake_provider * black reformatting Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add backend converter script from Matthew Co-Authored-By: Matthew Treinish <mtreinish@kortar.org> * FakeBackendV2, FakeQasmBeckendV2, FakeJakartaV2 in progress * Temporary fix for circular import * First try of implementing FakeJakartaV2 based on FakeQasmBackendV2/FakeBackendV2 * Implement FakeQasmBackend methods into FakeBackendV2 * Implement FakePulseBackend methods into FakeBackendV2 * Import missing PulseDefaults and adjust _get_conf_from_json method position * Adjust _get_config_from_dict method position * Fix target property Need to take closer look at _convert_to_target method * Fix _default_options method * Add FakeProviderV2 for V2 fake backends * Remove FakeQasmBackendV2 class * Copy run method from FakeBackendV1 * change configuration to self._configuration * Update backend_converter.py Based on the latest version on Qiskit#102 Co-Authored-By: Rathish Cholarajan <rathishc24@gmail.com> * @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target * Add dtm * Add qubit properties * Add drive, measure and acquire channels. * Fix test_fake_backends * Fix ConfigurableFakeBackend circular import problem * Fix configurable_backend circular import problem * FakeAlmadenV2 * FakeArmonkV2 * FakeAthensV2 * FakeBelemV2 * FakeBoeblingenV2 * Add fake backends (except rueschlikon, tenerife and tokyo) * import fake v2 backends in __init__.py * add fake backends to mock.backend.__init__ and fake provider * Fix typos * Add defs files to manila, poughkeepsie, rome and santiago * Fix FakeCambridgeV2 * Add Hanoi and Kolkata to FakeProviderV2 * Handle no pulse backends in V2 * Fix getting qubit properties from properties bug * Fix _parse_inst_map for BackendV2 with no pulse support * Revert "Update backend_converter.py" This reverts commit 2438935d218bf3e1059bef185d77c426cc0978d3. * Revert " @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target" This reverts commit eec4a49f590399c15a90c4579844009cc9d0dc20. * Use dicts instead of conf, props, defs objects * remove channels * add type hints * Use dict.get instead of brackets * clean up backend_converter.py * construct target using defs files if it exist * Fix typo in target.acquire_alignment * Handle BackendV2 in transpiler._parse_inst_map * Comment out backends in fake provider and Aer run method for testing * undo typo fix for target.acquire_alignment * Revert "Comment out backends in fake provider and Aer run method for testing" This reverts commit 2127b345b63e9dea1bbdbd44b397f1d14089213b. * Copy NoiseModel.from_backend() method from Aer * modify NoiseModel.from_backend method to support V2 backend * Build V2 backend noise model from self._props_dict * black reformatting * Move V2 backend code to above V1 and Legacy * Clean up FakeBackendV2 for testing * Order FakeBackendV2 to match BackendV2 * Uncomment out fake backends from fake provider v1 and fake legacy provider * Remove unused imports * Remove FakeTokyoV2 import * Remove warnings for missing conf, props and defs files * Remove lazy loading of target * Remove lazy loading of qubit properties * Remove deprecation warning for standard_gates option in noise model * linting for fake_backend.py * linting for backend_converter.py * fix `Redefining name 'warnings' from outer scope` error * lint: rename qubit_props_dict_from_props_dict * Raise error for pulse simulation * remove warnings flag * Move V2 to in front of V1 * revert changes in transpiler._parse_inst_map The changes are now in a separate PR: Qiskit/qiskit#7765 * remove warnings flag * fix 'no-else-raise' error * Add docstring to FakeBackendV2 * rename `kwargs` to `options` in .run method following BackendV2 * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * rearrange raising error for pulse job * Add a TODO comment for removing PulseDefaults * fix typo * black reformat * Add release note. * Fix no else raise error * Add blank new line in release note * black formatting * fix release note missing black tick * Rename FakeProviderV2 to FakeProviderForBackendV2 * Re-export FakeProviderForBackendV2 to qiskit.providers.fake_provider * black reformatting Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add backend converter script from Matthew Co-Authored-By: Matthew Treinish <mtreinish@kortar.org> * FakeBackendV2, FakeQasmBeckendV2, FakeJakartaV2 in progress * Temporary fix for circular import * First try of implementing FakeJakartaV2 based on FakeQasmBackendV2/FakeBackendV2 * Implement FakeQasmBackend methods into FakeBackendV2 * Implement FakePulseBackend methods into FakeBackendV2 * Import missing PulseDefaults and adjust _get_conf_from_json method position * Adjust _get_config_from_dict method position * Fix target property Need to take closer look at _convert_to_target method * Fix _default_options method * Add FakeProviderV2 for V2 fake backends * Remove FakeQasmBackendV2 class * Copy run method from FakeBackendV1 * change configuration to self._configuration * Update backend_converter.py Based on the latest version on Qiskit/qiskit-ibm-runtime#102 Co-Authored-By: Rathish Cholarajan <rathishc24@gmail.com> * @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target * Add dtm * Add qubit properties * Add drive, measure and acquire channels. * Fix test_fake_backends * Fix ConfigurableFakeBackend circular import problem * Fix configurable_backend circular import problem * FakeAlmadenV2 * FakeArmonkV2 * FakeAthensV2 * FakeBelemV2 * FakeBoeblingenV2 * Add fake backends (except rueschlikon, tenerife and tokyo) * import fake v2 backends in __init__.py * add fake backends to mock.backend.__init__ and fake provider * Fix typos * Add defs files to manila, poughkeepsie, rome and santiago * Fix FakeCambridgeV2 * Add Hanoi and Kolkata to FakeProviderV2 * Handle no pulse backends in V2 * Fix getting qubit properties from properties bug * Fix _parse_inst_map for BackendV2 with no pulse support * Revert "Update backend_converter.py" This reverts commit 2438935. * Revert " @rathishcholarajan Use BackendConfiguration, BackendProperties and PulseDefaults classes for convert_to_target" This reverts commit eec4a49. * Use dicts instead of conf, props, defs objects * remove channels * add type hints * Use dict.get instead of brackets * clean up backend_converter.py * construct target using defs files if it exist * Fix typo in target.acquire_alignment * Handle BackendV2 in transpiler._parse_inst_map * Comment out backends in fake provider and Aer run method for testing * undo typo fix for target.acquire_alignment * Revert "Comment out backends in fake provider and Aer run method for testing" This reverts commit 2127b34. * Copy NoiseModel.from_backend() method from Aer * modify NoiseModel.from_backend method to support V2 backend * Build V2 backend noise model from self._props_dict * black reformatting * Move V2 backend code to above V1 and Legacy * Clean up FakeBackendV2 for testing * Order FakeBackendV2 to match BackendV2 * Uncomment out fake backends from fake provider v1 and fake legacy provider * Remove unused imports * Remove FakeTokyoV2 import * Remove warnings for missing conf, props and defs files * Remove lazy loading of target * Remove lazy loading of qubit properties * Remove deprecation warning for standard_gates option in noise model * linting for fake_backend.py * linting for backend_converter.py * fix `Redefining name 'warnings' from outer scope` error * lint: rename qubit_props_dict_from_props_dict * Raise error for pulse simulation * remove warnings flag * Move V2 to in front of V1 * revert changes in transpiler._parse_inst_map The changes are now in a separate PR: Qiskit#7765 * remove warnings flag * fix 'no-else-raise' error * Add docstring to FakeBackendV2 * rename `kwargs` to `options` in .run method following BackendV2 * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Update qiskit/test/mock/fake_backend.py Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * rearrange raising error for pulse job * Add a TODO comment for removing PulseDefaults * fix typo * black reformat * Add release note. * Fix no else raise error * Add blank new line in release note * black formatting * fix release note missing black tick * Rename FakeProviderV2 to FakeProviderForBackendV2 * Re-export FakeProviderForBackendV2 to qiskit.providers.fake_provider * black reformatting Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
Add support for BackendV2
Details and comments
Fixes #73