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

Added max_circuits_per_job and removed deepcopy dependency of the quantum kernel trainer fixing #701 and #600 #772

Merged
merged 15 commits into from
Feb 29, 2024

Conversation

OkuyanBoga
Copy link
Collaborator

Summary

Bug fixes have been made to fix issues #701 and #600.
Changes made:
#701: Added a max_circuits_per_job parameter to fidelity quantum kernel used in the case that if more circuits are submitted than the job limit for the backend, the circuits are split up and ran through separate jobs. Documentation was added and formatted for this.
#600: Removed quantum kernel trainers dependency on copy.deepcopy that was throwing an error with real backends. Now initialise a new instance of a class and assign parameters manually. As change is purely internal, no new documentation required.

Details and comments

All relevant unit tests were run on code.

✅ I have updated the documentation accordingly.
✅ I have read the CONTRIBUTING document.
✅ I have added notes to the CHANGELOG.

@CLAassistant
Copy link

CLAassistant commented Feb 21, 2024

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

coveralls commented Feb 21, 2024

Pull Request Test Coverage Report for Build 8062887234

Details

  • 0 of 19 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 92.607%

Totals Coverage Status
Change from base Build 8008433818: 0.04%
Covered Lines: 1879
Relevant Lines: 2029

💛 - Coveralls

Copy link
Collaborator

@adekusar-drl adekusar-drl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add unit tests to cover new features

@woodsp-ibm
Copy link
Member

As I stated here #701 (comment) the primitive ought to be taking care of this as far as I know. I will check, there has been a change where the circuit now has to be an ISA circuit (already conforms to backend in terms of layout and basis gates) instead of allowing logical circuits. So given such knowledge perhaps the limit is expected to be managed too now.

@woodsp-ibm
Copy link
Member

Also it only needs one release note that lists two fixes. The issues part is for if the release contains known issues that the user should be aware of and workaround - in this case you are fixing issues/bugs so it just needs a fixes section and both can be be specified in the one release note.

@woodsp-ibm
Copy link
Member

woodsp-ibm commented Feb 21, 2024

BTW - you can reference the issues in a way that will close them when this PR is merged. So for instance had you written fixes #701 that would cause that issue to be linked and closed when this PR was merged - the earlier link has the set of keywords that can be used and more info.

@OkuyanBoga
Copy link
Collaborator Author

  • As I stated here #701 (comment) the primitive ought to be taking care of this as far as I know. I will check, there has been a change where the circuit now has to be an ISA circuit (already conforms to backend in terms of layout and basis gates) instead of allowing logical circuits. So given such knowledge perhaps the limit is expected to be managed too now.

The number of max circuits per job needs to be set in the quantum fidelity kernel for the Max circuits hard limit on the hardware, which I believe would be useful for everyone. I reckon the extended sessions will allow users to continue their jobs to solve the latter issue.

  • Also it only needs one release note that lists two fixes. The issues part is for if the release contains known issues that the user should be aware of and workaround - in this case you are fixing issues/bugs so it just needs a fixes section and both can be be specified in the one release note.

Sorted, I hope it is better now.

  • You should add unit tests to cover new features

Added new unit tests to cover them.

@woodsp-ibm woodsp-ibm added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Feb 21, 2024
@woodsp-ibm
Copy link
Member

I added stable backport potential The bug might be minimal and/or import enough to be port to stable label which will cause the mergify bot to do a PR to backport this to the stable branch. This would be done for critical fixes we would want in bug fix release and these seem like such fixes to have ready there for whenever a bug fix release is done.

@OkuyanBoga OkuyanBoga closed this Feb 21, 2024
@OkuyanBoga OkuyanBoga deleted the sprint-merge-v1 branch February 21, 2024 20:50
@OkuyanBoga OkuyanBoga restored the sprint-merge-v1 branch February 21, 2024 20:50
@OkuyanBoga
Copy link
Collaborator Author

I made the requested changes.

@OkuyanBoga OkuyanBoga reopened this Feb 21, 2024
Copy link
Collaborator

@adekusar-drl adekusar-drl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a problem with creating a new instance. In my understanding such an instance may be quite different from the original one.

@OkuyanBoga OkuyanBoga changed the title Fix #701 max_circuits_per_job and #600 deepcopy dependency. Added max_circuits_per_job and removed deepcopy dependency of the quantum kernel trainer fixing #701 and #600 Feb 27, 2024
@declanmillar declanmillar self-requested a review February 29, 2024 15:06
Copy link
Collaborator

@adekusar-drl adekusar-drl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you.

@OkuyanBoga OkuyanBoga merged commit 2f49e9e into qiskit-community:main Feb 29, 2024
16 checks passed
Copy link
Collaborator

@edoaltamura edoaltamura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Green light from me too.

mergify bot pushed a commit that referenced this pull request Feb 29, 2024
…ntum kernel trainer fixing #701 and #600 (#772)

* Added an option for num_circuits per job for kernels to fix #701

* Updated documentation and format the style.

* Removed deepcopy dependency in quantum_kernel_trainer.py

* Added release notes

* quick fix for spell test

* Added unit tests for max_circuits_per_job

* Update fix-701-max_circuits_per_job-and-600-deepcopy-dependency-e6eda2e5b986c1be.yaml

Small release note bugfix

* Update fix-701-max_circuits_per_job-and-600-deepcopy-dependency-e6eda2e5b986c1be.yaml

* Minor modifications for the unit test

* Removed copy of TrainableKernel

---------

Co-authored-by: oscar-wallis <[email protected]>
(cherry picked from commit 2f49e9e)
adekusar-drl pushed a commit that referenced this pull request Feb 29, 2024
…ntum kernel trainer fixing #701 and #600 (#772) (#780)

* Added an option for num_circuits per job for kernels to fix #701

* Updated documentation and format the style.

* Removed deepcopy dependency in quantum_kernel_trainer.py

* Added release notes

* quick fix for spell test

* Added unit tests for max_circuits_per_job

* Update fix-701-max_circuits_per_job-and-600-deepcopy-dependency-e6eda2e5b986c1be.yaml

Small release note bugfix

* Update fix-701-max_circuits_per_job-and-600-deepcopy-dependency-e6eda2e5b986c1be.yaml

* Minor modifications for the unit test

* Removed copy of TrainableKernel

---------

Co-authored-by: oscar-wallis <[email protected]>
(cherry picked from commit 2f49e9e)

Co-authored-by: M. Emre Sahin <[email protected]>
@OkuyanBoga OkuyanBoga deleted the sprint-merge-v1 branch March 18, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants