\documentclass[11pt]{article}
\usepackage[colorlinks=true]{hyperref}
\usepackage{fullpage}
\usepackage{graphicx}
\input{Qcircuit}
\usepackage{pict2e}
\usepackage[percent]{overpic}
\usepackage{amsmath}
\usepackage{float}
\usepackage{amsfonts}
\usepackage{float}
\usepackage{tikz}
\usepackage[linesnumbered,lined]{algorithm2e}
\makeatletter
\renewcommand{\@algocf@capt@plain}{above}% formerly {bottom}
\makeatother
\usepackage{scrextend}
\usepackage{enumitem}
\setlist[enumerate]{listparindent=\parindent}
%\newcommand{\ket}[1]{|#1\rangle}
%\newcommand{\bra}[1]{\langle#1|}
\newcommand{\proj}[1]{|#1\rangle\!\langle#1|}
\newcommand{\braket}[2]{\langle{#1}|{#2}\rangle}
\newcommand{\ketbra}[2]{|#1\rangle\!\langle#2|}
\usepackage{cleveref}%[nameinlink]
\crefname{lemma}{Lemma}{Lemmas}
\crefname{proposition}{Proposition}{Propositions}
\crefname{definition}{Definition}{Definitions}
\crefname{theorem}{Theorem}{Theorems}
\crefname{conjecture}{Conjecture}{Conjectures}
\crefname{corollary}{Corollary}{Corollaries}
\crefname{section}{Section}{Sections}
\crefname{appendix}{Appendix}{Appendices}
\crefname{figure}{Fig.}{Figs.}
\crefname{equation}{Eq.}{Eqs.}
\crefname{table}{Table}{Tables}
\crefname{algocf}{Algorithm}{Algorithms}
\title{CS333 - Problem Set 7\\\small{Due: Wednesday, April 18th before class}}
\author{}
\date{}
\parindent=.25in
\begin{document}
\maketitle
\vspace{-1cm}
See final page for hints.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{enumerate}
\item \textbf{[6 points]} As you learned, there are many physical systems that scientists are considering using to actually build a quantum computer. Unfortunately, it seems like no system is really perfect for the job - each physical system has different strengths and weaknesses. A different approach is to construct a ``heterogeneous'' quantum computer that does not just use one type of physical system as a qubit, but uses several different systems depending on the situation. Describe a quantum computer built out of several types of qubits, and explain which functions of the computer would be accomplished by which types of physical system. For example, what would you use for RAM, for hard drive, for bus, etc, and why?
{}
\item In this problem, we will investigate a many-qubit version of the Deutsch
Algorithm called the Deutsch-Josza Algorithm. This problem involves using the
unitary operation $H^{\otimes n},$ so we will first investigate its
properties. Note that $H^{\otimes n}$ is $n$ copies of $H$ acting simultaneously on $n$ qubits. We describe how
$H^{\otimes n}$ acts by describing how it acts on standard basis states. For a standard basis state $\ket{x},$
\begin{align} \label{eq:Hn}
H^{\otimes n}\ket{x}=\frac{1}{2^{n/2}}\sum_{y\in\{0,1\}^n}(-1)^{x\cdot y}\ket{y}.
\end{align}
where the summation is over all $2^n$ standard basis states $y$, and
\begin{align}
x\cdot y=\sum_{i=1}^nx_iy_i
\end{align}
where $x_i$ is the ith bit of $x$ and $y_i$ is the ith bit of $y$.
So for example:
\begin{align}
H^{\otimes 2}\ket{01}&=\frac{1}{2}\sum_{y\in\{0,1\}^n}(-1)^{01\cdot y}\ket{y}\nonumber\\
&=\frac{1}{2}\left((-1)^{01\cdot 00}\ket{00}+(-1)^{01\cdot 01}\ket{01}+(-1)^{01\cdot 10}\ket{10}+(-1)^{01\cdot 11}\ket{11}\right)\nonumber\\
&=\frac{1}{2}\left(\ket{00}-\ket{01}+\ket{10}-\ket{11}\right).
\end{align}
\begin{enumerate}
\item \textbf{[3 points]} Use the formula in \cref{eq:Hn} to determine the resulting state of
\begin{align}
H^{\otimes n}\ket{0}^{\otimes n}
\end{align}
and
\begin{align}
H^{\otimes n}\ket{1}^{\otimes n}.
\end{align}
\item \textbf{[6 points]} (Challenge) Let $\ket{x}$ be a standard basis state that is not $\ket{0}^{\otimes n}.$ Explain why
\begin{align}
H^{\otimes n}\ket{x}
\end{align}
produces a superposition of all standard basis states with exactly half of the amplitudes positive, and half of the amplitudes negative.
\item Consider a function $f:\{0,1\}^n\rightarrow\{0,1\}$ that has the promise
that it is either even or balanced. If it is even, $f(x)=0$ for all
$x\in\{0,1\}^n$, or $f(x)=1$ for all $x\in\{0,1\}^n$. If it is balanced, then for exactly half of
the inputs, $f(x)=0$ and for half of the inputs $f(x)=1.$ We would like to
determine which case we are in.
\begin{enumerate}
\item \textbf{[6 points]} What is the worst case deterministic classical query complexity of deciding with certainty if the function is even or balanced? Explain. (Give big-O)
\item \textbf{[6 points]} What is the worst case probabilistic classical query complexity of determining if the function is even or balanced? Explain. (This means you have a probabilistic algorithm, and your answer should be correct with probability at least 2/3. Give big-O. You don't have to prove, just sketch the idea.)
\end{enumerate}
\item Let $U_f$ be the unitary that acts on $n+1$ qubits as
\begin{align}
\ket{x}_A\ket{y}_B \overset{U_f}{\rightarrow} \ket{x}_A\ket{y \oplus f(x)}_B,
\end{align}
where $A$ is an $n$ qubit system and $B$ is a $1$ qubit system. Consider the following circuit
\begin{align}
\Qcircuit @C=1em @R=.7em {
\lstick{\ket{0}} & \gate{H} & \multigate{4}{U_f} & \gate{H} & \meter \\
\lstick{\ket{0}} & \gate{H} & \ghost{U_f} & \gate{H} & \meter \\
\vdots & & & & \\
\lstick{\ket{0}} & \gate{H} & \ghost{U_f} & \gate{H} & \meter \\
\lstick{\ket{-}} & \qw & \ghost{U_f} &\qw &\qw
}
\end{align}
\begin{enumerate}
\item \textbf{[3 points]} What is the state of the system after $U_f$ acts? (Use phase kickback - your expression should have terms $f(y)$ that you do not need to simplify.)
\item \textbf{[3 points]} What is the state of the system after the second $H^{\otimes n}$ acts? (Use linearity to bring the $H^{\otimes n}$ inside the summation.)
\item \textbf{[6 points]} If the function is even, what is the probability of getting outcome $\ket{0}^{\otimes n}$ (i.e. $\ket{0}$ on every qubit) when the measurement is made? What if the function is balanced?
\item \textbf{[3 points]} What is the quantum query complexity of determining if the function is even or balanced?
\end{enumerate}
\end{enumerate}
{}
\item
\begin{enumerate}
\item \textbf{[6 points]} (Challenge) Suppose you know that over the course of a quantum algorithm on $n$ qubits, the quantum system is never in more than a superposition of $T$ standard basis states. Suppose that the computation involves $M$ single and two qubit unitaries. You may assume that at each time step, only one unitary acts at a time (so there is no parallel computation). Explain how you can simulate this computation using a classical computer with $O(Tn)$ bits in $O(MT^2)$ time. (You can probably do $O(M\times T)$ time with some extra cleverness...bonus points if you do!)
\item \textbf{[6 points]} (Big picture) Based on the previous part, what property of a quantum algorithm is necessary (although not sufficient) in order to have an exponential speed-up versus any classical algorithm?
\item \textbf{[6 points]} Show that the property you mentioned in part b is not sufficient for a quantum speed-up, by showing that there is a circuit with the property of part b, which can be simulated efficiently (polynomially in the number of qubits).
\end{enumerate}
{}
\end{enumerate}
\newpage
{\Large{Hints!}}
\begin{enumerate}
\item
\item
\begin{enumerate}
\item Solution:
\begin{align}
H^{\otimes n}\ket{0}^{\otimes n}=\frac{1}{2^{n/2}}\sum_{y\in\{0,1\}^n}(-1)^{00\dots0\cdot y}\ket{y}=\frac{1}{2^{n/2}}\sum_{y\in\{0,1\}^n}\ket{y}
\end{align}
\begin{align}
H^{\otimes n}\ket{1}^{\otimes n}=\frac{1}{2^{n/2}}\sum_{y\in\{0,1\}^n}(-1)^{11\dots1\cdot y}\ket{y}=\frac{1}{2^{n/2}}\sum_{y\in\{0,1\}^n}(-1)^{|y|}\ket{y}
\end{align}
where $|y|$ is the number of 1s in the bit string $y$.
\item Show that there are the same number of bit strings of length $k$ that have an even number of $1$s as an odd number of $1$s.
\item Solution:
\begin{enumerate}
\item $O(2^n)$
\item $O(1).$
\end{enumerate}
\item Solution:
\begin{enumerate}
\item
\begin{align}
\frac{1}{2^{n/2}}\sum_{x\in \{0,1\}^n}(-1)^{f(x)}\ket{x}\ket{-}.
\end{align}
\item
\begin{align}
\frac{1}{2^{n}}\sum_{y\in\{0,1\}^n}\left(\sum_{x\in \{0,1\}^n}(-1)^{f(x)+x\cdot y}\right)\ket{y}.
\end{align}
\item Even: 1. Odd: 0.
\item
\end{enumerate}
\end{enumerate}
\item
\begin{enumerate}
\item Store a (classical) list of the superposition of standard basis states at the current time and their
amplitudes. Then update this list as the algorithm progresses.
\item The property is that the circuit should have an exponential number of standard basis states in superposition. Why?
\item Consider the circuit on $n$ qubits:
\begin{align}
\Qcircuit @C=1em @R=.7em {
\lstick{\ket{0}} & \gate{H} & \meter \\
\lstick{\ket{0}} & \gate{H} & \meter \\
\vdots & & \\
\lstick{\ket{0}} & \gate{H} & \meter
}
\end{align}
\end{enumerate}
\end{enumerate}
\end{document}