\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage{amssymb,latexsym}
\usepackage{epsfig}
\usepackage{hyperref}
\usepackage{float}
\usepackage{fullpage}
\usepackage{enumerate}
\usepackage{paralist}
\usepackage{graphicx}

\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{assumption}[theorem]{Assumption}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{alg}[theorem]{Algorithm}
\newtheorem{protocol}[theorem]{Protocol}
\newtheorem{problem}[theorem]{Problem}

\newcommand{\ip}[2]{\left\langle #1 , #2\right\rangle}
\newcommand{\tr}{\trace}
\newcommand{\setft}[1]{\mathrm{#1}}
\newcommand{\lin}[1]{\setft{L}\left(#1\right)}
\newcommand{\density}[1]{\setft{D}\left(#1\right)}
\newcommand{\unitary}[1]{\setft{U}\left(#1\right)}
\newcommand{\herm}[1]{\setft{Herm}\left(#1\right)}
\newcommand{\pos}[1]{\setft{Pos}\left(#1\right)}
\newcommand{\sep}[1]{\setft{Sep}\left(#1\right)}
\newcommand{\rank}[1]{\operatorname{rank}(#1)}
\newcommand{\ex}{\paragraph{Exercise.}}

\def\I{I}
\def\({\left(}
\def\){\right)}
\def\X{\mathcal{X}}
\def\Y{\mathcal{Y}}
\def\Z{\mathcal{Z}}
\def\W{\mathcal{W}}
\def\yes{\text{yes}}
\def\no{\text{no}}
\def\blog{\textup{log}}
\newcommand{\A}{\spa{A}}
\newcommand{\B}{\spa{B}}
\newcommand{\UA}{U_A}


\newcommand{\myparagraph}[1]{\paragraph{#1.}}

\newcommand{\eps}{\varepsilon}
\newcommand{\epssdp}{\varepsilon_{\rm sdp}}
\newcommand{\bra}[1]{\langle #1|}
\newcommand{\ket}[1]{|#1\rangle}
\newcommand{\braket}[2]{\langle #1|#2\rangle}
\newcommand{\ketbra}[2]{\ket{#1}{\bra{#2}}}
\newcommand{\lmin}[1] {\lambda_{\operatorname{min}}(#1)}
\newcommand{\lmax}[1] {\lambda_{\operatorname{max}}(#1)}
\newcommand{\lhyes} {\operatorname{LH_{yes}}}
\newcommand{\lhno} {\operatorname{LH_{no}}}
\newcommand{\CQ}{\mathcal{CQ}}
\newcommand{\lh}{\operatorname{LH}}
\newcommand{\flh}{\operatorname{5-LH}}
\newcommand{\klhh}{\operatorname{k-LH}}
\newcommand{\qma}{\operatorname{QMA}}
\newcommand{\enc}[1]{\left<#1\right>}

\newcommand{\C}{C}
\newcommand{\Id}{Id} %CHECK
\newcommand{\Exs}[2]{E_{#1}[#2]} %CHECK

\newcommand{\beq}{\begin{equation}}
\newcommand{\eeq}{\end{equation}}

\newcommand{\trace}{{\rm Tr}}

%\newcommand{\dim}{\operatorname{dim}}
\newcommand{\norm}[1]{\left\|\,#1\,\right\|}       % norm
\newcommand{\pnorm}[1]{\left\|\,#1\,\right\|_p}       % norm
\newcommand{\onorm}[1]{\norm{#1}_{\mathrm{1}}}      % Euclidean norm for vectors
\newcommand{\enorm}[1]{\norm{#1}_{\mathrm{2}}}      % Euclidean norm for vectors
\newcommand{\trnorm}[1]{\norm{#1}_{\mathrm {tr}}}  % trace norm
\newcommand{\fnorm}[1]{\norm{#1}_{\mathrm {F}}}    % frobenius norm
\newcommand{\snorm}[1]{\norm{#1}_{\mathrm {\infty}}}    % spectral norm

\newcommand{\set}[1]{{\left\{#1\right\}}}    % braces for set notation
\newcommand{\ve}[1]{\mathbf{#1}}
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}
\newcommand{\optprod}{\OPT_P}
\newcommand{\opt}{\operatorname{OPT_1}}
\newcommand{\optt}{\operatorname{OPT_2}}
\newcommand{\newopt}{\operatorname{NEW-OPT}}
\newcommand{\swap}{\operatorname{SWAP}}
\newcommand{\poly}{\operatorname{poly}}
\newcommand{\cc}{d^{\frac{k}{2}}}
\newcommand{\OPT}{{\rm OPT}}
\newcommand{\QMA}{{\rm QMA}}
\newcommand{\MQA}{{\rm MQA}}
\newcommand{\NP}{{\rm NP}}
\newcommand{\PP}{{\rm P}}
\newcommand{\PH}{{\rm PH}}
\newcommand{\BPP}{{\rm BPP}}
\newcommand{\BQP}{{\rm BQP}}
\newcommand{\TCSP}{{\rm 2-CSP}}

\newcommand{\complex}{{\mathbb C}}
\newcommand{\reals}{{\mathbb R}}
\newcommand{\ints}{{\mathbb Z}}
\newcommand{\nats}{{\mathbb N}}

\newcommand{\spa}[1]{\mathcal{#1}}
\newcommand{\dens}{\mathcal{D}(\spa{A}\otimes\spa{B})}
%\newcommand{\unitaries}{U(\spa{A}\otimes\spa{B})}

\newcommand{\LL}{\mathcal{L}}
\newcommand{\DD}{\mathcal{D}}
\newcommand{\HH}{\mathcal{H}}
\newcommand{\UU}{\mathcal{U}}

\mathchardef\mhyphen="2D

\newcommand{\ayes}{A_{\rm yes}} %CHECK
\newcommand{\ano}{A_{\rm no}} %CHECK
\newcommand{\nl} {\mathcal{L}_1}

\bibliographystyle{alpha}

\begin{document}

\title{\vspace{-10mm}Introduction to Quantum Computation, UPB\\Winter 2022, Assignment 1\\{\large To be completed by: Friday, October 21}}
\date{}
\maketitle

\section{Exercises}
\begin{enumerate}
    \item %($5$ marks)
    For complex number $c=a+bi$, recall that the \emph{real} and \emph{imaginary} parts of $c$ are denoted $\operatorname{Re}(c)=a$ and $\operatorname{Imag}(c)=b$.
        \begin{enumerate}
            \item %($1$ mark)
            Prove that $c+c^\ast=2\cdot \operatorname{Re}(c)$.
            \item %($2$ marks)
            Prove that $cc^\ast={a}^2+{b}^2$. How can we therefore rewrite $\abs{c}$ in terms of $a$ and $b$?
            \item %($1$ mark)
            What is the polar form of $c=\frac{1}{\sqrt{2}}+\frac{1}{\sqrt{2}}i$? Use the fact that $e^{i\theta}=\cos\theta+i\sin\theta$.
            \item %($1$ mark)
            Draw $c=\frac{1}{\sqrt{2}}+\frac{1}{\sqrt{2}}i$ as a vector in the complex plane, ensuring to denote both the length of the vector and its angle with the $x$ axis.
        \end{enumerate}
    \item %($4$ marks)
    Prove that for any normalized vectors $\ket{\psi},\ket{\phi}\in\complex^d$,
     \[
        \enorm{\ket{\psi}-\ket{\phi}}=\sqrt{2-2\cdot\operatorname{Re}(\braket{\psi}{\phi})}.
     \]
     Why does it not matter if we replace $\braket{\psi}{\phi}$ with $\braket{\phi}{\psi}$ in this equation?

    \item %($6$ marks)
    Define
    \[
    A=\left(
        \begin{array}{cc}
          a & b \\
          c & d \\
        \end{array}
      \right).
    \]
    \begin{enumerate}
        \item %($2$ marks)
        What is $\trace(A\cdot \ketbra{1}{0})$? (Hint: This can be computed quickly by using the cyclic property of the trace and the outer product representation of $A$. Do master this trick; it will be used repeatedly in the course and save you much time.)
        \item %($4$ marks)
        Let $\ket{+}=\frac{1}{\sqrt{2}}(\ket{0}+\ket{1})$. Use the same tricks as in part $A$, along with the fact that the trace is linear, to quickly evaluate
            \[
                \trace(A\cdot\ketbra{+}{+}).
            \]
    \end{enumerate}
\item %($5$ marks)
        \begin{enumerate}
            \item %($2$ marks)
            A general property of the outer product is that $(\ketbra{\psi}{\phi})^\dagger=\ketbra{\phi}{\psi}$. Verify that this holds for the case where $\ket{\psi}=\ket{0}$ and $\ket{\phi}=\ket{1}$. (Hint: Write out the full matrix corresponding to $\ketbra{0}{1}$.)
            \item %($3$ marks)
            Use Part (a) to prove that a normal matrix $A$ satisfies $A=A^\dagger$ if and only if all of $A$'s eigenvalues are real. (Hint: Since $A$ is normal, you can start by writing $A$ in terms of its spectral decomposition. What does the condition $A=A^\dagger$ enforce in terms of $A$'s spectral decomposition?)
        \end{enumerate}

\end{enumerate}

\end{document}
