Homework 2



Important: Write Names and Unity IDs on every submission file. Name the submission file correctly as asked for.

  1. (20 points) Let's create the 1-bit full adder using D-Wave Ocean.

    Turn in files fadd.xlsm, fadd-impl.py, fadd-expl.py

  2. (40 points) Combine a half adder and two full adders to create an n-bit adder.

    Turn in file nadd.py

  3. (15 points, 3 points each) There are several types of products used in quantum computing math. Show the result of each product below. The answer will either be a scalar, a vector, or a matrix. Do not use bra-ket notation in your answers.

    Submit your answers as \(\textbf{hw2math.pdf}\).

    Note: If you are a LaTeX/Overleaf user, the \(\textbf{braket}\) package defines \(\verb#\bra{}#, \verb#\ket{}#\), and \(\verb#\braket{}#\) macros. You should also check out the \(\textbf{qcircuit}\) package for drawing quantum circuits.

  4. (10 points) Extend the one-bit adder, shown on slide 30 of Dr. Byrd's lecture slides, to create the 1-bit full adder on Quirk with inputs c0, a0, b0 and outputs s0 and c1.
    Hints:

    Turn in file adder.txt.

  5. (15 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.