Skip to content

Commit 5785425

Browse files
mtreinishkt474
andauthored
Add fake backends for newer IBM backends (#1440)
* 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 #1263. [1] https://github.com/Qiskit/qiskit/blob/stable/0.46/tools/update_fake_backends.py Fixes #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]>
1 parent e151d69 commit 5785425

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+506
-0
lines changed

qiskit_ibm_runtime/fake_provider/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,31 @@
105105
.. autosummary::
106106
:toctree: ../stubs/
107107
108+
FakeAlgiers
108109
FakeAlmadenV2
109110
FakeArmonkV2
110111
FakeAthensV2
111112
FakeAuckland
112113
FakeBelemV2
113114
FakeBoeblingenV2
114115
FakeBogotaV2
116+
FakeBrisbane
115117
FakeBrooklynV2
116118
FakeBurlingtonV2
117119
FakeCairoV2
118120
FakeCambridgeV2
119121
FakeCasablancaV2
122+
FakeCusco
120123
FakeEssexV2
121124
FakeGeneva
122125
FakeGuadalupeV2
123126
FakeHanoiV2
124127
FakeJakartaV2
125128
FakeJohannesburgV2
129+
FakeKawasaki
126130
FakeKolkataV2
131+
FakeKyiv
132+
FakeKyoto
127133
FakeLagosV2
128134
FakeLimaV2
129135
FakeLondonV2
@@ -133,12 +139,15 @@
133139
FakeMontrealV2
134140
FakeMumbaiV2
135141
FakeNairobiV2
142+
FakeOsaka
136143
FakeOslo
137144
FakeOurenseV2
138145
FakeParisV2
146+
FakePeekskill
139147
FakePerth
140148
FakePrague
141149
FakePoughkeepsieV2
150+
FakeQuebec
142151
FakeQuitoV2
143152
FakeRochesterV2
144153
FakeRomeV2
@@ -149,6 +158,7 @@
149158
FakeSydneyV2
150159
.. FakeTenerifeV2 # no v2 version
151160
.. FakeTokyoV2 # no v2 version
161+
FakeTorino
152162
FakeTorontoV2
153163
FakeValenciaV2
154164
FakeVigoV2

qiskit_ibm_runtime/fake_provider/backends/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,31 @@
1616
"""
1717

1818
# BackendV2 Backends
19+
from .algiers import FakeAlgiers
1920
from .almaden import FakeAlmadenV2
2021
from .armonk import FakeArmonkV2
2122
from .athens import FakeAthensV2
2223
from .auckland import FakeAuckland
2324
from .belem import FakeBelemV2
2425
from .boeblingen import FakeBoeblingenV2
2526
from .bogota import FakeBogotaV2
27+
from .brisbane import FakeBrisbane
2628
from .brooklyn import FakeBrooklynV2
2729
from .burlington import FakeBurlingtonV2
2830
from .cairo import FakeCairoV2
2931
from .cambridge import FakeCambridgeV2
3032
from .casablanca import FakeCasablancaV2
33+
from .cusco import FakeCusco
3134
from .essex import FakeEssexV2
3235
from .geneva import FakeGeneva
3336
from .guadalupe import FakeGuadalupeV2
3437
from .hanoi import FakeHanoiV2
3538
from .jakarta import FakeJakartaV2
3639
from .johannesburg import FakeJohannesburgV2
40+
from .kawasaki import FakeKawasaki
3741
from .kolkata import FakeKolkataV2
42+
from .kyiv import FakeKyiv
43+
from .kyoto import FakeKyoto
3844
from .lagos import FakeLagosV2
3945
from .lima import FakeLimaV2
4046
from .london import FakeLondonV2
@@ -44,19 +50,23 @@
4450
from .montreal import FakeMontrealV2
4551
from .mumbai import FakeMumbaiV2
4652
from .nairobi import FakeNairobiV2
53+
from .osaka import FakeOsaka
4754
from .oslo import FakeOslo
4855
from .ourense import FakeOurenseV2
4956
from .paris import FakeParisV2
57+
from .peekskill import FakePeekskill
5058
from .perth import FakePerth
5159
from .prague import FakePrague
5260
from .poughkeepsie import FakePoughkeepsieV2
61+
from .quebec import FakeQuebec
5362
from .quito import FakeQuitoV2
5463
from .rochester import FakeRochesterV2
5564
from .rome import FakeRomeV2
5665
from .santiago import FakeSantiagoV2
5766
from .sherbrooke import FakeSherbrooke
5867
from .singapore import FakeSingaporeV2
5968
from .sydney import FakeSydneyV2
69+
from .torino import FakeTorino
6070
from .toronto import FakeTorontoV2
6171
from .valencia import FakeValenciaV2
6272
from .vigo import FakeVigoV2
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2019, 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""Mock algiers backend"""
14+
15+
from .fake_algiers import FakeAlgiers

qiskit_ibm_runtime/fake_provider/backends/algiers/conf_algiers.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

qiskit_ibm_runtime/fake_provider/backends/algiers/defs_algiers.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2021, 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Algiers device (27 qubit).
15+
"""
16+
17+
import os
18+
from qiskit_ibm_runtime.fake_provider import fake_backend
19+
20+
21+
class FakeAlgiers(fake_backend.FakeBackendV2):
22+
"""A fake 27 qubit backend."""
23+
24+
dirname = os.path.dirname(__file__) # type: ignore
25+
conf_filename = "conf_algiers.json" # type: ignore
26+
props_filename = "props_algiers.json" # type: ignore
27+
defs_filename = "defs_algiers.json" # type: ignore
28+
backend_name = "fake_algiers" # type: ignore

qiskit_ibm_runtime/fake_provider/backends/algiers/props_algiers.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Brisbane backend (127 qubit).
15+
"""
16+
17+
from .fake_brisbane import FakeBrisbane

qiskit_ibm_runtime/fake_provider/backends/brisbane/conf_brisbane.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

qiskit_ibm_runtime/fake_provider/backends/brisbane/defs_brisbane.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Brisbane device (127 qubit).
15+
"""
16+
17+
import os
18+
from qiskit_ibm_runtime.fake_provider import fake_backend
19+
20+
21+
class FakeBrisbane(fake_backend.FakeBackendV2):
22+
"""A fake 127 qubit backend."""
23+
24+
dirname = os.path.dirname(__file__) # type: ignore
25+
conf_filename = "conf_brisbane.json" # type: ignore
26+
props_filename = "props_brisbane.json" # type: ignore
27+
defs_filename = "defs_brisbane.json" # type: ignore
28+
backend_name = "fake_brisbane" # type: ignore

qiskit_ibm_runtime/fake_provider/backends/brisbane/props_brisbane.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Cusco backend (127 qubit).
15+
"""
16+
17+
from .fake_cusco import FakeCusco

qiskit_ibm_runtime/fake_provider/backends/cusco/conf_cusco.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

qiskit_ibm_runtime/fake_provider/backends/cusco/defs_cusco.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Cusco device (127 qubit).
15+
"""
16+
17+
import os
18+
from qiskit_ibm_runtime.fake_provider import fake_backend
19+
20+
21+
class FakeCusco(fake_backend.FakeBackendV2):
22+
"""A fake 127 qubit backend."""
23+
24+
dirname = os.path.dirname(__file__) # type: ignore
25+
conf_filename = "conf_cusco.json" # type: ignore
26+
props_filename = "props_cusco.json" # type: ignore
27+
defs_filename = "defs_cusco.json" # type: ignore
28+
backend_name = "fake_cusco" # type: ignore

qiskit_ibm_runtime/fake_provider/backends/cusco/props_cusco.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Kawasaki backend (127 qubit).
15+
"""
16+
17+
from .fake_kawasaki import FakeKawasaki

qiskit_ibm_runtime/fake_provider/backends/kawasaki/conf_kawasaki.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

qiskit_ibm_runtime/fake_provider/backends/kawasaki/defs_kawasaki.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Kawasaki device (127 qubit).
15+
"""
16+
17+
import os
18+
from qiskit_ibm_runtime.fake_provider import fake_backend
19+
20+
21+
class FakeKawasaki(fake_backend.FakeBackendV2):
22+
"""A fake 127 qubit backend."""
23+
24+
dirname = os.path.dirname(__file__) # type: ignore
25+
conf_filename = "conf_kawasaki.json" # type: ignore
26+
props_filename = "props_kawasaki.json" # type: ignore
27+
defs_filename = "defs_kawasaki.json" # type: ignore
28+
backend_name = "fake_kawasaki" # type: ignore

qiskit_ibm_runtime/fake_provider/backends/kawasaki/props_kawasaki.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Kyiv backend (127 qubit).
15+
"""
16+
17+
from .fake_kyiv import FakeKyiv

qiskit_ibm_runtime/fake_provider/backends/kyiv/conf_kyiv.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

qiskit_ibm_runtime/fake_provider/backends/kyiv/defs_kyiv.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Kyiv device (127 qubit).
15+
"""
16+
17+
import os
18+
from qiskit_ibm_runtime.fake_provider import fake_backend
19+
20+
21+
class FakeKyiv(fake_backend.FakeBackendV2):
22+
"""A fake 127 qubit backend."""
23+
24+
dirname = os.path.dirname(__file__) # type: ignore
25+
conf_filename = "conf_kyiv.json" # type: ignore
26+
props_filename = "props_kyiv.json" # type: ignore
27+
defs_filename = "defs_kyiv.json" # type: ignore
28+
backend_name = "fake_kyiv" # type: ignore

qiskit_ibm_runtime/fake_provider/backends/kyiv/props_kyiv.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Kyoto backend (127 qubit).
15+
"""
16+
17+
from .fake_kyoto import FakeKyoto

qiskit_ibm_runtime/fake_provider/backends/kyoto/conf_kyoto.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

qiskit_ibm_runtime/fake_provider/backends/kyoto/defs_kyoto.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This code is part of Qiskit.
2+
#
3+
# (C) Copyright IBM 2023.
4+
#
5+
# This code is licensed under the Apache License, Version 2.0. You may
6+
# obtain a copy of this license in the LICENSE.txt file in the root directory
7+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# Any modifications or derivative works of this code must retain this
10+
# copyright notice, and modified files need to carry a notice indicating
11+
# that they have been altered from the originals.
12+
13+
"""
14+
Fake Kyoto device (127 qubit).
15+
"""
16+
17+
import os
18+
from qiskit_ibm_runtime.fake_provider import fake_backend
19+
20+
21+
class FakeKyoto(fake_backend.FakeBackendV2):
22+
"""A fake 127 qubit backend."""
23+
24+
dirname = os.path.dirname(__file__) # type: ignore
25+
conf_filename = "conf_kyoto.json" # type: ignore
26+
props_filename = "props_kyoto.json" # type: ignore
27+
defs_filename = "defs_kyoto.json" # type: ignore
28+
backend_name = "fake_kyoto" # type: ignore

qiskit_ibm_runtime/fake_provider/backends/kyoto/props_kyoto.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)