Skip to content
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 fake generic and modify tests (backport #10266) #11670

Merged
merged 5 commits into from
Jan 30, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 29, 2024

This is an automatic backport of pull request #10266 done by Mergify.
Cherry-pick of b4582a9 has failed:

On branch mergify/bp/stable/0.46/pr-10266
Your branch is up to date with 'origin/stable/0.46'.

You are currently cherry-picking commit b4582a970.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   qiskit/providers/fake_provider/generic_backend_v2.py
	new file:   releasenotes/notes/add-generic-fake-backend-c1434e0c5c413935.yaml
	new file:   test/python/providers/fake_provider/test_fake_generic.py
	modified:   test/python/pulse/test_macros.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   qiskit/providers/fake_provider/__init__.py
	both modified:   test/python/compiler/test_transpiler.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

* 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 <[email protected]>

* Update qiskit/providers/fake_provider/fake_generic.py

Co-authored-by: atharva-satpute <[email protected]>

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

Co-authored-by: atharva-satpute <[email protected]>

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

Co-authored-by: atharva-satpute <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Matthew Treinish <[email protected]>
Co-authored-by: Kevin Hartman <[email protected]>
(cherry picked from commit b4582a9)

# Conflicts:
#	qiskit/providers/fake_provider/__init__.py
#	test/python/compiler/test_transpiler.py
@mergify mergify bot added the conflicts used by mergify when there are conflicts in a port label Jan 29, 2024
@mergify mergify bot requested review from eggerdj, wshanks, a team and jyu00 as code owners January 29, 2024 22:28
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core
  • @nkanazawa1989

@github-actions github-actions bot added Changelog: New Feature Include in the "Added" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo labels Jan 29, 2024
@github-actions github-actions bot added this to the 1.0.0 milestone Jan 29, 2024
@ElePT ElePT removed the conflicts used by mergify when there are conflicts in a port label Jan 29, 2024
ElePT
ElePT previously approved these changes Jan 29, 2024
@ElePT ElePT enabled auto-merge January 29, 2024 22:41
@coveralls
Copy link

coveralls commented Jan 29, 2024

Pull Request Test Coverage Report for Build 7711917950

  • -37 of 196 (81.12%) changed or added relevant lines in 2 files are covered.
  • 26 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.03%) to 86.916%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/providers/fake_provider/generic_backend_v2.py 158 195 81.03%
Files with Coverage Reduction New Missed Lines %
qiskit/circuit/tools/pi_check.py 1 91.15%
qiskit/transpiler/passes/scheduling/alignments/check_durations.py 3 60.0%
crates/qasm2/src/lex.rs 4 91.44%
crates/qasm2/src/parse.rs 18 96.69%
Totals Coverage Status
Change from base Build 7697180712: -0.03%
Covered Lines: 74909
Relevant Lines: 86186

💛 - Coveralls

ElePT
ElePT previously approved these changes Jan 30, 2024
@ElePT ElePT disabled auto-merge January 30, 2024 09:32
@ElePT ElePT added the on hold Can not fix yet label Jan 30, 2024
* Rename test, switch to basic simulator

* Fix bug in pulse default generation
@ElePT
Copy link
Contributor

ElePT commented Jan 30, 2024

Note that this PR includes a fix for a bug discovered during #10918. The bug was in the _get_calibration_sequence method. The fix on the main branch will be included in #10918. It also renames the fake generic test from test_fake_generic.py to test_generic_backend_v2.py

@ElePT ElePT added this pull request to the merge queue Jan 30, 2024
Merged via the queue into stable/0.46 with commit 3967fa7 Jan 30, 2024
14 checks passed
@mergify mergify bot deleted the mergify/bp/stable/0.46/pr-10266 branch January 30, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo on hold Can not fix yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants