QCEngine HandsOn IntroductionThis is an active QC simulator, which provides a programming interface, as well as a programmer's visual model, for QC operations. It's not finished yet, but you're welcome to browse. Please give feedback to qc@machinelevel.com!©20002015 All rights reserved. For more information, please send email to qc@machinelevel.com 
1. Basic operation 

Here's a simple program which just does a bunch of basic operations. Try this: Run the program, and then click in the gates on the chart to inspct the quantum state after each operation. You can run the program forward or backward, but be aware that nonreversible operations only really make sense if you run them forward. Try this: Modify the program! Change the number of qubits. Ask the sim for a hundred of them, or a thousand. That'll work, but once you're above 24 or so, the sim wili become digitalonly (nonquantum) so many operations will still work, but not interference or superposition. 

2. Entanglement 

Here's a program which demonstrates entanglement of two qubits. Try this: Run the program several times, and watch the output. Notice that the values of the two bits are always random, but always match. Try this: Click the gates to watch the entanglement happen. 




This program does entanglement using a CZ gate instead of a cnot gate. Try this: Click the gates to watch the entanglement happen. 

3. Teleportation 

Here's a quick teleportation circuit. Notice: We've started using the qint type to label the qunbits. Try this: Increase the "num_bits", so that Alice can teleport more data to bob. 




The example above uses the convenient notation of Bob doing a cnot on Alice's
result bits. That's not necessary, and here we show reading the values directly and
applying them. Try this: Run it several times, and watch bob change his actions depending on Alice's results. 




We don't actually need to construct it from gates each time;
all of this can be wrapped up into functions, for convenience. 

4. Cluster States 

Here we construct all of the different topological 4bit cluster states. Notice: The program turns on the "color by phase" option, to make it easier to see the cluster states. 

4b. Stabilizer SimFor working with large graph states, the stabilizer simulation is useful. It's based on CHP, written by Scott Aaronson and Daniel Gottesman. The CHP sim simulates a small subset of gates (CNOT, Hadamard, 90degree phase) which isn't enough for universal computation.The CHP simulation may be turned on and off as desired during a program, in order to accelerate operations where it's sufficient. 

This simple demo uses CHP to perform entannglement of 1000 qubits, very quickly. 


Here we turn on CHP to generate a cluster quickly, but then switch it off to
perform a QFT, which is something it can't do.
Note that it prints out the stabilizer state after constructing the cluster. Pro tips:



...and here are some of the samples which come with CHP.
In the source code, you can see that they're the original content, just
inserted as JavaScript strings.


5. Beam Splitters, Part 1 

For basic singlequbit beamsplitters, there's just a simple command.
Beamsplitters which mix qubit states will be shown later. Notice: At this stage, the dualrail representation is cosmetic. Later it gets more serious. Notice: The first qubit here has a Hadamard made of beamsplitters. 

6. QKD 

This program shows the basic quantum key distribution model,
with quantum RNG for both Alice and Bob. 




Here's the version with Eve being a sneaky spy. 

7. Integer Math 

Using the qint type, math functions (add, subtract, multiply, etc) can be
performed on sets of qubits, even in superposition,
even if the number of bits isn't the same. Notice: When we read the register, a random equation is pulled from the superposition, but it's always selfconsistent. 

8. Beam Splitters, Part 2 

To use beam splitters more generally, we need to expand the Fock states to full dualrail.
This program implements the CNOT version of this QCloud Demo.
(This part is under construction) 




This builds an optical postselected CNOT gate.  




This builds an optical postselected CZ gate.  




This builds an optical postselected CZ gate with simple auxbits.  




(Under construction, Jeremy's device)  




(Under construction, Comms QKD 1)  




(Under construction, Comms QKD 2)  




(Under construction, Comms QKD 3)  




(Under construction, Comms Dave & Co)  

9. Pair sources 


10. Distinguishability and Mixed StatesAlthough the sim normally operates on pure states, there's a very common case in photonics where you can't be sure the photons are 100% indistinguishable, which causes faults in the quantum behavior. 

Two photons
Here we build a simple photonic circuit in a classic HOMdip test, and then add some code to handle
distinguishabilityrelated imperfections.
Try this: Run the program, then change the distinguishability to a new value in [0, 1] and run it again. 



(Under Construction)
This is an experiment.


Export
