\documentclass{beamer} %\usepackage{beamerarticle} % For handout, or use article/usepackage{beamerarticle} %\documentclass[handout]{beamer} \usepackage{amsmath,amssymb} \usepackage{graphicx} \usepackage{hyperref} \usepackage{multimedia} %\usepackage{tabularx} %\usepackage{algorithm, algorithmic} \usepackage{algorithm2e} \usepackage{algorithmic} %\usepackage{deluxetable} %\usepackage{natbib} \mode { \usetheme{CambridgeUS} %default, CambridgeUS, Warsaw % \usecolortheme{beaver} % seahorse, rose, beaver \useoutertheme{infolines} \usefonttheme[onlysmall]{structurebold} %\usefonttheme[onlylarge]{structuresmallcapsserif} \setbeamerfont{title}{shap*={\textsc}} \setbeamerfont{frametitle}{size=\large,series=\bfseries} \setbeamertemplate{navigation symbols}{} \setbeamertemplate{title page}[default][rounded=true,shadow=beamer@themerounded@shadow] \setbeamercovered{transparent} \setbeamercolor{frametitle}{bg=white, fg=black} %\setbeamertemplate{headline}[default]{} \setbeamertemplate{headline} { \hbox{ \begin{beamercolorbox}[wd=\textwidth,ht=2.25ex,dp=1ex]{} \usebeamerfont{section in head/foot} \hfill\insertsection%\insertnavigation{\paperwidth} \hspace*{2em} \end{beamercolorbox} } \hbox{ \begin{beamercolorbox}[ht=0.5ex]{section in head/foot} \end{beamercolorbox} } \vskip2pt } %% From beamerouterthemeinfolines.sty \setbeamertemplate{footline} { \hbox{% \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex]{date in head/foot}% \hspace*{2em}\insertshorttitle \hfill \usebeamerfont{author in head/foot} \insertshortauthor~~ %(\insertshortinstitute) \hspace*{2em} \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em} \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} \end{beamercolorbox}}% \vskip0pt% } } \usepackage[english]{babel} \usepackage{times} \usepackage[T1]{fontenc} \pgfdeclaremask{tu}{iusealredonwhite-mask} \pgfdeclareimage[mask=tu,height=.8cm]{logo}{iusealredonwhite} \logo{\pgfuseimage{logo}} \title{Python Tutorial} \author[B. Zaitlen]{Benjamin L. Zaitlen %{\tt bzaitlen@indiana.edu} } \institute{Biocomplexity Institute, Indiana University} %\date{} %\author[Author, Another] % (optional, use only with lots of authors) %\author{Lingyun Yang\inst{1} \and S.~Y.~Lee\inst{2}} % - Give the names in the same order as the appear in the paper. % - Use the \inst{?} command only if the authors have different % affiliation. %\institute[Indiana Universities] % (optional, but mostly needed) %{ % \inst{1}% % Department of Physics\\ % Indiana University % \and % \inst{2}% % IUCF\\ % Indiana University} % - Use the \inst command only if there are several affiliations. % - Keep it simple, no one is interested in your street address. \begin{document} \begin{frame}[plain] \setbeamercolor{title}{fg=red!80!black,bg=black!10!white} %\setbeamerfont{title}{shape=\itshape,family=\rmfamily} \titlepage \end{frame} \section[Outline]{} \begin{frame}[label=toc] \tableofcontents \end{frame} \section{Introduction} \begin{frame} \frametitle{Introduction} \begin{itemize}[<+->] \item Computational Science is another approach besides experimental and theoretical. \item Some simulations need a lot of computing power. \item Distributed computing is practical an economical way. \item Some algorithm/physics model widely used are easily parallelized: \begin{enumerate} \item Monte Carlo (Ising model, particle generating and tracking) \item Simulated Anealing (Ising model) \item Lattice QCD \end{enumerate} \end{itemize} \end{frame} \section{The Terminal and The Editor} \begin{frame} \frametitle{Open Two Terminals and Xcode} \begin{itemize}[<+->] \item Start terminal Finder->Applications->Utilities->Terminal (Double Click) \item Start Xcode Finder->Developer->Applications->Xcode \begin{itemize} \item File->New File->Python Tool->Name file strings.py \end{itemize} \end{itemize} \includegraphics[width=6cm]{setup.png} \end{frame} \section{The Terminal and The Interpreter} \begin{frame} \frametitle{Opening the Terminal and Basic Unix} \begin{itemize}[<+->] \item Start terminal Finder->Applications->Utilities->Terminal (Double Click) \item \end{itemize} \end{frame} \section{Strings and Numbers} \begin{frame} \frametitle{Strings} \begin{itemize} \item{A simple string "hello world"} \item{Concatenation "hello"+"world" $\to$ "hello world"} \item{Repetition "hello"*3 $\to$ "hellohellohello"} \item{Indexing "world"[3] $\to$ "l"} \begin{itemize} \item{Note: python lists are zero-offset} \end{itemize} \item{Searching "o" in "hello" $\to$ True} \end{itemize} \end{frame} \begin{frame} \frametitle{Numbers} \begin{itemize} \item{Basic math notation: 1.4, 2+2, 2**10} \begin{itemize}[<+->] \item{Note: Integer division floors values: 2/3 $\to$ 0, 2./3 $\to$ .6666} \end{itemize} \item{Math functions require import of math} \begin{itemize} \item{import math} \item{math.sqrt(4) $\to$ 2.0} \end{itemize} \end{itemize} \end{frame} %\section{Epithelium} %\begin{frame} % \frametitle{Images} % % \begin{columns} % \begin{column}[T]{4cm} %\includegraphics[scale=0.30]{images/CPM_lattice.pdf} %\begin{itemize} % \item{Energy minimization formalism - extended by Graner and Glazier, 1992} %\end{itemize} % \end{column} % \begin{column}[T]{6cm} % \begin{itemize} % \item{Example of Potts model with 6 cells and 4 cell types.} % \item{Colors->cell type} % \item{Pixel Number->cell id} % % \end{itemize} % \end{column} % \end{columns} % % %\end{frame} %\section{Ising Model} %\section{Monte Carlo Simulation and Metropolis Algorithm} %\begin{frame}[t] % \frametitle{Monte Carlo Simulation and Metropolis Algorithm} % % \begin{itemize} % \item Randomly move from one state to another. % \item Probability at state $S$: % \begin{equation} % \label{eq:probability} % %P(S)=\frac{e^{\displaystyle -\frac{E(S)}{kT}}}{\sum_{A}e^{\displaystyle -\frac{E(A)}{kT}}} % P(S)=\frac{e^{-E(S)/kT}}{\sum_{A}e^{-E(A)/kT}} % \end{equation} % \item Probability of moving to next state: % \begin{equation} % \label{eq:probability:move} % \frac{P(S_{\textrm{after}})}{P(S_{\textrm{before}})} % = e^{-\Delta E/kT} % \end{equation} % where $\Delta E=E_{\textrm{after}}-E_{\textrm{before}}$ % \item Accept one step with probability: % \begin{equation} % \label{eq:metropolis} % P_{\textrm{accept}}=\min\{1, \frac{P(S_{\textrm{after}})}{P(S_{\textrm{before}})}\} % \end{equation} % \end{itemize} %\end{frame} %\begin{frame}[t] %\frametitle{Metropolis Algorithm} %\vskip-1cm %\begin{algorithm} % % \caption{Metropolis Algorithm} % \begin{algorithmic}[1] % \STATE Initialization, Sweep. % \STATE Compute $E_0$. % \STATE Randomly flip one site. % \STATE Compute $E_1$ and $\Delta E=E_1-E_0$. % \IF{$E_11$)} % \STATE Keep $E_1$ % \ELSE % \STATE Keep $E_1$ with probability $\textrm{rand}()