Skip to content

Commit

Permalink
Add fake generic and modify tests (#10266)
Browse files Browse the repository at this point in the history
* Added a FakeGeneric BackendV2 backend, this is just a bare minimum working code

* All FakeBackends (like FakeMelbourne, FakeBoeblingen ,etc) is replaced with FakeGeneric

* relocated FakeGeneric in fake_provider directory; replaced if-elif with instruction_dict in fake_generic.py; added support of grid type of coupling map; using lower number of qubits, passed all tests of test_transpiler except one method ( test_parallel_dispatch_lazy_cal_loading )

* added tests for FakeGeneric

* This commit just reformats test_transpiler.py fake_generic.py and test_fake_generic.py

* Update qiskit/providers/fake_provider/fake_generic.py

Co-authored-by: atharva-satpute <55058959+atharva-satpute@users.noreply.github.com>

* Update qiskit/providers/fake_provider/fake_generic.py

Co-authored-by: atharva-satpute <55058959+atharva-satpute@users.noreply.github.com>

* Update test/python/providers/fake_provider/test_fake_generic.py

Co-authored-by: atharva-satpute <55058959+atharva-satpute@users.noreply.github.com>

* Update test/python/providers/fake_provider/test_fake_generic.py

Co-authored-by: atharva-satpute <55058959+atharva-satpute@users.noreply.github.com>

* Fix some tests

* Add calibration schedules, fix transpiler tests

* Fix lint

* Refactor, add pulse functionality

* Latest updates to FakeGeneric

* Fix some unit tests

* Fix some unit tests

* Fix tests, lint, refactor

* Remove unused inputs

* Make calibrations optional

* Attempt to speed up test: only add calibrations if option enabled

* Revert some tests to V1

* Refactor FakeGeneric

* Update unit test

* Rename supported instructions to operations, fix tests

Fix test seed

Fix unit test, lint

* Restore vf2postlayout test to V1

Fx vf2 test

* Add pulse test to validate pulse capabilities of new fake backend

Update fake generic

* Update docs, fix lint

* Avoid set for basis gates to allow reproducibility in the error/duration value generation

* Update calibrations

* Fix transpiler test

* Add run test to confirm noise defaults

* Add CZ to basis gates, dtm, update backend names, fix docs

* Remove GenericTarget, add default for basis_gates, remove supported_operations.

* Apply review comments, modify calibrate_instructions to avoid public calibration method.

* New name proposal

* Fix lint and test

* Fix comment

* Apply Kevin's suggestions to extract defaults from class

* Make defaults private

* Fix lint

* Revert previous 3 comments.

* Privatize GenericFakeBackend

* Remove from docs

* Revert privatization

* Apply review comments

* Add reno

* Fix lint

* Apply suggestions from Matt's code review

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Apply comments from code review

* Fix lint

* Rename to GenericBackendV2 and adjust docs.

* Fix lint

* Apply comments from code review

* It's not 2023 anymore

* Fix conflict

* Fix test conflict.

---------

Co-authored-by: atharva-satpute <55058959+atharva-satpute@users.noreply.github.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Elena Peña Tapia <epenatap@gmail.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Kevin Hartman <kevin@hart.mn>
  • Loading branch information
6 people committed Jan 29, 2024
1 parent 052d889 commit b4582a9
Show file tree
Hide file tree
Showing 6 changed files with 987 additions and 128 deletions.
15 changes: 9 additions & 6 deletions qiskit/providers/fake_provider/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
# (C) Copyright IBM 2022, 2024.
#
# 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
Expand All @@ -20,10 +20,11 @@
Overview
========
The fake provider module contains fake providers and fake backends classes. The fake backends are
built to mimic the behaviors of IBM Quantum systems using system snapshots. The system snapshots
contain important information about the quantum system such as coupling map, basis gates, qubit
properties (T1, T2, error rate, etc.) which are useful for testing the transpiler and performing
The fake provider module contains fake providers, fake backends and other simulated backend
implementations. The fake backends are built to mimic the behaviors of IBM Quantum systems
using system snapshots. The system snapshots contain important information about the quantum
system such as coupling map, basis gates, qubit properties (T1, T2, error rate, etc.) which
are useful for testing the transpiler and performing
noisy simulation of the system.
Example Usage
Expand Down Expand Up @@ -210,6 +211,7 @@
FakeBackendV2
FakeBackend5QV2
FakeMumbaiFractionalCX
GenericBackendV2
Fake Backend Base Classes
=========================
Expand Down Expand Up @@ -241,10 +243,11 @@
# Standard fake backends with IBM Quantum systems snapshots
from .backends import *

# Special fake backends for special testing perpurposes
# Special fake backends for special testing purposes
from .fake_qasm_simulator import FakeQasmSimulator
from .fake_openpulse_2q import FakeOpenPulse2Q
from .fake_openpulse_3q import FakeOpenPulse3Q
from .fake_1q import Fake1Q
from .fake_backend_v2 import FakeBackendV2, FakeBackend5QV2
from .fake_mumbai_v2 import FakeMumbaiFractionalCX
from .generic_backend_v2 import GenericBackendV2

0 comments on commit b4582a9

Please sign in to comment.