qiskit-community-tutorials icon indicating copy to clipboard operation
qiskit-community-tutorials copied to clipboard

community/Cryptography can be improved

Open rfclambert opened this issue 5 years ago • 1 comments

I was looking at the tutorial in community to create a random number (uniform law), and found the one in Cryptography.

What is the expected behavior?

I think it should have more explainations in text, and I think the readme is wrong (it says that a circuit with n Hadamard is the same as rolling a n-face dice, but shouldn't it be 2**n-face dice?). Plus, it uses the statevector simulator, with no option of using the real hardware, even though the IBMQ account is set up in the beggining (it is not used, as well as the transpiler, so we could delete these unused imports). Even for simulation I suggest to use quasm_simulator for the backend and do multiple shots instead of recreating the same circuit each time we want a new random number (in the tutorial, 40 numbers are generated, and each time the circuit is rebuilt, because they are executed on the statevector_simulator).

So the improvements I suggest, to make it a better tutorial are: more text to explain what's going on, an option to use the real hardware for real randomness (it will work because it's only a Hadamard on every qubits), replace the statevector_simulator by the qasm_simulator and add a nbr_of_random_numbers parameters, in order to do all the generation in one execution on the circuit and a cleanup of unused imports and commented prints.

I hope it doesn't sound too harsh, I find it already great, but I think it can easily be improved to be more clear and versatile :)

It's clearly not a urgent job though, and I can help with it if needed!

rfclambert avatar Jun 26 '19 09:06 rfclambert

It would be great if you could make the changes you suggest. Let us know if you run into any issues.

attp avatar Jun 26 '19 23:06 attp