QRNG implementation for university project in pennylane

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.

Article reference

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 and see what others can comment about this!


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

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?


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 by Xanadu’s CEO and others.


If you want you can try using Xanadu’s X8 chips to try to generate these numbers. For this you will need to use Strawberry Fields instead of PennyLane. The X8 computer is online on Xanadu Cloud from Monday to Thursday 15:00:00 - 23:00:00 UTC.

I hope this can help you.

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


Ragunath Chandrasekharan

1 Like