\documentclass{article}

\usepackage{graphicx}
\usepackage{caption}
\usepackage{setspace}
\usepackage{listings}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{float}
\usepackage[justification=centering]{caption}
\usepackage{subcaption}
\usepackage[margin=0.75in]{geometry}
\usepackage[parfill]{parskip} 
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{cancel}
\usepackage{siunitx}
\usepackage{adjustbox}

\titleformat{\subsection}[runin]{\normalfont \large \bfseries}
    {\thesubsection}{1em}{}

\captionsetup[figure]{width=0.75\textwidth,labelfont=normalfont,font=it,labelsep=period}

\DeclareMathOperator*{\sinc}{sinc}
\DeclareMathOperator*{\rect}{rect}
\renewcommand{\thesubsection}{\indent(\alph{subsection})}

    \definecolor{dkgreen}{rgb}{0,0.6,0}
    \definecolor{gray}{rgb}{0.5,0.5,0.5}
    \definecolor{mauve}{rgb}{0.58,0,0.82}


    \definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
    \definecolor{mylilas}{RGB}{170,55,241}


    \lstset{language=Matlab,%
        %basicstyle=\color{red},
        breaklines=true,%
        morekeywords={matlab2tikz},
        keywordstyle=\color{blue},%
        morekeywords=[2]{1}, keywordstyle=[2]{\color{black}},
        identifierstyle=\color{black},%
        stringstyle=\color{mylilas},
        commentstyle=\color{mygreen},%
        showstringspaces=false,%without this there will be a symbol in the places where there is a space
        numbers=left,%
        numberstyle={\tiny \color{black}},% size of th_sume numbers
        numbersep=9pt, % this defines how far the numbers are from the text
        emph=[1]{for,end,break},emphstyle=[1]\color{red}, %some words to emphasise
        %emph=[2]{word1,word2}, emphstyle=[2]{style},    
        xleftmargin=2em
    }
    %\lstset{basicstyle=\small,
    %        keywordstyle=\color{mauve},
    %        identifierstyle=\color{dkgreen},
    %        stringstyle=\color{gray},
    %        numbers=left,
    %        xleftmargin=5em
    %        }


\newcommand{\angstrom}{\textup{\AA}}

\title{ECE 456 - Problem Set 3 (Part 1)}
\date{2021-03-31}
\author{David Lenfesty \\ lenfesty@ualberta.ca
    \and Phillip Kirwin \\ pkirwin@ualberta.ca}
    
\pagestyle{fancy}

\fancyhead[L]{\textbf{ECE 456} - Problem Set 3 (Part 1)}
\fancyhead[R]{David Lenfesty and Phillip Kirwin}
\fancyfoot[C]{Page \thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}

\begin{document}
    \doublespacing
    \maketitle
    \thispagestyle{empty}
    \singlespacing
    \newpage

    \section*{Problem 1}

        \begin{enumerate}[align=left,leftmargin=*,labelsep=1em,label=\bfseries(\alph*)] 
            \item %1a
            \begin{enumerate}[align=left,leftmargin=*,labelsep=0em,label=(\roman*)] 
                \item %1bi
                The matrix equation is 
                \begin{equation*}
                    [\hat{H}]\left\{\phi\right\} = E \left\{\phi\right\},
                \end{equation*}
                where \([\hat{H}]\) is an \(N\)-by-\(N\) matrix with \([\hat{H}]_{nm} = 0\) except for the following elements:
                \begin{align*}
                    &[\hat{H}]_{nn} = 2t_0 + U_n \\
                    &[\hat{H}]_{n,n \pm 1} = -t_0 \\
                    &[\hat{H}]_{0,N} = [\hat{H}]_{N,0} = -t_0,
                \end{align*}
                with \(t_0 = \hbar^2/(2ma^2)\) and \(U_n = U(na)\). The \(N\)-vector \(\left\{\phi\right\}\) has elements \(\phi_n\) which each represent
                the value of the eigenvector at the point \(na = x_n\).
                \item %1bii

                The expression of the wave function \( \phi (x) \) as a sum of basis functions is as below:

                \begin{equation*}
                    \phi (x) = \sum _{n = 1} ^{N} \phi _n u_n(x)
                \end{equation*}

                The derived matrix equation:

                \begin{equation*}
                    [\hat{H}] _u \{ \phi \} = [S]_u \{ \phi \}
                \end{equation*}

                Where \( [\hat{H}]_u \) is a matrix with the elements:
                
                \begin{equation*}
                    H_{nm} = \int u _n ^* (x) \hat{H} u_m(x) dx
                \end{equation*}

                and \( [S]_u \) is a matrix with the elements:

                \begin{equation*}
                    S_{nm} = \int u _n ^* (x) u_m(x) dx
                \end{equation*}

                \([\hat{H}]_u\) and \([S]_u\) are both of size \(N\)-by-\(N\). The elements
                of \(\left\{\phi\right\}\), \(\phi_n\), are the expansion coefficients of \(\phi(x)\).
            \end{enumerate}

            \item %1b
            \begin{enumerate}[align=left,leftmargin=*,labelsep=0em,label=(\roman*)] 
                \item %1bi
                code:
                \begin{lstlisting}
