Example illustraing Quantum programming

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
romerol
Messages
3
Reaction score
0
TL;DR
How to use Quantum programming example, preferably using Java and Python or Datamelt
I'm interested in quantum programming. So far I've managed to use Java and Python inside Datamelt computation project for physics simulations and for various statistical plots. Now I want to make a simple code that illustates quantum computing, and maybe even to visualize its principles (for example, building an quantum dice to generate a random result). Do you have any suggestion how to write such a code? Any example in python/java will be highly appreciated.
 
on Phys.org
There’s a quantum tic tac toe game that teaches the notion of quantum entanglement.

I wrote a simple version where clicking on a square and dragging to another created an entangled pair. Instead of displaying an x or o they oscillated between the creating a blur until one square was selected and the other square took on the opposite value. It didn’t work exactly as described in the original game description but it sure looked cool.

https://en.m.wikipedia.org/wiki/Quantum_tic-tac-toe
 
  • Like
Likes   Reactions: FactChecker
Thanks. This wikipedia example does not have coding
 
Are you interested in code that illustrates the principles or in code that might actually be used in a quantum computer? The two are completely different. The example that @jedishrfu made is the former. Code that can actually be used in a quantum computer is completely different from normal code and is very dependent on the hardware and design of the computer. That entire subject is very immature and under development. @pbuk 's link addresses that code.
 
  • Like
Likes   Reactions: pbuk