PennyLaneAI / qml

Introductions to key concepts in quantum programming, as well as tutorials and implementations from cutting-edge quantum computing research.
https://pennylane.ai/qml
Apache License 2.0
527 stars 185 forks source link

Adv qml demo #1169

Open mwendlinger opened 1 month ago

mwendlinger commented 1 month ago

Title: Adversarial Attacks on Quantum Machine Learning

Summary: Tutorial on attacks and defenses in Quantum machine learning with hands-on example.

Relevant references: 'A comparative analysis of adversarial robustness for quantum and classical machine learning' by M.Wendlinger, K.Tscharke, P.Debus

Possible Drawbacks:

Related GitHub Issues:


If you are writing a demonstration, please answer these questions to facilitate the marketing process.

Show a PL implementation of a recent paper, introduce emerging topic of quantum adversarial machine learning

Everyone interested in Quantum machine learning, especially those with focus on security

Quantum machine learning, adversarial attacks, QAML, ..

@ikurecic

ikurecic commented 1 month ago

Also, for internal tracking: [sc-65330] I'll assign you a technical reviewer soon, thanks!

mwendlinger commented 1 month ago

I am currently using a local .h5 file (which obviously doesn't work as it is not present in the pennylane dir structure), should I include this in the _static/ folder to load the data for the classifier in the tutorial? is there some folder which is more suitable? once the data is hosted on the pennylane datasets this issue resolves itself

DSGuala commented 1 month ago

I am currently using a local .h5 file (which obviously doesn't work as it is not present in the pennylane dir structure), should I include this in the _static/ folder to load the data for the classifier in the tutorial? is there some folder which is more suitable? once the data is hosted on the pennylane datasets this issue resolves itself

Great point! Yup, let's add the dataset in the _static folder and access it with qml.data.Dataset.open This way we can preview what the final demo will look like. We'll consider merging this PR to be blocked until we upload the dataset. Once the dataset is uploaded, we can update this PR and merge it.

ikurecic commented 1 month ago

I am currently using a local .h5 file (which obviously doesn't work as it is not present in the pennylane dir structure), should I include this in the _static/ folder to load the data for the classifier in the tutorial? is there some folder which is more suitable? once the data is hosted on the pennylane datasets this issue resolves itself

Great point! Yup, let's add the dataset in the _static folder and access it with qml.data.Dataset.open This way we can preview what the final demo will look like. We'll consider merging this PR to be blocked until we upload the dataset. Once the dataset is uploaded, we can update this PR and merge it.

Hi @mwendlinger , I'm not sure if you saw Diego's response from last week, so I'm tagging you here. ☺

mwendlinger commented 1 month ago

I am currently using a local .h5 file (which obviously doesn't work as it is not present in the pennylane dir structure), should I include this in the _static/ folder to load the data for the classifier in the tutorial? is there some folder which is more suitable? once the data is hosted on the pennylane datasets this issue resolves itself

Great point! Yup, let's add the dataset in the _static folder and access it with qml.data.Dataset.open This way we can preview what the final demo will look like. We'll consider merging this PR to be blocked until we upload the dataset. Once the dataset is uploaded, we can update this PR and merge it.

Hi @mwendlinger , I'm not sure if you saw Diego's response from last week, so I'm tagging you here. ☺

Yes, that totally makes sense, I already added the dataset file into the directory per my last commit, so for testing purposes, this should work 😄

github-actions[bot] commented 1 month ago

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.

mwendlinger commented 1 month ago

now that the preview of the demo is available, there are some ideas/ questions:

DSGuala commented 1 month ago
  • can we adjust the order of the authors

Looking into this!

  • what is a suitable alternative for the latex blocks that are not rendered correctly? should I include images of the equations?

We should be able to get this to display correctly. I'll leave suggestions in comments, but I think :math: and .. math:: directives should help here.

  • I guess there is some trouble parsing the last About the authors section as some code is displayed in the demo. How can I fix this?

We can try simply removing this and the authors should render correctly based on the .metadata.json file

DSGuala commented 1 month ago

can we adjust the order of the authors

There is an update in progress that changes how the author metadata is handled. As soon as it's merged (1-2 weeks), the authors should be displayed in the same order as the .metadata.json file and be in the correct order :+1:

mwendlinger commented 1 month ago

perfect, thank you!

mwendlinger commented 3 weeks ago

thank you very much for the review, these are great points! I modified the demo file; now the references, math blocks and links should work. I also included the docstring and a short comment on PGD. I will re-iterate over the file in the next days but it seems quite nice so far 😄

mwendlinger commented 2 days ago

Hi @ikurecic, I modified the demo and included your suggestions, thanks for the feedback! If there is anything missing, feel free t ping me (as far as I can see, the only two things left are the demo date and the dataset loading - if we want to change this to the actual dataset hub).