Assigning initial conditions for Schrodinger's equation I am self-teaching myself quantum mechanics, and my understanding so far is as follows. In the most general case, we would like to find a wave function $\varphi(x,t) \in \mathcal{H}$, where $\mathcal{H}$ is some appropriate Hilbert space. This wave function encodes the desired information about the system, with measurable quantities being obtained by applying certain operators. If we know the total energy of the system we may construct a Hamiltonian $H$. If this Hamiltonian is time-independent, we may solve the time-independent Schrodinger equation
$$\hat{H}\varphi_i = E_i \varphi_i$$
which amounts to finding the eigenvectors $\varphi_i$ and eigenvalues $E_i$. Then by the spectral theorem we may compute the wave function as a linear combination of these eigenvectors and eigenvalues:
$$\varphi = \sum_i E_i \varphi_i.$$
Now if the Hamiltonian is not independent of time, we use the full and so called time-dependent Schrodinger equation:
$$i\hbar\frac{d}{dt}\varphi = \hat{H}\varphi.$$
My confusion is mainly with the time-dependent case. Since the wave function is unknown a priori, how do we assign an initial condition to it? Also, is my understanding of everything correct?
 A: Given a state $\Phi(x,0)$ at $t=0$ you can always expand in in eigenstates of $H$:
$$
\Phi(x,0)=\sum_k c_k\varphi_k(x)
$$
where the coefficients $c_k$ (they are not $E_k$) are obtained from
\begin{align}
c_k=\int dx \varphi_k^*(x) \Phi(x,0)\, .
\end{align}
The time evolution of $\varphi_k(x)$ is known:
\begin{align}
\Phi_k(x,t)=e^{-i E_k t/\hbar}\varphi_k(x)
\end{align}
so then it’s simply a matter of rewriting
$$
\Phi(x,t)=\sum_k c_k e^{-i E_k t/\hbar}\varphi_k(x)\, . \tag{1}
$$
Since (1) satisfies the BC $\Phi(x,0)=\varphi(x)$, you have the complete time evolution.
A: 
Then by the spectral theorem we may compute the wave function as a linear combination of these eigenvectors and eigenvalues:
$$\varphi = \sum_i E_i \varphi_i.$$

No, this is not what one usually does. If the functions $\varphi_i(x)$ are complete then any function can be written as a linear combination of them:
$$
f(x) = \sum_i a_i \varphi_i(x)\;, \qquad (1)
$$
where, if we assume the functions $\varphi_i$ are also orthonormal, we can also write:
$$
a_i = \int dx \varphi_i^*(x) f(x)\;.
$$

Now if the Hamiltonian is not independent of time, we use the full and so called time-dependent Schrodinger equation:
$$i\hbar\frac{d}{dt}\varphi = \hat{H}\varphi.$$
My confusion is mainly with the time-dependent case. Since the wave function is unknown a priori, how do we assign an initial condition to it? Also, is my understanding of everything correct?

The whole problem of the time-dependent Schrödinger equation is to solve for $\varphi(x,t)$. If you happen to already know the $\varphi_i(x)$ then you can expand $\varphi(x,t)$ in terms of the $\varphi_i$ at any given time $t$. So the coefficients in the above expansion Eq. (1) are time dependent like:
$$
\varphi(x,t)= \sum_i c_i(t)\varphi_i(x)\;,\qquad (2)
$$
where I'm now calling the expansion coefficients $c_i(t)$ instead of $a_i$.

Update:
Just to add a little more explanation. The reason you want to make this expansion is because, now you can reduce the problem of a partial differential equation in two variables to a single-variable differential equation by plugging in the expansion on both sides of Eq. (2).
Eq. (2) becomes:
$$
i\hbar\sum_j \phi_j(x)\frac{dc_i}{dt} = \sum_k E_k \phi_k(x)c_k\;.
$$
Then use the orthogonality of the $\phi_i$ to see that each of the time-dependent coefficients has to satisfy:
$$
i\hbar \frac{dc_i}{dt} = E_ic_i(t)\;,
$$
which is a well-known single-variable (ordinary) differential equation and can be solved immediately as:
$$
c_i(t) = e^{-iE_i t/\hbar}c_i(0)\;,
$$
where the $c_i(0)$ are constants that are part of the problem statement for any specific problem you would want to solve.
The general solution to the time-dependent equation then takes the form:
$$
\varphi(x,t) = \sum_i e^{-i E_i t/\hbar}c_i(0)\phi_i(x)\;.\qquad (3)
$$
For example, you might be told that the wave function starts out at time $t=0$ already in some specific eigenstate (e.g., $\phi_2$). This isn't a very interesting case since if it starts out in an eigenstate it just stays in that same eigenstate.
A slightly less boring example would be that if at time $t=0$ we knew the the state was prepared as a mixture of, say, 50% $\phi_1$ and 50% $\psi_2$, with no relative phase. Then, if we solve the time-independent equation and we know what $E_1$ and $E_2$ are we can solve for how the full wavefunction changes with time. In this example we would see:
$$
\varphi(x,t)_{this example} = \frac{1}{\sqrt{2}}e^{-iE_1 t/\hbar}\phi_1(x) +\frac{1}{\sqrt{2}}e^{-iE_2 t/\hbar}\phi_2(x)
$$
The initial coefficients (e.g., $|c_1|^2=0.5$ and $|c_2|^2=0.5$ in the example directly above) are given as part of each specific problem to be solved.

Another Update

Since the wave function is unknown a priori, how do we assign an initial condition to it?

The wave function can not be completely unknown a priori otherwise there would be no way to solve the Schrödinger equation. We must be provided some initial condition, or there is no way to completely determine the solution in any specific case.
As one final example, suppose someone has figured out how to "prepare" a systems such that
$$
\varphi(x, t=0) = e^{-\pi x^2/2}\;.
$$
The above equation is an example of the initial condition we need.
Then we know, using the general form of the solution Eq. (3), that at $t=0$:
$$
\varphi(x, t=0) = e^{-\pi x^2/2} = \sum_i c_i(0)\phi_i(x)\;,
$$
and so:
$$
c_i(0) = \int dx \phi_i^*(x) e^{-\pi x^2/2}\;.
$$
Thus, given that we know the $\phi_i(x)$, the $c_i(0)$ can be determined for this example and so too the entire wavefunction $\varphi(x, t)$ for all space and time.
