Skip to content

Commit

Permalink
Add fake backends for newer IBM backends (Qiskit#1440)
Browse files Browse the repository at this point in the history
* Add fake backends for newer IBM backends

This commit adds news fake backend classes for the following newer IBM
backends: Algiers, Brisbane, Cusco, Kawasaki, Kyoto, Osaka, Peekskill, Quebec,
and Torino. This was done using a modified version of the qiskit script
to update backends [1] (to use qiskit-ibm-runtime instead of
qiskit-ibmq-provider). There is a standalone script adding this
functionality for this repo in Qiskit#1263.

[1] https://github.com/Qiskit/qiskit/blob/stable/0.46/tools/update_fake_backends.py

Fixes Qiskit#1421

* Remove unused import

* Add new backends to FakeProviderForBackendV2 too

* Don't forget FakeKyiv in docs or provider class

---------

Co-authored-by: Kevin Tian <[email protected]>
  • Loading branch information
mtreinish and kt474 authored Feb 29, 2024
1 parent e151d69 commit 5785425
Show file tree
Hide file tree
Showing 53 changed files with 506 additions and 0 deletions.
10 changes: 10 additions & 0 deletions qiskit_ibm_runtime/fake_provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,25 +105,31 @@
.. autosummary::
:toctree: ../stubs/
FakeAlgiers
FakeAlmadenV2
FakeArmonkV2
FakeAthensV2
FakeAuckland
FakeBelemV2
FakeBoeblingenV2
FakeBogotaV2
FakeBrisbane
FakeBrooklynV2
FakeBurlingtonV2
FakeCairoV2
FakeCambridgeV2
FakeCasablancaV2
FakeCusco
FakeEssexV2
FakeGeneva
FakeGuadalupeV2
FakeHanoiV2
FakeJakartaV2
FakeJohannesburgV2
FakeKawasaki
FakeKolkataV2
FakeKyiv
FakeKyoto
FakeLagosV2
FakeLimaV2
FakeLondonV2
Expand All @@ -133,12 +139,15 @@
FakeMontrealV2
FakeMumbaiV2
FakeNairobiV2
FakeOsaka
FakeOslo
FakeOurenseV2
FakeParisV2
FakePeekskill
FakePerth
FakePrague
FakePoughkeepsieV2
FakeQuebec
FakeQuitoV2
FakeRochesterV2
FakeRomeV2
Expand All @@ -149,6 +158,7 @@
FakeSydneyV2
.. FakeTenerifeV2 # no v2 version
.. FakeTokyoV2 # no v2 version
FakeTorino
FakeTorontoV2
FakeValenciaV2
FakeVigoV2
Expand Down
10 changes: 10 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,31 @@
"""

# BackendV2 Backends
from .algiers import FakeAlgiers
from .almaden import FakeAlmadenV2
from .armonk import FakeArmonkV2
from .athens import FakeAthensV2
from .auckland import FakeAuckland
from .belem import FakeBelemV2
from .boeblingen import FakeBoeblingenV2
from .bogota import FakeBogotaV2
from .brisbane import FakeBrisbane
from .brooklyn import FakeBrooklynV2
from .burlington import FakeBurlingtonV2
from .cairo import FakeCairoV2
from .cambridge import FakeCambridgeV2
from .casablanca import FakeCasablancaV2
from .cusco import FakeCusco
from .essex import FakeEssexV2
from .geneva import FakeGeneva
from .guadalupe import FakeGuadalupeV2
from .hanoi import FakeHanoiV2
from .jakarta import FakeJakartaV2
from .johannesburg import FakeJohannesburgV2
from .kawasaki import FakeKawasaki
from .kolkata import FakeKolkataV2
from .kyiv import FakeKyiv
from .kyoto import FakeKyoto
from .lagos import FakeLagosV2
from .lima import FakeLimaV2
from .london import FakeLondonV2
Expand All @@ -44,19 +50,23 @@
from .montreal import FakeMontrealV2
from .mumbai import FakeMumbaiV2
from .nairobi import FakeNairobiV2
from .osaka import FakeOsaka
from .oslo import FakeOslo
from .ourense import FakeOurenseV2
from .paris import FakeParisV2
from .peekskill import FakePeekskill
from .perth import FakePerth
from .prague import FakePrague
from .poughkeepsie import FakePoughkeepsieV2
from .quebec import FakeQuebec
from .quito import FakeQuitoV2
from .rochester import FakeRochesterV2
from .rome import FakeRomeV2
from .santiago import FakeSantiagoV2
from .sherbrooke import FakeSherbrooke
from .singapore import FakeSingaporeV2
from .sydney import FakeSydneyV2
from .torino import FakeTorino
from .toronto import FakeTorontoV2
from .valencia import FakeValenciaV2
from .vigo import FakeVigoV2
Expand Down
15 changes: 15 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/algiers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Mock algiers backend"""

from .fake_algiers import FakeAlgiers

Large diffs are not rendered by default.

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/algiers/fake_algiers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Algiers device (27 qubit).
"""

import os
from qiskit_ibm_runtime.fake_provider import fake_backend


class FakeAlgiers(fake_backend.FakeBackendV2):
"""A fake 27 qubit backend."""

dirname = os.path.dirname(__file__) # type: ignore
conf_filename = "conf_algiers.json" # type: ignore
props_filename = "props_algiers.json" # type: ignore
defs_filename = "defs_algiers.json" # type: ignore
backend_name = "fake_algiers" # type: ignore

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/brisbane/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Brisbane backend (127 qubit).
"""

from .fake_brisbane import FakeBrisbane

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Brisbane device (127 qubit).
"""

import os
from qiskit_ibm_runtime.fake_provider import fake_backend


class FakeBrisbane(fake_backend.FakeBackendV2):
"""A fake 127 qubit backend."""

dirname = os.path.dirname(__file__) # type: ignore
conf_filename = "conf_brisbane.json" # type: ignore
props_filename = "props_brisbane.json" # type: ignore
defs_filename = "defs_brisbane.json" # type: ignore
backend_name = "fake_brisbane" # type: ignore

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/cusco/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Cusco backend (127 qubit).
"""

from .fake_cusco import FakeCusco

Large diffs are not rendered by default.

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/cusco/fake_cusco.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Cusco device (127 qubit).
"""

import os
from qiskit_ibm_runtime.fake_provider import fake_backend


class FakeCusco(fake_backend.FakeBackendV2):
"""A fake 127 qubit backend."""

dirname = os.path.dirname(__file__) # type: ignore
conf_filename = "conf_cusco.json" # type: ignore
props_filename = "props_cusco.json" # type: ignore
defs_filename = "defs_cusco.json" # type: ignore
backend_name = "fake_cusco" # type: ignore

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/kawasaki/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Kawasaki backend (127 qubit).
"""

from .fake_kawasaki import FakeKawasaki

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Kawasaki device (127 qubit).
"""

import os
from qiskit_ibm_runtime.fake_provider import fake_backend


class FakeKawasaki(fake_backend.FakeBackendV2):
"""A fake 127 qubit backend."""

dirname = os.path.dirname(__file__) # type: ignore
conf_filename = "conf_kawasaki.json" # type: ignore
props_filename = "props_kawasaki.json" # type: ignore
defs_filename = "defs_kawasaki.json" # type: ignore
backend_name = "fake_kawasaki" # type: ignore

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/kyiv/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Kyiv backend (127 qubit).
"""

from .fake_kyiv import FakeKyiv

Large diffs are not rendered by default.

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/kyiv/fake_kyiv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Kyiv device (127 qubit).
"""

import os
from qiskit_ibm_runtime.fake_provider import fake_backend


class FakeKyiv(fake_backend.FakeBackendV2):
"""A fake 127 qubit backend."""

dirname = os.path.dirname(__file__) # type: ignore
conf_filename = "conf_kyiv.json" # type: ignore
props_filename = "props_kyiv.json" # type: ignore
defs_filename = "defs_kyiv.json" # type: ignore
backend_name = "fake_kyiv" # type: ignore

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/kyoto/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Kyoto backend (127 qubit).
"""

from .fake_kyoto import FakeKyoto

Large diffs are not rendered by default.

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions qiskit_ibm_runtime/fake_provider/backends/kyoto/fake_kyoto.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""
Fake Kyoto device (127 qubit).
"""

import os
from qiskit_ibm_runtime.fake_provider import fake_backend


class FakeKyoto(fake_backend.FakeBackendV2):
"""A fake 127 qubit backend."""

dirname = os.path.dirname(__file__) # type: ignore
conf_filename = "conf_kyoto.json" # type: ignore
props_filename = "props_kyoto.json" # type: ignore
defs_filename = "defs_kyoto.json" # type: ignore
backend_name = "fake_kyoto" # type: ignore

Large diffs are not rendered by default.

Loading

0 comments on commit 5785425

Please sign in to comment.