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

New tutorial: quantum edge detection #2711

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

Conversation

marwafar
Copy link
Collaborator

@marwafar marwafar commented Mar 7, 2025

this is a new tutorial that explains how to implement QPIE, FRQI, QHED algorithm in cudaq

Signed-off-by: marwafar <[email protected]>
Copy link

copy-pr-bot bot commented Mar 7, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@sacpis
Copy link
Collaborator

sacpis commented Mar 8, 2025

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Mar 8, 2025

/ok to test

Command Bot: Processing...

Signed-off-by: Sachin Pisal <[email protected]>
@sacpis
Copy link
Collaborator

sacpis commented Mar 9, 2025

/ok to test

Command Bot: Processing...

github-actions bot pushed a commit that referenced this pull request Mar 10, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

@sacpis
Copy link
Collaborator

sacpis commented Mar 10, 2025

/ok to test

Command Bot: Processing...

Signed-off-by: Sachin Pisal <[email protected]>
@sacpis
Copy link
Collaborator

sacpis commented Mar 10, 2025

/ok to test

Command Bot: Processing...

"\n",
"Each pixel will have its own color intensity represented along with its position label as an 8-bit black and white color. To convert the pixel intensity to probability amplitudes of a quantum state\n",
"\n",
"$$ c_i = \\frac{I_{yx}}{\\sqrt(\\sum I^2_{yx})} $$\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

renders incorrectly in docs preview:
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Locally it renders correctly. Let me retest it here. Will build it with other requested changes.

image

"\n",
"$$ \\ket{img} = c_0 \\ket{00} + c_1 \\ket{01} + c_2 \\ket{10} + c_3 \\ket{11}$$\n",
"\n",
"Below, is how to encode an image using QPIE in cudaq.\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would add a space line before this sentence, for viewability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I increase size of this sentence to highlight it.

"\n",
"# Horizontal: Original image\n",
"image_norm_h = amplitude_encode(image)\n",
"print(image_norm_h.shape)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't show in the output

Copy link
Collaborator

Choose a reason for hiding this comment

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

Shows locally. Will check again after the new build.

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also see it locally

"\n",
"# Vertical: Transpose of Original image\n",
"image_norm_v = amplitude_encode(image.T)\n",
"print(image_norm_v.shape)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't show in the output
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see (64,) which I think is the correct image_norm_v.shape?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. I also see result in my jupyter notebook

}
],
"source": [
"faltten_image=image.flatten()\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this code be in a function, similar to amplitude_encoding that gets the image data as a parameter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Sachin Pisal <[email protected]>
@sacpis
Copy link
Collaborator

sacpis commented Mar 11, 2025

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Mar 12, 2025
@sacpis
Copy link
Collaborator

sacpis commented Mar 12, 2025

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Mar 12, 2025
github-actions bot pushed a commit that referenced this pull request Mar 12, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Signed-off-by: marwafar <[email protected]>
@sacpis
Copy link
Collaborator

sacpis commented Mar 12, 2025

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Mar 12, 2025
@sacpis
Copy link
Collaborator

sacpis commented Mar 13, 2025

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Mar 13, 2025

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Mar 14, 2025

LGTM. @efratshabtai Should we check-in this PR?

@sacpis
Copy link
Collaborator

sacpis commented Mar 16, 2025

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Mar 17, 2025
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.

3 participants