%constants
E1 = -13.6;
R = 0.074;
a0 = 0.0529;

%matrix elements
R0 = R/a0;

a = 2*E1*(1-(1+R0)*exp(-2*R0))/R0;
b = 2*E1*(1+R0)*exp(-R0);
s = exp(-R0)*(1+R0+(R0^2/3));

%matrices
H_u = [E1 + a, E1*s+b; E1*s+b, E1 + a];
S_u = [1, s; s, 1];

%find eigenvalues and eigenvectors
[vectors,energies] = eig(inv(S_u)*H_u);

                \end{lstlisting}
                The bonding and antibonding eigenenergies are \(\boxed{\SI{-32.2567}{eV}}\) and \(\boxed{\SI{-15.5978}{eV}}\) respectively.
                \item %1bii
                Neglecting normalization, we have the following expressions for \(\phi_B(z)\) and \(\phi_A(z)\):
                \begin{align*}
                    \phi_B(z) = u_L(z) + u_R(z) \\
                    \phi_A(z) = u_L(z) - u_R(z).
                \end{align*}
                We obtain the following plot:
                
                \begin{minipage}[t]{\linewidth}

                    \centering
                    \adjustbox{valign=t}{
                        \includegraphics[width=0.5\textwidth]{q1bii.png}
                    }
                    \captionof{figure}{non-normalized probability densities for bonding and antibonding solutions.}
                \end{minipage}

            \end{enumerate}
        \end{enumerate}
    \newpage

    \section*{Problem 2}
        \begin{enumerate}[align=left,leftmargin=*,labelsep=1em,label=\bfseries(\alph*)] 
            \item %2a
            \begin{enumerate}[align=left,leftmargin=*,labelsep=0em,label=(\roman*)] 
                \item %2ai

                \begin{minipage}[t]{\linewidth}

                    \centering
                    \adjustbox{valign=t}{
                        \includegraphics[width=0.5\textwidth]{q2ai.png}
                    }
                    % TODO still don't like this caption
                    \captionof{figure}{Energy vs. wave vector relationship.}
                \end{minipage}
            
                \item %2aii

                Energy values from \( -2 \) eV to \(2\) eV are allowed.

                \item %2aiii

                The vector \( \{ \phi \} \), which is of length \( N \), and has elements \( n \) is:

                \begin{equation*}
                    \{ \phi \} = C e ^{ i k \cdot n a }
                \end{equation*}
                \begin{align*}
                    \left\{\phi\right\} = \begin{bmatrix}
                                            Ce^{ika} \\
                                            Ce^{ik2a} \\
                                            \vdots \\
                                            C_Ae^{ikNa}
                                            \end{bmatrix} 
                \end{align*}

                The corresponding wave function is:

                \begin{equation*}
                    \phi (x) = \sum _ {n = 1} ^ N C e ^ { i k  \cdot n a } u_n (x)
                \end{equation*}
                
                There is one wave function and thus one energy level for each value of \( k \).
                This means that there is one electronic state per \( k \).

            \end{enumerate}
            \item %2b
            \begin{enumerate}[align=left,leftmargin=*,labelsep=0em,label=(\roman*)] 
                \item %2bi
                \begin{align*}
                    \left\{\phi\right\} = \begin{bmatrix}
                                            C_Ae^{ika} \\
                                            C_Be^{ika} \\
                                            C_Ae^{ik2a} \\
                                            C_Be^{ik2a} \\
                                            \vdots \\
                                            C_Ae^{ikNa} \\
                                            C_Be^{ikNa}
                                            \end{bmatrix} 
                \end{align*}
                \item %2bii
                \begin{equation*}
                    \phi(x) = \sum_{n=1}^{N} C_Ae^{ikna} u_{nA}(x) + C_Be^{ikna} u_{nB}(x)  
                \end{equation*}
                \item %2biii
                \([h(k)]\) is of size 2-by-2. Thus there will be two values of \(E(k)\) for a fixed \(k\).
                This also means there are two \(\phi(x)\) for each \(k\).
            \end{enumerate}
            \item %2c
            \begin{enumerate}[align=left,leftmargin=*,labelsep=0em,label=(\roman*)] 
                \item %2ci

                \begin{align*}
                    \phi _2 + 2 \phi _3 + \phi _4 &= E \phi_1 \\
                    \phi _1 + \phi _3 + 2 \phi _4 &= E \phi_2 \\
                    2 \phi _1 + \phi _2 + \phi _4 &= E \phi_3 \\
                    \phi _1 + 2 \phi _2 + \phi _3 &= E \phi_4 \\
                \end{align*}

                \item %2cii

                \begin{align*}
                    \phi _2 + 2 \phi _3 + \phi _0 &= E \phi_1 \\
                    \phi _1 + \phi _3 + 2 \phi _4 &= E \phi_2 \\
                    2 \phi _5 + \phi _2 + \phi _4 &= E \phi_3 \\
                    \phi _5 + 2 \phi _6 + \phi _3 &= E \phi_4 \\
                \end{align*}

                \item %2ciii

                A generalized form of the $n$th equation is:

                \begin{equation*}
                    E \phi_n = \phi_{n-1} + \phi_{n+1} + 2 \phi_{n+2}
                \end{equation*}

                \item %2civ

                \begin{align}
                    E C e ^{ikna} &= Ce ^ {ik (n + 1)a} + Ce^{ik (n - 1)a} + 2 Ce^{ik (n + 2)a} \nonumber \\
                    E &= e^{ika} + e^{-ika} + 2 e^{2ika} \nonumber \\
                    E(k) &= 2 e^{2ika} + 2\cos(ka) \label{eq:e_k}
                \end{align}

                \item %2cv

                Imposing the repeating boundary conditions \( \phi _{n + 4} = \phi _{n} \), We obtain the following relationship:

                \begin{align*}
                    Ce^{ikna} &= Ce^{ik(n+4)a} \\
                    1 &= e^{i4ka}
                \end{align*}

                For this to hold, \(4ka\) must be some multiple of \(2 \pi \), and this mean \( k = \frac{\pi}{2a} \cdot integer \).

                \item %2cvi

                Using the E-k relationship from equation \ref{eq:e_k},
                we know that \( k \) must always be real, so the \( 2\cos(ka) \) portion of the E-k relationship must be
                real. As well, if we substitute in the equation for \( k \) we obtained in part \nolinebreak (v), we get the following (partial) expression:

                \begin{equation*}
                    2e^{i2ka} = 2 e^{i\pi \cdot integer}
                \end{equation*}
                
                Which we know will always be real (with a value of \( \pm 2 \)).

                \item %2cvii
                Since \(e^{2\pi n} = 1\), we have:
                \begin{align*}
                    \phi_n(k+\frac{2\pi}{a}) &= Ce^{i(k+\frac{2\pi}{a}) \cdot nA} = Ce^{ik \cdot nA} \\
                    \phi_n(k+\frac{2\pi}{a}) &= \phi_n(k).
                \end{align*}
                Therefore wavefunctions for which \(k\) is separated by \(\frac{2\pi}{a}\) are equivalent, and we
                only need consider the range \(k \in [-\frac{\pi}{a}, \frac{\pi}{a}]\).
            \end{enumerate}
        \end{enumerate}
        \newpage

    \section*{Problem 3}
        \begin{enumerate}[align=left,leftmargin=*,labelsep=1em,label=\bfseries(\alph*)] 
            \item %3a
            Given the geometry and interaction rules stated, the interaction matrices \([H]_{nm}\) are zero except for
            \begin{align*}
                [H]_{nn} &= \begin{bmatrix}
                                E_0 & t_i \\
                                t_i & E_0 \\
                                \end{bmatrix} \\
                [H]_{n,m*} &= \begin{bmatrix}
                                t_A & 0   \\
                                0   & t_B \\
                                \end{bmatrix}
            \end{align*}
            where \(m*\) corresponds to any of the four nearest neighbor square-shaped unit cells to cell \(n\).
            For cell \(n\), let cell \(a\) be above, cell \(b\) be to the right, cell \(c\) be below, and cell \(d\) be to the left.
            Given that each cell is spaced a length \(a\) apart, the associated phase factors for nonzero \(H_{nm}\),
            \(e^{i\vec{k}\cdot(\vec{d_m}-\vec{d_n})}\), are then:
            \begin{align*}
                (n):& \quad 1 \\
                (a):& \quad e^{ik_y a} \\
                (b):& \quad e^{ik_x a} \\
                (c):& \quad e^{-ik_y a} \\
                (d):& \quad e^{-ik_x a} \\
            \end{align*}
            with \(\vec{k} = k_x\hat{x} + k_y\hat{y}\). The Bloch matrix then follows:
            \begin{align*}
                [h(\vec{k})]    &=  \sum_m [H]_{nm}  e^{i\vec{k}\cdot(\vec{d_m}-\vec{d_n})} \\
                                &=  \begin{bmatrix}
                                        E_0 + t_A\left(e^{ik_x a} + e^{-ik_x a} + e^{ik_y a} + e^{-ik_y a}\right) & t_i \\
                                        t_i & E_0 + t_B\left(e^{ik_x a} + e^{-ik_x a} + e^{ik_y a} + e^{-ik_y a}\right) \\
                                    \end{bmatrix} \\
                                &=  \begin{bmatrix}
                                        E_0 + 2t_A\left(\cos(k_x a) + \cos(k_y a)\right) & t_i \\
                                        t_i & E_0 + 2t_B\left(\cos(k_x a) + \cos(k_y a)\right) \\ 
                                    \end{bmatrix}
            \end{align*}

            \item %3b

            To find the E-\textbf{k} relationship in terms of cosine functions, we must first
            find \( h_0 \) in terms of trigonometric functions.
            We will require the following trigonometric identities to do so:

            \begin{align}
                sin(\alpha \pm \beta) = sin(\alpha)cos(\beta) \pm sin(\beta)cos(\alpha)
                \label{eq:sin_sum}
            \end{align}

            \begin{align}
                cos(\alpha \pm \beta) = cos(\alpha)cos(\beta) \mp sin(\alpha)sin(\alpha)
                \label{eq:cos_sum}
            \end{align}

            \begin{align}
                1 = sin^2(\theta) cos^2(\theta)
                \label{eq:sum_squares}
            \end{align}

            As well as the following general sine/cosine properties:
            \begin{align}
                cos(\theta) &= cos(-\theta)
                sin(\theta) &= -sin(-\theta)
                \label{eq:neg_sin_cos}
            \end{align}

            First we can rewrite the exponentials in \( h_0 \) using Euler's identity:

            \begin{align*}
                h_0 = -t_c \left( 1 + cos(-k_x a - k_y b) + i sin(-k_x a - k_y b) + cos(-k_x a + k_y b) + i sin(-k_x a + k_y b) \right)
            \end{align*}

            Using identities (\ref{eq:sin_sum}) and (\ref{eq:cos_sum}), we can expand this relationship further.

            
            % TODO no idea how to format this...
            \begin{align*}
                h_0 = -t+c ( 1 &+ cos(-k_x a)cos(-k_y b) - sin(-k_x a)sin(-k_y b) + i sin(-k_x a)cos(-k_y b) + i sin(-k_y b)cos(-k_x a) \\
                               &+ cos(k_y b)cos(k_x a) + sin(k_y b)sin(k_x a) + i sin(k_y b)cos(k_x a) - i sin(k_x a)cos(k_y b) )
            \end{align*}

            Here we can use the properties from (\ref{eq:neg_sin_cos}) to reduce this equation. Since \( \left| h_0 \right| ^2 = h_0 h^*_0 \),
            we also obtain a simple expression for \( h^*_0 \).

            \begin{align*}
                h_0 &= -t_c ( 1 + 2cos(k_x a)cos(k_y b) -  2 i sin(k_x a)cos(k_y b)) \\
                h^*_0 &= -t_c ( 1 + 2cos(k_x a)cos(k_y b) + 2 i sin(k_x a)cos(k_y b))
            \end{align*}
            
            We can now find \( \left| h_0 \right| ^2 = h_0 h^*_0 \):

            \begin{align*}
                h_0 h^*_0 = 1 + 4cos(k_x a)cos(k_y b) + 4cos^2(k_y b)
            \end{align*}

            From this, we can finally obtain an expression for \( E(k) \):

            \begin{align}
                E(k) = E_0 \pm t_c \sqrt{1 + 4cos(k_x a)cos(k_y b) 4 cos^2(k_y b)}
            \end{align}

        \end{enumerate}

    \section*{Problem 4}
        \begin{enumerate}[align=left,leftmargin=*,labelsep=1em,label=\bfseries(\alph*)] 
            \item %4a

            We can substitute (from the assignment) equation (24) into equation (23):

            \begin{align}
                \sum _k i \hbar \frac{\delta}{\delta t} c_k(t) \phi_k(x) e^{-i [E(k) / \hbar] t} &= \sum _k c_k(t) \hat{H_0} \phi(x)e^{-i [E(k) \ \hbar] t} \\
                 &+ \sum _k c_k(t) U_s(x, t) \phi _k (x) e^ {-i [E(k) / \hbar] t}
                 \label{eq:phi}
            \end{align}

            We can partially evaluate the derivative on the left hand side:

            \begin{align*}
                \frac{\delta}{\delta t} c_k(t) \phi _k(t)e^{-i [E(k) / \hbar]t} = \frac{\delta c_k(t)}{\delta t} \phi _k(t)e^{-i [E(k) / \hbar]t} - \frac{i}{\hbar} c_k(t)E(k)\phi _k (x) e^{-i [E(k) / \hbar]t}
            \end{align*}

            Expanding the rightmost term out into the summation, we get the expression \( \sum _k c_k(t) E(k) \phi _k(x) e^ {-i [E(k) / \hbar]t} \).
            Since \( \hat{H_0} \phi _k(x) = E(k) \phi_k(x) \), we can see that this cancels out the term with \( \hat{H_0} \) in our first substition (\ref{eq:phi}),
            and we get the final differential equation:

            \begin{align*}
                \sum_k c_k(t) U_s(x, t) \phi _k (x) e^{-i [E(k) / \hbar]t} = \sum_k i \hbar \frac{\delta c_k(t)}{\delta t} \phi_k(x) e^{-i [E(k) / \hbar] t}
            \end{align*}

            \item %4b
            \begin{align*}
                \sum_k c_k(t) \left[\int\phi_{k_f}^*(x)U_s(x,t) \phi_k(x)\:dx\right] e^{-i[E(k)/\hbar]t} &= \sum_k i\hbar \frac{\partial c_k(t)}{\partial t} \left[\int\phi_{k_f}^*(x)\phi_k(x)\:dx\right] e^{-i[E(k)/\hbar]t} \\
                \sum_k c_k(t) I_{k_f k} e^{-i[E(k)/\hbar]t} &= \sum_k i\hbar \frac{\partial c_k(t)}{\partial t} \delta_{k_f k} e^{-i[E(k)/\hbar]t} \\
                \sum_k c_k(t) I_{k_f k} e^{-i[E(k)/\hbar]t} &= i\hbar \frac{\partial c_k(t)}{\partial t} e^{-i[E(k)/\hbar]t} \\
            \end{align*}
            where \(I_{k_f k}\) is as defined in the assignment and \(\delta_{k_f k}\) is the Kronecker delta.
            \item %4c

            Starting with the initial equation

            \begin{align*}
                \sum _k c_k(t) I_{k_f k} e ^ {-i [ E(k) / \hbar ] t } = i \hbar \frac{\delta c_{k_f}(t)}{\delta t} e ^ {-i [ E(k_f) / \hbar ] t}
            \end{align*}

            Since we approximated that \( c_k = 1 \), only when \( k  = k_i \), and 0 otherwise, we can simplify
            the sum on the left hand side to a single element, and divide out the exponentials.

            \begin{align*}
                I_{k_f k_i} e^{ i [- E(k_i) + E(k_f) / \hbar] t} = i \hbar \frac{\delta c_k(t)}{\delta t}
            \end{align*}

            Defining a new symbol \( \Lambda = [E(k_f) - E(k_i)] / \hbar \), we can simplify the equation to it's final form.

            \begin{align}
                I_{k_f k_i} e^{i \Lambda t} = i \hbar \frac{\delta c_k(t)}{\delta t}
            \end{align}

            \item %4d
            \begin{align*}
                \int \frac{\partial c_{k_f}(t)}{\partial t} &= \frac{1}{i\hbar} I_{k_fk_i} \int e^{i\Lambda t} \\
                c_{k_f}(t) &= \frac{1}{i\hbar} I_{k_fk_i} \frac{1}{i\Lambda} e^{i\Lambda t} + C \\
                c_{k_f}(t) &= \frac{1}{i\hbar} I_{k_fk_i} e^{i\Lambda t/2} \left[\frac{1}{i\Lambda} e^{i\Lambda t/2} + C e^{-i\Lambda t/2} \right]
            \end{align*}
            Let \(C=-\frac{1}{i\Lambda}\). We then have:
            \begin{align*}
                c_{k_f}(t) &= \frac{1}{i\hbar} I_{k_fk_i} e^{i\Lambda t/2} \frac{1}{i\Lambda} \left[ e^{i\Lambda t/2} - e^{-i\Lambda t/2} \right] \\
                c_{k_f}(t) &= \frac{1}{i\hbar} I_{k_fk_i} e^{i\Lambda t/2} \frac{\sin(\Lambda t/2)}{\Lambda/2}.
            \end{align*}

            \item %4e


        \end{enumerate}

\end{document}