Skip to content

849 quantum vision transformer #967

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

neogyk
Copy link

@neogyk neogyk commented Apr 23, 2025

Quantum Vision Transformer. Paper Implementation

The purpose of this pr is to bring the implementation of Quantum Vision Transformer to classiq community.
The related issue is here

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@TomerGoldfriend TomerGoldfriend self-assigned this Apr 23, 2025
@@ -0,0 +1,528 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Apr 24, 2025

Choose a reason for hiding this comment

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

Thank you @neogyk for this PR. Please provide details about the code so we can review it properly:

  • Short introduction, in particular, you shall specify the paper you are implementing including a reference.
  • Explain major code blocks, what is implemented and how it is related to the algorithm.
  • This looks like a very complex hybrid neural network, please provide its diagram as a figure. I think it will make the notebook clearer.
  • Add a snapshot of the quantum part from Classiq visualization.

You can have a look at several examples in our library. It should not be identical in terms of sectioning and wording, but just to understand the rational. Here are some QML examples: https://github.com/Classiq/classiq-library/blob/main/algorithms/qml/hybrid_qnn/hybrid_qnn_for_subset_majority.ipynb, https://github.com/Classiq/classiq-library/blob/main/algorithms/qml/quantum_autoencoder/quantum_autoencoder.ipynb

https://github.com/Classiq/classiq-library/blob/main/algorithms/qml/qgan/qgan_bars_and_strips.ipynb


Reply via ReviewNB

@@ -0,0 +1,528 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Apr 24, 2025

Choose a reason for hiding this comment

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

Line #15.        def angle_embedding(input_: CArray[CReal, N_QUBITS], qbv: Output[QArray[QBit]]) -> None:

BTW, we have a similar function in our open library that you can use if you want , encode_in_angle (it uses RY instead of RX, and it is working on un-initialized variable, so you do not need to allocate)

https://github.com/Classiq/classiq-library/blob/main/functions/qmod_library_reference/classiq_open_library/variational_data_encoding/variational_data_encoding.ipynb


Reply via ReviewNB

@@ -0,0 +1,528 @@
{
Copy link
Member

@TomerGoldfriend TomerGoldfriend Apr 24, 2025

Choose a reason for hiding this comment

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

Show convergence results etc...

If running is too slow, you can train it once and in the notebook upload a pretrained weights.


Reply via ReviewNB

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.

2 participants