# QRNG implementation for university project in pennylane

**URL:** <https://discuss.pennylane.ai/t/qrng-implementation-for-university-project-in-pennylane/3020>\
**Category:** PennyLane Help\
**Created:** [June 6, 2023, 7:56pm UTC](https://discuss.pennylane.ai/t/qrng-implementation-for-university-project-in-pennylane/3020 "2023-06-06T19:56:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DreamzUpAbove](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/dreamzupabove/32/1519_2.png) [@DreamzUpAbove](https://discuss.pennylane.ai/u/DreamzUpAbove)\
**Post date:** [June 6, 2023, 7:56pm UTC](https://discuss.pennylane.ai/t/qrng-implementation-for-university-project-in-pennylane/3020/1 "2023-06-06T19:56:22Z")

</div>

Hello! I was trying to implement a Quantum Random Number generator using Pennylane for my masters thesis.  
but after reading a research paper, it is mentioned that the speed of the generation won’t be sufficient for QKD generation !! the alternatives needs additional hardware !  
so if i implement in Pennylane, will it sufficient for usage in QKD ? kindly guide me on the same.

 ![Screenshot 2023-06-03 at 10.13.09 pm](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/2X/c/c9d93f58b1f5ea74307a6a7c428b0d24a1ad5e1b.png)

[Article reference](https://www.nature.com/articles/npjqi201621)

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [June 7, 2023, 12:09am UTC](https://discuss.pennylane.ai/t/qrng-implementation-for-university-project-in-pennylane/3020/2 "2023-06-07T00:09:36Z")

</div>

Hi @DreamzUpAbove,

It’s great that you posted this question here! Indeed there are many challenges if you want to do something that is realistically useful. There’s no wonder that so many companies are exploring all of these applications, but it’s still work in progress. If we’re talking specifically about QKD, notice that you would need a lot of specialized hardware, and it would be a whole different project from QRNG.

If you want to generate truly random numbers you need access to quantum hardware. You can do your program in PennyLane and then run your circuits on IBM or on Amazon Braket (not simulators). If you only use simulators then you will have pseudo-random numbers.

There are probably people who have already coded this online so you could get inspired by their projects. You can also post your question on [Slack](https://xanadu-quantum.slack.com/join/shared_invite/zt-nkwn25v9-H4hituCb_PUj4idG0MhSug#/shared-invite/email) and see what others can comment about this!

---

<div class="post-metadata">

**Author:** ![DreamzUpAbove](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/dreamzupabove/32/1519_2.png) [@DreamzUpAbove](https://discuss.pennylane.ai/u/DreamzUpAbove)\
**Post date:** [June 7, 2023, 6:56pm UTC](https://discuss.pennylane.ai/t/qrng-implementation-for-university-project-in-pennylane/3020/3 "2023-06-07T18:56:44Z")

</div>

@CatalinaAlbornoz,

Sure Catalina… thank you for these pointers… I will have a look at the same… have a nice day 👍

---

<div class="post-metadata">

**Author:** ![DreamzUpAbove](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/dreamzupabove/32/1519_2.png) [@DreamzUpAbove](https://discuss.pennylane.ai/u/DreamzUpAbove)\
**Post date:** [June 22, 2023, 9:20pm UTC](https://discuss.pennylane.ai/t/qrng-implementation-for-university-project-in-pennylane/3020/4 "2023-06-22T21:20:59Z")

</div>

Hi Team,  
am planning to use a different method for QRNG,

1. like will generate few random value using PRNG
2. feed that output to my system it generates or amplify this to big value and spit out random bits
3. where we apply a good extractor, which normalises and distribute over the spectrum !

could you please provide any useful resources on how to do this for each step, both theoretical and program samples?

regards,  
Ragunath

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [June 23, 2023, 3:04pm UTC](https://discuss.pennylane.ai/t/qrng-implementation-for-university-project-in-pennylane/3020/5 "2023-06-23T15:04:42Z")

</div>

Hi @DreamzUpAbove,

I have no idea whether this will actually produce true random numbers. However I can share some links on the topic of QRNG.

The paper: [Multiplexed Quantum Random Number Generation](https://quantum-journal.org/papers/q-2019-05-13-141/#) by Xanadu’s CEO and others.

[Wikipedia](https://en.wikipedia.org/wiki/Hardware_random_number_generator)

If you want you can try using [Xanadu’s X8 chips](https://strawberryfields.ai/photonics/demos/tutorial_X8.html) to try to generate these numbers. For this you will need to use [Strawberry Fields](https://strawberryfields.ai/) instead of PennyLane. The X8 computer is online on [Xanadu Cloud](https://cloud.xanadu.ai/) from Monday to Thursday 15:00:00 - 23:00:00 UTC.

I hope this can help you.

---

<div class="post-metadata">

**Author:** ![DreamzUpAbove](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/dreamzupabove/32/1519_2.png) [@DreamzUpAbove](https://discuss.pennylane.ai/u/DreamzUpAbove)\
**Post date:** [June 27, 2023, 5:55pm UTC](https://discuss.pennylane.ai/t/qrng-implementation-for-university-project-in-pennylane/3020/6 "2023-06-27T17:55:28Z")

</div>

> [@CatalinaAlbornoz](#):
>
> this you will need to use [Strawberry Fields](https://strawberryfields.ai/) instead of PennyLa

Thank you so much for your time and pointers. I will follow as you suggested.

regards,

Ragunath Chandrasekharan
