qrand icon indicating copy to clipboard operation
qrand copied to clipboard

Jupyter notebook tutorial

Open pedrorrivero opened this issue 3 years ago • 8 comments

What is the nature of the issue?

New content

Describe the issue

Build an interactive and up-to-date Jupyter Notebook tutorial for QRAND v1.0.0

Which files need to be updated?

  • [new] tutorial.ipynb

What content needs to be added, updated, or replaced?

The tutorial should at least include:

  • [ ] Multiplatform examples (e.g. qiskit and cirq)
  • [ ] Several randomness generation protocols
  • [ ] Entropy validation (i.e. independent and as a protocol decorator)
  • [ ] NumPy Generator interface → Different probability distributions
  • [ ] BitCache persistence explanation
  • [ ] Multithreading caching explanation
  • [ ] QRNG capabililties (bitstring, uint, double, hex, complex)

Additional context

This has to be targeted for v1.0.0 → QiskitBitGenerator deprecated in favor of QuantumBitGenerator

pedrorrivero avatar Apr 05 '21 01:04 pedrorrivero

Hello, I had few hours ago seen that this was a part of unitaryhack. Even though it is not a part of it now, can I still try this out with Qiskit? I am new to open source and I thought this task would be something I could start of with.

gprs1809 avatar May 12 '21 04:05 gprs1809

Hi @gprs1809!

I removed this issue from #unitaryHACK because I do not think we will be able to complete a full tutorial at this stage of development. However, feel free to try. Before the start of the hackathon I will be merging the new structure of QRAND to master. If you need any guide, we can chat via discord!

I will retag it.

Thanks!

pedrorrivero avatar May 12 '21 13:05 pedrorrivero

@pedrorrivero I guess contributing to this issue will still be counted for Unitary Hack, right? 'cause it has the good first issue tag.

Avhijit-Nair avatar May 12 '21 13:05 Avhijit-Nair

Hi @gprs1809!

I removed this issue from #unitaryHACK because I do not think we will be able to complete a full tutorial at this stage of development. However, feel free to try. Before the start of the hackathon I will be merging the new structure of QRAND to master. If you need any guide, we can chat via discord!

I will retag it.

Thanks!

Sure @pedrorrivero, I will try

gprs1809 avatar May 12 '21 17:05 gprs1809

Hey @gprs1809 can we team up on this ?

anushkrishnav avatar May 14 '21 14:05 anushkrishnav

Hey @gprs1809 can we team up on this ?

Sure

gprs1809 avatar May 15 '21 01:05 gprs1809

Hey @pedrorrivero, I will continue to work on this. Thank you, for answering my question on Discord :). I have a couple of more questions: In qrng.py, there is a deprecation warning, should I still use that in the tutorial I will be creating? Also, I see that QuantumBitGenerator inherits UserBitGenerator from randomgen. I am reading about it, but are there more resources to understand it better?

gprs1809 avatar May 31 '21 01:05 gprs1809

Hi @gprs1809! Awesome! Let me get to your questions:

  1. Use the new version of Qrng better, it is located in qrand.qrngV1. I am keeping it this way since it will introduce a breaking a change and I want to have all breaking changes happen at once when we bump up to version 1.0.0
  2. Don't worry about UserBitGenerator. Randomgen is an external library that helps interfacing with NumPy. Pretty much all the functionality related to it is enclosed within the ## NUMPY INTERFACE ##section. I might even refactor QuantumBitGenerator to move it all to a different file. All you really need to know is that thanks to that we can use QuantumBitGenerator (and any of its child classes like Qrng) as a NumPy bit generator (e.g. to instantiate a generator numpy.Generator(qrng)). I would therefore advice taking a look at some applications of NumPy's BitGenerator class and simply add some examples 😊

Also, instead of looking at the code inside the master branch, I would suggest looking at dev. That is the most up to date code you can find!

pedrorrivero avatar May 31 '21 03:05 pedrorrivero