Homework 2


Assignments: These assignments are optional, but highly encouraged. They will not be checked.

  1. (20 points) In HW1, we had a solution to the "imply" in a 4 Qbit embedding that we tested in the spreadsheet. Notice that if the resulting embedding does not match the bipartite graph we need, you can embed q1+q3 and q2+q4 to get a symmetric solution, which is a match for the graph we want. Let's now transform this into Quantum machine instructions (QMI).

    But first, let's run some QMI code:

        cd qOp
        cd examples
        cd dw
        bash A-execute-qmi.bash
        
    Copy the file A-execute-qmi.bash to imply4-qmi.bash, then create the same embedding as in the spreadsheet for the "imply equation".
    Hints: The solution should have 3 ground states (solutions with objective=0) matching the ones in the spreadsheet, but you may have to translate from the Qbit numbering of QMI to the one in the spreadsheet. If you have more/less than 4 solutions or different ones than expected, then your weights/strengths are wrong.

    Turn in file imply4.bash (dw program) and imply4a.pdf (spreadsheet snapshot)

  2. (10 points) Let's try one more embedding exercise, again for the "imply" circuit from of slide 8 in a 4-Qbit subset in the spreadsheet, but this time by embedded q1 into 3 Qbits.
    Hints: The solution should have 3 ground states matching the ground states of slide 8. Verify that the q1+q3+q4 values match for any ground state. (If not, then you've made a mistake.) Notice that the resulting embedding does not match D-Wave's bipartite graph.

    Turn in file imply4b.pdf

  3. (20 points) Let's repeat this embedding for the "imply" from slide 8 for a 5-Qbit subset with q1 replicated in another 3 Qbits such that it can be embedded into D-Wave's bipartite graph. Since you cannot do this in the spreadsheet, try it on paper. Then program it in QMI.
    Hints:

    Turn in file imply5.bash (dw program) and imply5.pdf (graph showing Qbits+couplings with weights+strengths on paper)

  4. (10 points) Let's create the 1-bit full adder from slide 41 on Quirk with inputs c0, a0, b0 and outputs s0 and c1.
    Hints:

    Turn in file adder.txt

  5. (20 points) Combine two adders to create a 2-bit adder in Quirk with inputs c0, a0, a1, b0, b1 and outputs s0, s1, and c2. Make sure to label inputs/outputs.

    Turn in file doubleadder.txt

  6. (5 points) Create a Toffoli gate in Quirk from basic gates by modifying this solution. Start with the given circuit but substitute gates as follows:

    Turn in file toffoli.txt

  7. (15 points) Create a Toffoli gate in Quirk from basic gates by modifying this solution. We now try construct Toffoli variation. Start with the given circuit but substitute gates as follows:

    Turn in file toffoli2.txt

  8. (0 points) Learn about superdense coding and then check out the predefined Superdense circuit in Quirk (click menu button). Have a look at how it works in action. Fun stuff to first grasp and then watch. Nothing to turn in, no points :-)