quantum icon indicating copy to clipboard operation
quantum copied to clipboard

TF Quantum Starter Example

Open Rishit-dagli opened this issue 5 years ago • 6 comments

Add a TF Quantum example for beginners to get started with TF Quantum. The notebook demonstrates the following pretty simple operations-

  • Placing a Qubit
  • Working with simple quantum data
  • Building a quantum circuit
  • Creating and training a hybrid model
  • Inferencing the hybrid model

I am aware that the tutorial hello_many_worlds exists which is a beginner tutorial however, this tutorial has different aims.

This PR was originally created on tensorflow/examples#244 ported to this repo as suggested by @lamberta .

Rishit-dagli avatar Sep 19 '20 15:09 Rishit-dagli

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

So most of this code looks to be copied from our already existing notebook at https://github.com/tensorflow/quantum/blob/research/binary_classifier/binary_classifier.ipynb I see that, relative to the existing notebook, you simplified the quantum data input to have just two entries. Perhaps if there is interest in the existing notebook becoming a tutorial we could consider such a simplification. @MichaelBroughton thoughts on this? (see also page 9 of the TFQ paper)

zaqqwerty avatar Sep 20 '20 16:09 zaqqwerty

So most of this code looks to be copied from our already existing notebook at https://github.com/tensorflow/quantum/blob/research/binary_classifier/binary_classifier.ipynb I see that, relative to the existing notebook, you simplified the quantum data input to have just two entries. Perhaps if there is interest in the existing notebook becoming a tutorial we could consider such a simplification. @MichaelBroughton thoughts on this? (see also page 9 of the TFQ paper)

That's right, this is inspired from that notebook, I built this as a simplification to the existing one, to make it a lot easier for beginners to understand.

Rishit-dagli avatar Sep 20 '20 17:09 Rishit-dagli

I think we might be able to fit this in as a tutorial, right after the hello many worlds and before the MNIST classification tutorial. The goal of our tutorials is to showcase the functionality and features of the library so that experts have an easy time making the mental connections between how TFQ functions and QC theory (which we generally expect people to have a strong grasp of).

Even though this is a more "beginner" example and doesn't touch any new library code that hello many worlds doesn't already touch, I think showcasing good visualizations of the single qubit rotation problem might give experts a little more opportunity to connect with and understand how TFQ works. (I think ultimately this means moving that particular example out of research and into tutorials @zaqqwerty )

@lamberta Are you alright if I give this a review and then hand off to you for final say ?

MichaelBroughton avatar Sep 21 '20 20:09 MichaelBroughton

Thanks, @MichaelBroughton I agree. A beginner's tutorial is good, but need to be mindful of the TFQ audience: beginning researchers (and not beginning practitioners). Seems better to port https://github.com/tensorflow/quantum/blob/research/binary_classifier/binary_classifier.ipynb with the sections added here, but with added explanation.

lamberta avatar Oct 02 '20 21:10 lamberta

Thanks, @MichaelBroughton These points make sense and I will start working on them.

  1. I am just a bit unclear about adding descriptions, I can most certainly have a description to address the questions you mentioned in the comment but would anything more be required to make this more clear?
  2. This makes sense, I will definitely showcase some more math and make sure I firm up understanding for them.

Thanks, @lamberta

A beginner's tutorial is good, but need to be mindful of the TFQ audience: beginning researchers (and not beginning practitioners)

This is something I need to be mindful of while making changes and maybe could change the tone of the tutorial since this tutorial was originally made for a talk I gave at a TensorFlow User Group where some folks were practitioners and was made to help them out too.

Rishit-dagli avatar Nov 04 '20 06:11 Rishit-dagli