pre meeting

This commit is contained in:
Daniel Knüttel 2020-04-21 12:41:03 +02:00
parent 91577ef2b6
commit 1a24ef8ddf
3 changed files with 25 additions and 15 deletions

View File

@ -309,8 +309,8 @@
\begin{frame}{Example: The $5$ Qbit EPR State}
\begin{itemize}
\item{Start from $\ket{0}^{\otimes n}$.}
\item{Get to the state $\ket{\psi} = \frac{\ket{0}^{\otimes n} + \ket{1}^{\otimes n}}{\sqrt{2}}$.}
\item{Start from $\ket{0}^{\otimes 5}$.}
\item{Get to the state $\ket{\psi} = \frac{\ket{0}^{\otimes 5} + \ket{1}^{\otimes 5}}{\sqrt{2}}$.}
\item{Use the circuit \\
\[
\Qcircuit @C=1em @R=.7em {
@ -319,12 +319,12 @@
& \qw & \qw & \qw & \gate{X} & \qw & \qw & \qw & \qw &\qw \\
& \qw & \qw & \qw & \qw & \qw & \gate{X} & \qw & \qw &\qw \\
& \qw & \qw & \qw & \qw & \qw & \qw & \qw & \gate{X} &\qw \\
}
}.
\]
}
\item{The state has the form
\begin{equation}
\ket{\psi} = \left(\prod\limits_{1 < i < 5} CX_{i,0}\right) H_0 \ket{0}.
\ket{\psi} = \left(\prod\limits_{1 < i < 5} CX_{i,0}\right) H_0 \ket{0}^{\otimes 5}.
\end{equation}}
\end{itemize}
\end{frame}
@ -342,10 +342,10 @@
& \gate{H} & \qw & \qw & \gate{Z} & \qw & \qw & \qw & \qw & \gate{H} &\qw \\
& \gate{H} & \qw & \qw & \qw & \qw & \gate{Z} & \qw & \qw & \gate{H} &\qw \\
& \gate{H} & \qw & \qw & \qw & \qw & \qw & \qw & \gate{Z} & \gate{H} &\qw \\
}
}.
\]
}
\item{Switching from starting state $\ket{0}^{\otimes n}$ to $\ket{+}^{\otimes n}$ gives the
\item{Switching from starting state $\ket{0}^{\otimes 5}$ to $\ket{+}^{\otimes 5}$ gives the
graphical representation.}
\end{itemize}
@ -465,6 +465,8 @@
\item{
If just one vertex operator has been cleared the other vertex is isolated
and one can precompute all resulting states.}
\item{One can show that the probability amplitudes when measuring a qbit of a graphical state
are either $0$, $1$ or $\frac{1}{2}$.}
\end{itemize}
\end{frame}
}
@ -500,8 +502,10 @@
\item{To increase simulation efficiency the core of both simulators has been
implemented in \lstinline{C}.}
\item{The dense vector states are stored in \lstinline{numpy} arrays.}
\item{The graph is stored in an length $n$ array of linked lists. The vertex operators
are stored in a \lstinline{uint8_t} array.}
\item{The graph is stored in an length $n$ array of linked lists.}
\item{The vertex operators are local Clifford operators. The local Clifford
group as $24$ elements, they are represented by integers
stored in a \lstinline{uint8_t} array.}
\end{itemize}
\end{frame}
}

View File

@ -16,7 +16,7 @@ def Mi(nqbits, i, M):
def H_interaction(nqbits):
interaction_terms = [Mi(nqbits, i, Z) @ Mi(nqbits, i+1, Z) for i in range(nqbits)]
interaction_terms = [Mi(nqbits, i, Z) @ Mi(nqbits, i+1, Z) for i in range(nqbits - 1)]
return sum(interaction_terms)
def H_field(nqbits, g):

View File

@ -20,8 +20,8 @@ matplotlib.rcParams.update(
nqbits = 6
g = 3
N_trot = 80
t_stop = 9
delta_t = 0.09
t_stop = 29
delta_t = 0.1
qbits = list(range(nqbits))
n_sample = 2200
@ -49,8 +49,8 @@ for t in np.arange(0, t_stop, delta_t):
errors_sampling.append(bootstrap(result[0], n_sample, n_sample, n_sample // 2, np.average))
#amplitude = np.sum(np.abs(state._qm_state[measure_coefficient_mask])**2)
#amplitudes_qc.append(amplitude)
amplitude = np.sum(np.abs(state._qm_state[measure_coefficient_mask])**2)
amplitudes_qc.append(amplitude)
# Simulation using matrices
np_zero_state = np.zeros(2**nqbits)
@ -68,11 +68,17 @@ print()
print("done.")
results_qc = np.array(results_qc)
amplitudes_qc = np.array(amplitudes_qc)
errors_trotter = (np.arange(0, t_stop, delta_t) * g)**3 / N_trot**3
errors_trotter = (np.arange(0, t_stop, delta_t))**3 / N_trot**3
errors_sampling = np.array(errors_sampling)
#errors_sampling = np.abs(results_qc - amplitudes_qc)
#errors_sampling = (amplitudes_qc * (1 - amplitudes_qc))**2 / n_sample
#hm1 = plt.errorbar(np.arange(0, t_stop, delta_t)
# , results_qc
# , yerr=(errors_sampling + errors_trotter)
# , color="red")
h0 = plt.errorbar(np.arange(0, t_stop, delta_t)
, results_qc
, yerr=errors_sampling