Skip to content

Feat - Pegasos Quantum Kernel Alignment - #1069

Open
JohnKerf wants to merge 6 commits into
qiskit-community:mainfrom
stfc:feat-pegasos-trainable-qk
Open

Feat - Pegasos Quantum Kernel Alignment#1069
JohnKerf wants to merge 6 commits into
qiskit-community:mainfrom
stfc:feat-pegasos-trainable-qk

Conversation

@JohnKerf

@JohnKerf JohnKerf commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Details and comments

  • The majority of the PegasosQKA code follows from https://zenodo.org/records/7804477 but has been stripped back to make the implementation more streamlined.

  • Decided not to include the self._blasphemy logic (computing kernel without historical thetas) as this is not how the algorithm is intended to be ran.

  • Decided at this time not to include a callback however this could be a possible future feature.

  • Precomputed kernel functionality is not needed for QKA since by design we change the kernel throught the algorithm.

  • Decided warm starting and calibration/recalibration is not needed. It seems calibration was not used in the paper and adds a lot of extra bloat to the algorithm so I thought it was best to not include it (learning_rate and perturbations are passed as fixed variables).

  • To be able to cleanly inherit PegasosQSVC I extracted the step update logic into its own function _update_step and also the kernel evaulation logic into _evaluate_kernel. This meant we can cleanly overide these in the PegasosQKA class and reuse the bulk of the QSVC algorithm.

  • Previously the trainable kernels did not have the option to set seperate paramters for the left and right feature maps. The paper logic introduced a new pseudo kernel but to avoid adding this I have introduced the ability to run and evaluate the trainable kernels with the seperate left and right parameters.

AI Disclosure - *ChatGPT was used in this work primarily to help with producing tests and also helped me better understand the PegasosQSVC/PegasosQKA algorithms. The main body of code already existed from the paper source code and all implementation/checks were done by myself. I fully understand the code I have produced but I will note that during the process ChatGPT did help verify/clarify some of the logic I was imlpementing. *

@JohnKerf JohnKerf changed the title Feat pegasos trainable qk Feat - Pegasos Quantum Kernel Alignment Sep 3, 2026
@JohnKerf
JohnKerf marked this pull request as ready for review September 3, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant