\section{Accelerated Sampling Methods}
\label{section:accel}

\subsection{Accelerated Molecular Dynamics}
\label{section:accelmd}
Accelerated molecular dynamics (aMD)~\cite{HAME2004mc} is an enhanced-sampling method that
improves the conformational space sampling by
reducing energy barriers separating different states of a system.
The method modifies the potential
energy landscape by raising energy wells that are below
a certain threshold level, while leaving those above this level unaffected.
As a result, barriers separating adjacent energy basins are reduced, allowing the system to sample
conformational space that cannot be easily accessed in a classical MD simulation.

Please include the following two references in your work using the NAMD implementation of aMD:
\begin{itemize}
  \item {Accelerated Molecular Dynamics: A Promising and Efficient Simulation Method for Biomolecules, D.\,Hamelberg, J.\,Mongan, and J.\,A. McCammon. {\it J. Chem. Phys.}, 120:11919-11929, 2004.}
  \item{Implementation of Accelerated Molecular Dynamics in NAMD, Y.\,Wang, C.\,Harrison, K.\,Schulten, and J.\,A. McCammon, {\it Comp.~Sci.~Discov.}, 4:015002, 2011.}
\end{itemize}

\subsubsection{Theoretical background}
In the original form of aMD~\cite{HAME2004mc}, when the system's potential energy falls
below a threshold energy, $E$, a boost potential is added,
such that the modified potential, $V^*({\bf r})$, is related to the original
potential, $V({\bf r})$, via
\begin{equation}
V^*({\bf r})= V({\bf r}) + \Delta V({\bf r}),
\end{equation}
where $\Delta V({\bf r})$ is the boost potential,
\begin{equation}
\Delta V({\bf r})= \left \{
\begin{array}{l l}
0   & \quad \quad V({\bf r})\geq E \\
\frac{(E-V({\bf r}))^2}{\alpha+E-V({\bf r})}  & \quad \quad V({\bf r})<E. \\
\end{array} \right.
\end{equation}
As shown in the following figure, the threshold energy $E$ controls the portion of
the potential surface affected by the boost, while the acceleration factor
$\alpha$ determines the shape of the modified potential.
%as $\alpha$ increases, the modified potential asymptotically approaches the original potential;
%as $\alpha$ decreases, the energy surface below $E$ begins to resemble a constant potential.
Note that $\alpha$ cannot be set to zero, otherwise the derivative of the modified potential
is discontinuous.

\begin{figure}[!ht]
  \centering
  \includegraphics[width=7cm]{figures/amd_schematic.jpg}
  \caption{Schematics of the aMD method. When the original potential (thick line) falls below a threshold energy $E$ (dashed line),
          a boost potential is added. The modified energy profiles (thin lines) have smaller barriers separating adjacent
	  energy basins.
	  %Two parameters, $E$ and $\alpha$, controls the portion of the affected potential landscape and the
	  %shape of the modified potential, respectively.
	  }
  \label{fig:amd_schematic}
\end{figure}
From an aMD simulation, the ensemble average, $\langle A \rangle$, of an observable, $A({\bf r})$, can be calculated
using the following reweighting procedure:
\begin{equation}
\langle A \rangle =\frac{\langle A({\bf r})\,\text{exp} (\beta \Delta V({\bf r})) \rangle^* }
{\langle \text{exp}  (\beta \Delta V({\bf r})) \rangle^*},
\end{equation}
in which $\beta$=$1/k_BT$, and $\langle ... \rangle$ and $\langle...\rangle^*$ represent
the ensemble average in the original and the aMD ensembles, respectively.

Currently, aMD can be applied in three modes in NAMD: aMDd, aMDT, and aMDdual~\cite{WANG2011mc}. The boost energy
is applied to the dihedral potential in the aMDd mode (the default mode), and to the total potential in the aMDT mode.
In the dual boost mode (aMDdual)~\cite{HAME2007mc}, two independent boost energies are applied, one on the dihedral potential and the other
on the (Total - Dihedral) potential.

\subsubsection{NAMD parameters}

The following parameters are used to enable accelerated MD:

\begin{itemize}

\item
\NAMDCONFWDEF{accelMD}{Is accelerated molecular dynamics active?}{{\tt on} or {\tt
off}}{{\tt off}}
{Specifies if accelerated MD is active.}

\item
\NAMDCONFWDEF{accelMDdihe}{Apply boost to dihedrals?}{{\tt on} or {\tt off}} {{\tt on}}
{Only applies boost to the dihedral potential.
By default, {\tt accelMDdihe} is turned on and the boost energy is applied to the dihedral potential of the simulated system.
When {\tt accelMDdihe} is turned off, aMD switches to the {\tt accelMDT} mode, and the boost is applied to the total potential.
}

\item
\NAMDCONF{accelMDE}{Threshold energy $E$}
{Real number}
{Specifies the threshold energy $E$ in the aMD equations.
}

\item
\NAMDCONF{accelMDalpha}{Acceleration factor $\alpha$}
{Positive real number}
{Specifies the acceleration factor $\alpha$ in the aMD equations.
}

\item
\NAMDCONFWDEF{accelMDdual}{Use dual boost mode?}{{\tt on} or {\tt off}}{{\tt off}}
{When {\tt accelMDdual} is on, aMD switches to the dual boost mode. Two independent boost potentials
will be applied: one to the dihedral potential that is controlled by the parameters {\tt accelMDE} and {\tt accelMDalpha},
and a second to the (Total - Dihedral) potential that is controlled by the  {\tt accelMDTE} and {\tt accelMDTalpha} parameters described below.
}

\item
\NAMDCONF{accelMDTE}{Threshold energy $E$ in the dual boost mode}
{Real number}
{Specifies the threshold energy $E$ used in the calculation of boost energy for the (Total - Dihedral) potential.
This option is only available when {\tt accelMDdual} is turned on.
}

\item
\NAMDCONF{accelMDTalpha}{Acceleration factor $\alpha$ in the dual boost mode}
{Positive real number}
{Specifies the acceleration factor $\alpha$ used in the calculation of boost energy for the (Total - Dihedral) potential.
This option is only available when {\tt accelMDdual} is turned on.
}

\item
\NAMDCONFWDEF{accelMDFirstStep}{First accelerated MD step}
{Zero or positive integer}{0}
{Accelerated MD will only be performed when the current step is equal to or higher than {\tt accelMDFirstStep}, and equal to or lower than {\tt accelMDLastStep}. Otherwise regular MD will be performed.
}
\item
\NAMDCONFWDEF{accelMDLastStep}{Last accelerated MD step}
{Zero or positive integer}{0}
{Accelerated MD will only be performed when the current step is equal to or higher than {\tt accelMDFirstStep}, and equal to or lower than {\tt accelMDLastStep}. Otherwise regular MD will be performed. Note that the accelMDLastStep parameter only has an effect when it is positive. When accelMDLastStep is set to zero (the default), aMD is `open-ended' and will be performed
till the end of the simulation.
}

\item
\NAMDCONFWDEF{accelMDOutFreq}{Frequency in steps of aMD output}
{Positive integer}{1}
{An aMD output line will be printed to the log file at the frequency specified by {\tt accelMDOutFreq}.
The aMD output will contain the boost potential ($dV$) at the current timestep,
the average boost potential ($dVAVG$) since the last aMD output, and various potential energy values at the current timestep.
The boost potential $dV$ can be used to reconstruct the ensemble average described earlier.
}

\end{itemize}

\subsection{Adaptive Tempering}
\label{section:adapttemp}
Adaptive tempering is akin to a single-copy replica exchange method for dynamically updating the simulation temperature. The temperature $T$ is a new random variable in the range $[Tmin,Tmax]$ that is governed by the equation $dE/dT = E-E(T)-1/T+sqrt(2)T\xi$, where $\xi$ is Gaussian white noise. The effect is that when the potential energy for a given structure is lower than the (so far calculated) average energy, the temperature is lowered. Conversely when the current energy is higher than the average energy, the temperature is raised. The effect is faster conformational sampling to find minimum energy structures. The method is implemented exactly as described by Zhang and Ma in J. Chem. Phys. 132, 244101 (2010) (using Equation 18 of their paper to calculate the average energy at a given temperature from the histogram of energies).

The dynamic temperature is realized either by changing the temperature of the Langevin thermostat or by velocity rescaling.

\subsubsection{NAMD parameters}

The following parameters are used to adaptive tempering:

\begin{itemize}

\item
\NAMDCONFWDEF{adaptTempMD}{Is adaptive tempering active?}{{\tt on} or {\tt
off}}{{\tt off}}
{Specifies whether or not adaptive tempering is used. If set to on then the following parameters are required to be set: either all of ({\tt adaptTempTmin}, {\tt adaptTempTmax}, {\tt adaptTempBins}, {\tt adaptTempDt}) or {\tt adaptTempInFile} (but not both).
}

\item
\NAMDCONFWDEF{adaptTempFreq}{steps between temperature updates}
{Positive integers}{10}
{The number of steps between temperature updates. Note that the potential energy at the current is calculated and added to the temperature-energy histogram at every step.
}

\item
\NAMDCONF{adaptTempTmin}{minimum temperature (K)}
{Positive real number}
{Sets the minimum temperature to be used in the simulation.
}

\item
\NAMDCONF{adaptTempTmax}{maximum temperature (K)}
{Positive real number}
{Sets the maximum temperature to be used in the simulation.
}

\item
\NAMDCONFWDEF{adaptTempBins}{number of temperature bins}
{Positive integer}{1000}
{Sets the number of bins to subdivide the temperature range. Each bin stores the average energy for the given temperature
}

\item
\NAMDCONFWDEF{adaptTempDt}{stepsize for temperature updates}{Positive real numbers}{$10^{-4}$}
{Integration timestep for temperature updates. This is unrelated to the simulation timestep and only scales the size of the step taken in temperature space every {\tt adaptTempFreq} steps.
}

\item
\NAMDCONF{adaptTempInFile}{adaptive tempering input filename}
{UNIX filename}
{The input file containing restart information for adaptive tempering (written out by {\tt adaptTempRestartFile}).
}

\item
\NAMDCONF{adaptTempRestartFile}{adaptive tempering restart filename}
{UNIX filename}
{The file to write out restart information for adaptive tempering.
}

\item
\NAMDCONF{adaptTempRestartFreq}{steps between writing restart file}
{Positive integer}
{Frequency of writing restart file.
}

\item
\NAMDCONFWDEF{adaptTempLangevin}{send temperature updates to langevin thermostat?}
{{\tt on} or {\tt off}}{{\tt on}}
{Setting this to on will cause the langevin thermostat to use the updated temperatures from adaptive tempering. Note that either one of adaptTempLangevin or adaptTempRescaling have to be on.
}

\item
\NAMDCONFWDEF{adaptTempRescaling}{send temperature to velocity rescaling thermostat?}
{{\tt on} or {\tt off}}{{\tt on}}
{Setting this to on will cause the veloctiy rescaling thermostat to use the updated temperatures from adaptive tempering.  Note that either one of adaptTempLangevin or adaptTempRescaling have to be on.
}

\item
\NAMDCONFWDEF{adaptTempOutFreq}{steps between printing adaptive tempering output}
{Positive integers}{10}
{The number of timesteps between printing adaptive tempering output to the log file.
}

\item
\NAMDCONFWDEF{adaptTempFirstStep}{step to start adaptive tempering}
{Non-negative integers}{0}
{The first timestep from which adaptive tempering will be run.}

\item
\NAMDCONF{adaptTempLastStep}{step to stop adaptive tempering}
{Positive integers}
{The last timestep to apply adaptive tempering.}

\item
\NAMDCONFWDEF{adaptTempCgamma}{dynamic bin averaging constant}
{Non-negative real number}{0.1}
{The calculation of the mean energy for a given bin is weighted by a factor of 1 - Cgamma / samples to damp out old statistics. Setting Cgamma to zero restores the use of a standard arithmetic mean to calculate the mean energy for each bin.}

\item
\NAMDCONFWDEF{adaptTempRandom}{assign random temperature if we step out of range?}
{{\tt on} or {\tt off}}{{\tt off}}
{If set to on and the temperature steps out of [{\tt adaptTempTmin}, {\tt adaptTempTmax}], a random temperature in that range is assigned. Otherwise the previous temperature is kept.
}

%\item
%\NAMDCONFWDEF{adaptTempDebug}{print debug output?}
%{{\tt on} or {\tt off}}{{\tt off}}
%{Print adaptive tempering debug output.
%}

\end{itemize}

\subsection{Locally enhanced sampling}
\label{section:les}

Locally enhanced sampling (LES)~\cite{ROIT91,SIMM98,SIMM00} increases
sampling and transition rates for a portion of a molecule by the use of
multiple non-interacting copies of the enhanced atoms.  These enhanced
atoms experience an interaction (electrostatics, van der Waals, and
covalent) potential that is divided by the number of copies present.
In this way the enhanced atoms can occupy the same space, while the
multiple instances and reduces barriers increase transition rates.

\subsubsection{Structure generation}

To use LES, the structure and coordinate input files must be modified to
contain multiple copies of the enhanced atoms.  \PSFGEN\ provides the
{\tt multiply} command for this purpose.  \NAMD\ supports a maximum of 255
copies, which should be sufficient.

Begin by generating the complete molecular structure and guessing
coordinates as described in Sec.~\ref{section:psfgen}.  As the last
operation in your script, prior to writing the psf and pdb files, add
the {\tt multiply} command, specifying the number of copies desired and
listing segments, residues, or atoms to be multiplied.  For example,
\verb#multiply 4 BPTI:56 BPTI:57# will create four copies of the last
two residues of segment BPTI.  You must include all atoms to be
enhanced in a single {\tt multiply} command in order for the bonded
terms in the psf file to be duplicated correctly.  Calling {\tt multiply}
on connected sets of atoms multiple times will produce unpredictable
results, as may running other commands after {\tt multiply}.

The enhanced atoms are duplicated exactly in the structure---they have
the same segment, residue, and atom names.  They are distinguished only
by the value of the B (beta) column in the pdb file, which is 0 for
normal atoms and varies from 1 to the number of copies created for
enhanced atoms.  The enhanced atoms may be easily observed in VMD with
the atom selection \verb#beta != 0#.

\subsubsection{Simulation}

In practice, LES is a simple method used to increase sampling;
no special output is generated.
The following parameters are used to enable LES:

\begin{itemize}

\item
\NAMDCONFWDEF{les}{is locally enhanced sampling active?}{{\tt on} or {\tt
off}}{{\tt off}}
{Specifies whether or not LES is active.}

\NAMDCONF{lesFactor}{number of LES images to use}
{positive integer equal to the number of images present}
{This should be equal to the factor used in {\tt multiply}
 when creating the structure.  The interaction potentials for images is
 divided by {\tt lesFactor}.
}

\item
\NAMDCONFWDEF{lesReduceTemp}{reduce enhanced atom temperature?}{{\tt on} or {\tt
off}}{{\tt off}}
{Enhanced atoms experience interaction potentials divided by {\tt lesFactor}.
This allows them to enter regions that would not normally be thermally
accessible.  If this is not desired, then the temperature of these atoms
may be reduced to correspond with the reduced potential.  This option
affects velocity initialization, reinititialization, reassignment, and
the target temperature for langevin dynamics.  Langevin dynamics is
recommended with this option, since in a constant energy simulation energy
will flow into the enhanced degrees of freedom until they reach thermal
equilibrium with the rest of the system.  The reduced temperature atoms
will have reduced velocities as well, unless {\tt lesReduceMass} is also
enabled.}

\item
\NAMDCONFWDEF{lesReduceMass}{reduce enhanced atom mass?}{{\tt on} or {\tt off}}{{\tt off}}
{Used with {\tt lesReduceTemp} to restore velocity distribution to
enhanced atoms.  If used alone, enhanced atoms would move faster than
normal atoms, and hence a smaller timestep would be required.}

\item
\NAMDCONFWDEF{lesFile}{PDB file containing LES flags}{UNIX filename} {{\tt coordinates}}
{PDB file to specify the LES image number of each atom.
If this parameter is not specified, then
the PDB file containing initial coordinates specified by
{\tt coordinates} is used.}

\item
\NAMDCONFWDEF{lesCol}{column of PDB file containing LES flags}{{\tt X}, {\tt Y}, {\tt Z}, {\tt O}, or {\tt B}}{{\tt B}}
{Column of the PDB file to specify the LES image number of each atom.
This parameter may specify any of the floating point fields of the PDB file,
either X, Y, Z, occupancy, or beta-coupling (temperature-coupling).
A value of 0 in this column indicates that the atom is not enhanced.
Any other value should be a positive integer less than {\tt lesFactor}.}

\end{itemize}

\subsection{Replica exchange simulations}

\index{replica exchange}
The {\tt lib/replica/}
directory contains Tcl scripts that implement replica exchange
both for parallel tempering (temperature exchange) and
umbrella sampling (exchanging collective variable biases).
This replaces the old Tcl server and socket connections driving a
separate NAMD process for every replica used in the simulation.

{\bf A NAMD build based on Charm++ 6.5.0 or later using one of the
``LRTS'' (low-level runtime system) machine layers is required!}
Current LRTS machine layers include mpi, netlrts, verbs (for InfiniBand),
gemini\_gni-crayxe, gni-crayxc, and pamilrts-bluegeneq.

Only temperature-exchange simulations are described below.
To employ replicas for umbrella sampling you will need to understand
this material, collective variable-based calculations (Sec.\ \ref{section:colvars}),
and basic Tcl programming to adapt the examples in {\tt lib/replica/umbrella/}
and {\tt lib/replica/umbrella2d/} until further
documentation and a tutorial are available.

This implementation is designed to be modified to implement
exchanges of parameters other than temperature or via other temperature
exchange methods.  The scripts should provide a good starting point for
any simulation method requiring a number of loosely interacting systems.

Replica exchanges and energies are recorded in the .history files
written in the output directories.  These can be viewed with, e.g.,
``{\tt xmgrace output/*/*.history}'' and processed via awk or other tools.
There is also a script to load the output into VMD and color each
frame according to replica index.  An example simulation folds
a 66-atom model of a deca-alanine helix in about 10\,ns.

{\tt replica.namd}
is the master script for replica temperature-exchange simulations.  To run:
\begin{verbatim}
          cd example
          mkdir output
          (cd output; mkdir 0 1 2 3 4 5 6 7)
          mpirun namd2 +replicas 8 job0.conf +stdout output/%d/job0.%d.log
          mpirun namd2 +replicas 8 job1.conf +stdout output/%d/job1.%d.log
\end{verbatim}

The number of MPI ranks must be a multiple of the number of replicas
(+replicas).  Be sure to increment jobX for +stdout option on command line.

{\tt show\_replicas.vmd} is a script for loading replicas into VMD;
first source the replica exchange conf file and then this script, then
repeat for each restart conf file or for example just do
``{\tt vmd -e load\_all.vmd}''.
This script will likely destroy anything else you are doing in VMD at the
time, so it is best to start with a fresh VMD.
{\tt clone\_reps.vmd} provides the {\tt clone\_reps} commmand to copy graphical
representation from the top molecule to all other molecules.

{\tt sortreplicas}, found in the namd2 binary directory, is a program to un-shuffle
replica trajectories to place same-temperature frames in the same file.
Usage:
\begin{verbatim}
  sortreplicas <job_output_root> <num_replicas> <runs_per_frame> [final_step]
\end{verbatim}
where job\_output\_root is the job specific output base path, including
\%s or \%d for separate directories as in output/\%s/fold\_alanin.job1
This will be extended with .\%d.dcd .\%d.history for input files and
.\%d.sort.dcd .\%d.sort.history for output files.  The optional final\_step
parameter will truncate all output files after the specified step,
which is useful in dealing with restarts from runs that did not complete.
Colvars trajectory files are similarly processed if they are found.

A replica exchange config file should define the following Tcl variables:
\begin{itemize}
\item {\tt num\_replicas}, the number of replica simulations to use,
\item {\tt min\_temp}, the lowest replica target temperature,
\item {\tt max\_temp}, the highest replica target temperature,
\item {\tt steps\_per\_run}, the number of steps between exchange attempts,
\item {\tt num\_runs}, the number of runs before stopping
(should be divisible by {\tt runs\_per\_frame} $\times$ {\tt frames\_per\_restart}).
\item {\tt runs\_per\_frame}, the number of runs between trajectory outputs,
\item {\tt frames\_per\_restart}, the number of frames between restart outputs,

\item {\tt namd\_config\_file}, the NAMD config file containing all parameters,
needed for the simulation except {\tt seed}, {\tt langevin},
{\tt langevinTemp}, {\tt outputEnergies},
{\tt outputname}, {\tt dcdFreq},
{\tt temperature}, {\tt bincoordinates}, {\tt binvelocities},
or {\tt extendedSystem}, which are provided by {\tt replica.namd},

\item {\tt output\_root}, the directory/fileroot for output files,
optionally including a ``\%s'' that is replaced with the replica index
to use multiple output directories,

\item {\tt psf\_file}, the psf file for {\tt show\_replicas.vmd},
\item {\tt initial\_pdb\_file}, the initial coordinate pdb file for {\tt show\_replicas.vmd},
\item {\tt fit\_pdb\_file}, the coodinates that frames are fit to by {\tt show\_replicas.vmd} (e.g., a folded structure),
\end{itemize}

The {\tt lib/replica/example/} directory contains
all files needed to fold a 66-atom model of a deca-alanine helix:
\begin{itemize}
\item {\tt alanin\_base.namd}, basic config options for NAMD,
\item {\tt alanin.params}, parameters,
\item {\tt alanin.psf}, structure,
\item {\tt unfolded.pdb}, initial coordinates,
\item {\tt alanin.pdb}, folded structure for fitting in {\tt show\_replicas.vmd},
\item {\tt fold\_alanin.conf}, config file for {\tt replica\_exchange.tcl} script,
\item {\tt job0.conf}, config file to start alanin folding for 10\,ns,
\item {\tt job1.conf}, config file to continue alanin folding another 10\,ns, and
\item {\tt load\_all.vmd}, load all output into VMD and color by replica index.
\end{itemize}

The {\tt fold\_alanin.conf} config file contains the following settings:
\begin{verbatim}
set num_replicas 8
set min_temp 300
set max_temp 600
set steps_per_run 1000
set num_runs 10000
# num_runs should be divisible by runs_per_frame * frames_per_restart
set runs_per_frame 10
set frames_per_restart 10
set namd_config_file "alanin_base.namd"
set output_root "output/%s/fold_alanin" ; # directories must exist

# the following used only by show_replicas.vmd
set psf_file "alanin.psf"
set initial_pdb_file "unfolded.pdb"
set fit_pdb_file "alanin.pdb"
\end{verbatim}

\subsection{Random acceleration molecular dynamics simulations}

The "lib/ramd" directory stores the tcl scripts and the example files for the implementation of the Random Acceleration Molecular Dynamics (RAMD) simulation method in NAMD.
The RAMD method can be used to carry out molecular dynamics (MD) simulations with an additional randomly oriented acceleration applied to the center of mass of one group of atoms (referred below as "ligand") in the system.
It can, for example, be used to identify egress routes for a ligand from a buried protein binding site.
Since its original implementation in the ARGOS (ref 1, 2) program, the method has been also implemented in AMBER 8 (ref 3), and CHARMM (ref 4).
The first implementation of RAMD in NAMD using a tcl script (available as supplementary material in ref 6) provided only limited functionality compared to the AMBER 8 implementation.

In the current implementation, the RAMD method can be performed in 2 flavors: (i) "pure RAMD simulations" in which the randomly-oriented acceleration is applied continuously, and (ii) "combined RAMD-MD simulations" in which RAMD steps alternate with standard MD steps.
Additional information is found in the README file in the "lib/ramd" directory.
The user is encouraged to carefully read this information before starting production runs.

The three required scripts are stored in "lib/ramd/scripts": (i) ramd--4.0.tcl defines the simulation parameters and passes them from the NAMD configuration file to the main script, (ii) "ramd--4.0\_script.tcl" adds the randomly oriented force and performs all related computations, and  (iii) "vectors.tcl" was borrowed from VMD and defines the vector operations used.

Two examples for running the scripts are included in the directory "lib/ramd/examples".
The user is encouraged to read the "README.examples" file provided in the same directory.

In order to turn RAMD on, the line "source /path/to/your/files/ramd--4.0.tcl" should be included in the NAMD configuration file.
Unless the user decides to store the scripts at a different location, the path
"/path/to/your/files" should point to the "lib/ramd/scripts" directory.
Otherwise, the user should make sure that the directory "/path/to/your/files" stores all three scripts described above.

The specific RAMD simulation parameters to be provided in the NAMD configuration file (listed below) should be preceded by the keyword "ramd".
The default values for these parameters are only given as guidance.
They are likely not to be suitable for other systems than those the scripts were tested on.

\begin{itemize}

\item
\NAMDCONFWDEF{ramd debugLevel}{ Set debug level of RAMD} {\tt integer value } {0} { Activates verbose output if set to an integer greater than 0. Should be used only for testing purposes because the very dense output is full of information only relevant for debugging.}

\NAMDCONFWDEF{ramd mdStart}{ Start RAMD-MD with MD or RAMD?} {{\tt yes} or {\tt no}} {{\tt no}} { Specifies if combined RAMD-MD simulation starts with MD or RAMD steps; ignored if pure RAMD simulation is performed.  Should be set to "yes" if initial MD steps are desired.}

\item
\NAMDCONFWDEF{ramd ramdSteps} { Set number steps in RAMD block} {{\tt positive integer}} {{\tt 50}} {Specifies the number of steps in 1 RAMD block; the simulations are evaluated every 'ramdSteps' steps.}

\item
\NAMDCONFWDEF{ramd mdSteps} { Set number steps in MD block} {{\tt positive integer}} {{\tt 0}} {Specifies the number of steps in 1 standard MD block; in combined RAMD-MD simulations, the RAMD blocks are evaluated every 'ramdSteps', the MD blocks every 'mdSteps' steps. Default of 0 gives pure RAMD simulation.}

\item
\NAMDCONFWDEF{ramd accel} {Set acceleration energy} {{\tt positive decimal}} {{\tt 0.25}} {Specifies acceleration in kcal/mol*A*amu to be applied during RAMD step.}

\item
\NAMDCONFWDEF{ramd rMinRamd} {Set threshold for distance traveled RAMD} {{\tt positive decimal}} {{\tt 0.01}} {Specifies a threshold value for the distance in Angstroms traveled by the ligand in 1 RAMD block. In pure RAMD simulations the direction of the acceleration is changed if the ligand traveled less than 'rMinRamd' \AA in the evaluated block. In combined RAMD-MD simulations, a switch from a RAMD block to a standard MD block is applied if the ligand traveled more than 'rMinRamd' \AA in the evaluated block.}

\item
\NAMDCONF{ramd rMinMd} {Set threshold for distance traveled in MD} {{\tt positive decimal}} {Specifies a threshold value for the distance, in Angstroms, traveled by accelerated atoms in 1 standard MD block.  In combined RAMD-MD simulations, a switch from a standard MD block to a RAMD block is applied according to the criteria described in the note below.  Required if 'mdStep' is not 0; ignored if 'mdSteps' is 0.}

\item
\NAMDCONFWDEF{ramd forceOutFreq}{Set frequency of RAMD forces output} {{\tt positive integer}, Must be divisor of both {\tt ramdSteps} and {\tt mdSteps}} {{\tt 0}} { Every 'forceOutFreq' steps, detailed output of forces will be written.}

\item
\NAMDCONFWDEF{ramd maxDist} {Set center of mass separation} {{\tt positive decimal}} {{\tt 50}} { Specifies the distance in Angstroms between the the centers of mass of the ligand and the protein when the simulation is stopped.}

\item
\NAMDCONFWDEF{ramd firstProtAtom} {First index of protein atom} {{\tt positive integer}} {{\tt 1}} { Specifies the index of the first protein atom.}

\item
\NAMDCONF{ramd lastProtAtom} {Last index of protein atom} {{\tt positive atom}} { Specifies the index of the last protein atom. }

\item
\NAMDCONF{ramd firstRamdAtom}{ First index of ligand atom } {{\tt positive integer}} {Specifies the index of the first ligand atom.}

\item
\NAMDCONF{ramd lastRamdAtom}{ Last index of ligand atom } {{\tt positive integer}} {Specifies the index of the last ligand atom. }

\item
\NAMDCONFWDEF{ramd ramdSeed}{Set RAMD seed} {{\tt positive integer}} {{\tt 14253}} {Specifies seed for the random number generator for generation of acceleration directions. Change this parameter if you wish to run different trajectories with identical parameters.}

\end{itemize}

Note:
In combined RAMD-MD simulations, RAMD blocks alternate with standard MD blocks ('ramdSteps' and 'mdSteps' input parameters). The switches between RAMD and MD blocks are decided based on the following parameters: (i) 'd' =  the distance between the protein and ligand centers of mass, (ii) 'dr' = the distance traveled by the ligand in 1 RAMD block, and (iii) 'dm' = the distance traveled by the ligand in 1 MD block. A switch from RAMD to MD is applied if 'dr' $>$ 'rRamdMin'. A switch from MD to RAMD is applied if: (i) 'dm' $<$ 'rMdMin' and 'd' $>$ 0 (acceleration direction is kept from previous RAMD block), (ii) if 'dm' $<$ 'rMdMin' and 'd' $<$ 0 (acceleration direction is changed), (iii) if 'dm' $>$ 'rMdMin' and 'd' $<$ 0 (acceleration direction is changed). In all other case, a switch is not applied.

%References:
%Luedemann, S.K., Lounnas, V. and R. C. Wade. How do Substrates Enter and Products Exit the Buried Active Site of Cytochrome P450cam ? 1. Random Expulsion Molecular Dynamics Investigation of Ligand Access Channels and Mechanisms. J Mol Biol, 303:797-811 (2000).
%Winn,P., Luedemann, S.K., Gauges,R., Lounnas, V. and R. C. Wade. Comparison of the dynamics of substrate access channels in three cytochrome P450s reveals different opening mechanisms and a new functional role for a buried arginine PNAS, 99, 5361-5366 (2002).
%Schleinkofer, K., Sudarko, Winn,P., Luedemann, S.K. and R. C. Wade. Do mammalian cytochrome P450s show multiple ligand access pathways and ligand channelling? EMBO Reports, 6, 584-589 (2005).
%Carlsson, P., Burendahl, S., Nilsson, L. Unbinding of retinoic acid from the retinoic acid receptor by random expulsion molecular dynamics. Biophys. J. 91, 3151-3161 (2006).
%Wang, T., Duan, Y. Chromophore channeling in the G-protein coupled receptor rhodopsin. J. Am. Chem. Soc. 129, 6970-6971 (2007).
%Vashisth, H., Abrams, C.F. Ligand escape pathways and (un)binding free energy calculations for the hexameric insulin-phenol complex. Biophys. J. 95, 4193-4204 (2008).
%Perakyla, M. Ligand unbinding pathways from the vitamin D receptor studied by molecular dynamics simulations. 38, 185-198 (2009).doi:10.1007/s00249-008-0369-x
%Klvana, M. et al. Pathways and Mechanisms for Product Release in the Engineered Haloalkane Dehalogenases Explored Using Classical and Random Acceleration Molecular Dynamics Simulations
J. Mol. Biol. 392, 1339-1356 (2009).
%Pavlova, M. et al. Redesigning dehalogenase access tunnels as a strategy for degrading an anthropogenic substrate Nature Chem. Biol. 5, 727-733 (2009).
%Wang, T., Duan, Y. Ligand entry and exit pathways in the beta2-adrenergic receptor. J. Mol. Biol. 392, 1102-1115 (2009).


\chapter{Holographic Wilson loops}

As discussed in chapter \ref{ch:WilsonLoops}, Wilson loops are important gauge invariant observables
that can play the role of order parameters of the different phases of the gauge theory.
% Being non-local, there are also natural suggestions for their holographic dual.
Let us describe the basic idea that lead to find the holographic dual of Wilson loops,
in the context of AdS/CFT correspondence. We then summarize the results obtained for the Pilch-Warner supergravity.

\section{In the $AdS_5 \times S^5$ background}

\subsection{Fundamental representation}
In the fundamental representation, the (Maldacena-)Wilson loop \eqref{maldacenaWL}
describes the phase of a trajectory of an external quark.
A way to introduce the massive quark is to consider $\mathcal{N}=4$ SYM theory with all the fields in the adjoint representation
of $U(N+1)$ instead.
Then, we break spontaneously the gauge group $U(N+1) \rightarrow U(N) \times U(1)$.
In this way, the off-diagonal states of the scalars that were in the adjoint of $U(N+1)$
become fundamental quarks and anti-quarks in $U(N)$,
which are massive due to the Higgs mechanism.
This is a useful picture because, in string theory,
it is equivalent to separating one D-brane from the original stack of $N+1$ coincident D3-branes.
This produces excited open strings that stretch along the stack and the individual brane,
with the mass proportional to the separation distance.
Since we consider probe quarks (non-dynamical), the brane must be infinitely far away from the stack.
The stretched strings not only source the gauge fields, but by pulling the $N$ branes,
they cause deformation on the branes that are described by the scalar fields in \eqref{maldacenaWL}.
The details of the derivation can be found in the appendix of \cite{Drukker:1999zq}.

Now, let us consider the dual gravitational picture.
The stack gravitates and the near-horizon geometry is $AdS_5 \times S^5$.
Then the position of the single D-brane lays on the conformal boundary of $AdS_5$, i.e. $z\rightarrow 0$,
and sits at a point on $S^5$.
The probe particle moves on the single D-brane.
The Wilson loop operator is then dual to the partition function of fundamental strings in $AdS_5 \times S^5$
whose worldsheets end on the same curve $C$ that defines the Wilson loop at the boundary, \cite{Maldacena:1998im}:
\begin{equation}
 W(C) = \int_{C=\partial \Sigma} DX e^{-S_\text{string}[X]}.
\end{equation}

\begin{figure}[t]
\begin{center}
\includegraphics[width=11cm]{Images/WLcircle.pdf}
\end{center}
\caption{\label{fig:WLcircle} Circular Wilson loop as the minimal worldsheet area $\Sigma$ drawn by string ending in the contour $C$ at the boundary of $AdS_5$. }
\end{figure}

In the 't Hooft limit, which corresponds to classical supergravity limit,
minimizing the bosonic string action is sufficient for the leading order, which is essentially the minimal worldsheet area.
% \begin{equation}
%   W(C) \sim e^{-\sqrt{\lambda} A}.
% \end{equation}
Nevertheless, the area is infinite in $AdS$, hence we must regularize it.
For example, the minimal surface that is dual to the circular Wilson loop in the fundamental representation
is parametrized as
\begin{equation}
 z(r)=\sqrt{R^2-r^2}, \quad r\in[0, R], \quad \phi\in[0, 2\pi].
\end{equation}
This result can be obtained either by minimizing the string Nambu-Goto action \cite{Drukker:1999zq},
% \begin{equation}
%  S_\text{NG} = \dfrac{\sqrt{\lambda}}{2\pi} \int d^2 \sigma e^{\Phi/2} \sqrt{\text{det}}
% \end{equation}
or by exploiting the conformal symmetry, i.e.
mapping the special conformal transformation of the straight line solution \cite{Berenstein:1998ij}.
The induced worldsheet metric, that is the pullback of the background metric $g$ \eqref{metricAdS} in polar coordinates for some $x^i$,
is:
\begin{equation}
 ds^2 = \dfrac{L^2}{z^2}\left((1+z'^2) dr^2 + r^2 d\phi^2 \right).
\end{equation}
Then the on-shell (Nambu-Goto) action gives:
\begin{eqnarray}
 S &=& T_\text{F1} \int \sqrt{\text{det} P[g]}\\
   &=& \dfrac{\sqrt{\lambda}}{2\pi} \int_0^{2\pi} d\phi \int_{0}^{\sqrt{R^2-\epsilon^2}} dr \dfrac{r}{z^2} \sqrt{1+z'^2}\\
   &=& \sqrt{\lambda} \left(\dfrac{R}{\epsilon}-1 \right). \label{minimalAction}
\end{eqnarray}
The correct prescription to regularize the action is to set the boundary cut-off at $z=\epsilon$,
then, we remove the perimeter divergence \cite{Drukker:1999zq}.
This regularization scheme will be used for other cases of Wilson loop dual computations.
The finite remnant in \eqref{minimalAction} matches with the leading order field theory result \eqref{W1holographic}, i.e.
\begin{equation}
 W_1 = e^{\sqrt{\lambda}},
 \quad (N\rightarrow \infty \quad \text{and} \quad \lambda \rightarrow \infty).
\end{equation}

In order to compute the subleading correction
% $\sqrt{2/\pi}\:\lambda^{-3/4}$
in \eqref{W1holographic},
the fermionic contribution must be taken into account.
The full string action to use would be the Green-Schwarz action.
Although it is not fully known in curved background,
its quadratic order is known \cite{Cvetic:1999zs}, which suffices for 1-loop corrections.
Its quartic order was also derived in \cite{Wulff:2013kga}.
Many efforts have been put into finding the subleading correction
\cite{Kruczenski:2008zk, Kristjansen:2012nz, Bergamin:2015vxa, Forini:2015bgo, Faraggi:2016ekd, Forini:2017whz}
but no full matching has been achieved.
The ambiguity in the path integral measure hindered this computation.
% A way to evade it was to use the ratio of Wilson loops, and then the matching was proved for the ratio when expanding for small angles \cite{Forini:2017whz}.

\subsection{Higher rank representations}

The lesson from the fundamental Wilson loop suggests that
the string dual of rank-$k$ representations must be an object that carries $k$ units of the string charge.
Intuitively, if we consider a Wilson loop wrapped $k$ times around the contour (the $k$-fundamental representation),
we would expect the worldsheet to puff up, due to repulsive charges from multiple coincident fundamental strings.
We see that the individual string action is no longer useful in this case.
Instead, we can describe the new object in terms of D-branes with fundamental string charges dissolve in it.
% The charges are the source of a worldvolume electric field in the DBI action (ref).
The worldvolume must also pinch off at the boundary of $AdS_5$,
ending along the curve defined by the Wilson loop, see figure \ref{fig:WLcircle}.
Supersymmetry will then guide us which D-brane configurations are allowed.

\begin{figure}[t]
\begin{center}
\includegraphics[width=11cm]{Images/DbraneWL.pdf}
\end{center}
\caption{\label{fig:DbraneWL} Circular Wilson loop of rank $k$ as a D-brane with $k$ string charges dissolved in it and the worldvolume ends in the contour $C$ at the boundary of $AdS_5$. }
\end{figure}

More generally, \cite{Gomis:2006sb} related supersymmetric Wilson loops of any representation of the gauge group
to a stack of bulk D3-branes or a stack of bulk D5-branes, see figure \ref{fig:YoungTable}.
They proved the correspondence by explicitly integrating out the physics on the D-branes,
which results to a half-BPS Wilson loop insertion in the desired representation in the $\mathcal{N}=4$ SYM path integral.

\begin{figure}[t]
\begin{center}
\includegraphics[width=7cm]{Images/YoungTable.png}
\end{center}
\caption{\label{fig:YoungTable} A generic Young table, taken from \cite{Gomis:2006sb}.
Row $i$ corresponds to a D3-brane with $n_i$ fundamental string charge dissolved in it.
Column $j$ corresponds to a D5-brane with $m_j$ fundamental string charge dissolved in it.
Thus, for symmetric (one row) and antisymmetric (one column) representations,
their rank $k$ corresponds to the string charges a D3-brane and a D5-brane contains.}
\end{figure}

Let us focus on a single D3-brane and a single D5-brane.
Consider first the line element for $AdS_5\times S^5$ is this convenient form:
\begin{equation}
    ds^2 = L^2 \left( du^2 + \cosh^2 u \,d\check{\Omega}^2  + \sinh^2 u \, d\Omega_2^2
  + d\theta^2 + \sin^2 \theta \, d\Omega_4^2 \right),
\end{equation}
where $u\geq 0$, and $\pi \geq \theta \geq 0 $.
$d\check{\Omega}_n^2$ and $d\Omega_n^2$ indicate the line element for $AdS_n$ and $S^n$, respectively.
% and we use global coordinates to parametrize $AdS_2$ line element:
% \begin{equation}
%  d\check{\Omega}^2 =d\chi^2+\sinh^2\chi d\varphi^2, \quad \chi\geq 0, \quad 2 \pi \geq \varphi \geq 0.
% \end{equation}
Using the supersymmetry condition\footnote{
May be up to a sign depending on the conventions.}
\begin{equation}\label{susyCondition}
 \Gamma \epsilon =  \epsilon,
\end{equation}
where $\Gamma$ is the kappa symmetry\footnote{
It is a fermionic local gauge symmetry that is present also in particles and strings.
Its full definition can be found in Paper III.}
projector for the D-brane and $\epsilon$ is the Killing spinor of the background geometry,
we can find the D-brane embeddings that preserve half of the original supersymmetries.
Note that the supersymmetry condition, which gives first order differential equations,
imply the D-brane equations of motions, which are of second order, up to some integration constants.
The list below shows the half-BPS D-brane embeddings with their worldvolume geometries
induced from the target space, and the worldvolume gauge fields $F$ \cite{Yamaguchi:2006tq}:
\begin{eqnarray}
 \text{D3-brane:} &\quad& AdS_2 \times S^2, \quad u=\text{constant}, \quad \theta = 0 \\
		  &\quad& \dfrac{1}{T_{F1}}F = L^2\sqrt{1+\kappa^2} e^0 e^1, \quad \kappa \equiv \sinh u \\
 \text{D5-brane:} &\quad& AdS_2 \times S^4, \quad u=0, \quad \theta = \text{constant} \\
 		  &\quad& \dfrac{1}{T_{F1}}F = L^2 \cos \theta e^0 e^1
\end{eqnarray}
where $e^0$ and $e^1$ are the vielbeins\footnote{
Vielbeins are defined by $ds^2=\eta_{mn} e^m e^n$, which is often referred as the \emph{local frame}.
In terms of components: $e^m=e^m_M dx^M$, thus, we can relate them to the metric as $g_{MN} = \eta_{mn} e^m_M e^n_M$.}
of $d\check{\Omega}^2$.
We see that the D3-brane sits on a fixed point on the $S^5$,
while the D5-brane sits on $S^4$ that is $\theta$ angle away from the pole of $S^5$, see figure \ref{fig:S5}.

\begin{figure}[t]
\begin{center}
\includegraphics[width=4cm]{Images/S5.png}
\end{center}
\caption{\label{fig:S5} $S^4$ that is $\theta$ angle away from the pole of $S^5$.
The angle depends on the amount of string charges $k$ that D5-brane contains.}
\end{figure}

The dual counterparts of the symmetric/antisymmetric representation in the leading order 't Hooft limit
are the on-shell action DBI \eqref{DBI} + WZ \eqref{WZ} of the D3-brane/D5-brane configuration aforementioned:
\begin{equation}\label{WLDbrane}
 \log W^{+}_k = - S_{D3}, \quad \log W^{-}_k = - S_{D5}.
\end{equation}
Moreover, we must ensure the string charge $k$ constraint, which can be added as a Lagrange multiplier term to the D-brane action:
\begin{equation} \label{stringChargeConstraint}
S_k = - k  \int_\Sigma F
\quad \Rightarrow \quad
k = \dfrac{1}{T_{F1}} \dfrac{\delta S_\text{DBI}}{\delta F} .
\end{equation}
The couplings in terms of $\lambda$ and $N$ are:
\begin{equation}
 T_\text{F1} = \dfrac{\sqrt{\lambda}}{2\pi L^2},
 \quad
%  T_\text{D1} = \dfrac{2N}{\sqrt{\lambda}},
%  \quad
 T_\text{D3} = \dfrac{N}{2\pi^2 L^4},
 \quad
 T_\text{D5} = \dfrac{N\sqrt{\lambda}}{8\pi^4 L^6},
\end{equation}
which are derived from \eqref{couplingsTension} using \eqref{couplings}.

Finally, the regularized actions are \cite{Drukker:2005kx, Yamaguchi:2006tq, Zarembo:2016bbk}:
\begin{eqnarray}
 S_\text{D3} &=& - 2 N  (\kappa\sqrt{1+\kappa^2}+\mathop{\mathrm{arcsinh}}\kappa)\\
 S_\text{D5} &=& - N \frac{2\sqrt{\lambda }}{3\pi}\,\sin^3\theta,
\end{eqnarray}
with the $\theta$ satisfying the string charge constraint \eqref{stringChargeConstraint} that gives \eqref{eqThetaAntisym}, i.e.
\begin{equation}
 \theta -\frac{1}{2}\,\sin 2\theta =\pi \frac{k}{N}.
\end{equation}
Thus the latitude angle $\theta$ depends on the amount of string charges $k$ dissolved in the D5-brane.
In conclusion, there is an exact agreement with \eqref{solW+} and \eqref{solW-}, according to \eqref{WLDbrane}.

\section{In Pilch-Warner background}

In $\mathcal{N}=2^*$ SYM on $S^4$, we took the decompactification limit for circular Wilson loops in order to have results on $\mathbb{R}^4$.
This means that in the Pilch-Warner background, the contour is a straight line of length $l\rightarrow \infty$.

\subsection{Fundamental representation}
The minimal surface of a straight Wilson line is a wall,
with the worldsheet coordinates $(\tau, \sigma)$ induced from the Pilch-Warner geometry in the following way:
\begin{equation}
 \tau = x^1, \quad \sigma = c.
\end{equation}
The regularized on-shell action was computed in \cite{Buchel:2013id},
which agrees with the leading order result in \eqref{WLFundN2}, that is:
\begin{equation}\label{W1leading}
 \log W_1 = \sqrt{\lambda} M \frac{l}{2\pi }, \quad (l\rightarrow \infty).
\end{equation}

The goal of Paper V was to compute the loop corrections to the minimal surface
by using string perturbation around the above classical solution.
There are two contributions, which turned out to be of equal weight in our case.
The first one comes from the dilaton coupling to the worldsheet curvature called the Fradkin-Tseytlin term \cite{Fradkin:1983xs}:
\begin{equation}
 S_{FT}=\dfrac{1}{4\pi} \int d^2\sigma \sqrt{h}  R^{(2)} \Phi,
\end{equation}
which is actually a bit controversial,
with some authors arguing it is not needed \cite{GRISARU1988625, GRISARU1985116, Cvetic:1999zs}.
Besides, it is zero for the familiar $AdS_5 \times S^5$ background due to a vanishing dilaton.
% explicitly break the conformal invariance of the classical world-sheet action
The other one comes from 1-loop stringy corrections,
which are computed by expanding the Green-Schwarz action up to quadratic fluctuations \cite{Cvetic:1999zs}.
These contribute as functional determinants, from generalizing the Gaussian integration formula \eqref{GaussianIntegral} for the bosons,
and the Grassmann integration for the fermions \eqref{GrassmannIntegral}.
Thus the semiclassical partition function is schematically of the form
\begin{equation}
 W = e^{-S_\text{cl}-S_\text{FT}} \dfrac{\text{det} F}{\sqrt{\text{det} B}},
\end{equation}
where $S_\text{cl}$ is the classical on-shell action in \eqref{W1leading},
$B$ and $F$ here just represent the bosonic and fermionic operators.
% of Schroedinger type (second order differential operator),
% of Dirac type ($2\times2$ first order differential operator).

Supersymmetry simplifies our problem by cancelling exactly
the sector of bosonic and fermionic operators that are asymptotically massless (far away from the boundary $\sigma=1$).
The remaining sector is asymptotically massive, and the operators (after several manipulations) look enticingly similar:
\begin{equation}\label{basicDirac}
 H_B=\begin{pmatrix}
  1+\frac{A}{\sigma }  & \mathcal{L} \\
  \mathcal{L}^\dagger  & -1 \\
 \end{pmatrix},\qquad
  H_F=\begin{pmatrix}
  -1                   & \mathcal{L} \\
  \mathcal{L}^\dagger  & 1+\frac{A}{\sigma }  \\
 \end{pmatrix},
\end{equation}
with
\begin{eqnarray}\label{EuclideanLs}
 \mathcal{L}&=&A\sqrt{\sigma ^2-1}\,\partial _\sigma +\frac{A\left(2\sigma ^2+1\right)}{2\sigma \sqrt{\sigma ^2-1}} ,
\nonumber \\
 \mathcal{L}^\dagger &=&-A\sqrt{\sigma ^2-1}\,\partial _\sigma
-\frac{A\left(4\sigma ^2-1\right)}{2\sigma \sqrt{\sigma ^2-1}}
+\frac{2}{\sqrt{\sigma ^2-1}}\,.
\end{eqnarray}
The final semiclassical partition function to compute is then:
\begin{equation}\label{semiclassicalW}
  W = e^{-S_\text{cl}-S_\text{FT}}\dfrac{\text{det}^2 (\partial_\tau-H_F)}{\text{det}^2 (\partial_\tau-H_B)},
\end{equation}

Instead of using the heat kernel technique or the Gelfand-Yaglom method,
both commonly used in the computation of functional determinants,
we used the phase-shift method from quantum mechanical scattering problems, see e.g. \cite{PhysRevD.10.4130}.
The method requires the operators to be asymptotically free, hence it works for (semi-)infinite intervals.
Our operators \eqref{basicDirac} share the same asymptotics in large $\sigma$, and they are defined in a semi-infinite interval $\sigma>1$,
so the method applies. Note that for $\tau$ variable, we do a usual Fourier transformation.
The exponential of the ratio of the determinants of the operators in \eqref{semiclassicalW}
can be written in terms of the phase-shift $\delta(p)$ between the wave function and the asymptotic plane wave,
see figure \ref{fig:potentialWavesPlot},
which is
\begin{equation}\label{deltaphases}
 -2 \, \int_{0}^{\infty }\frac{dp}{2\pi }\,\,
 \frac{4 p }{9\sqrt{\frac{4}{9}\,p^2+1}}\,\left(
 \delta_F ^+(p)
 +
\delta_F ^-(p)
-\delta_B ^+(p)
 -
\delta_B^-(p)
\right) = -\dfrac{1}{4},
\end{equation}
where $\pm$ distinguish the two eigenvectors (particles and holes) of the Dirac Hamiltonians \eqref{basicDirac}.
The last equality is backed by our numerics.
Thus, together with the Fradkin-Tseytlin contribution, the total correction is $-1/2$.
In conclusion, we do have a perfect matching with the field theory result \eqref{WLFundN2}.
% up to the subleading order in strong coupling expansion.
Moreover, the existence of Fradkin-Tseytlin term is necessary for this agreement.

\begin{figure}[t]
\begin{center}
\includegraphics[width=0.7\textwidth]{Images/potentialWavesPlotBlack.pdf}
\end{center}
\caption{\label{fig:potentialWavesPlot} Phase-shift $\delta(p)$ of the wave function
in the presence of a typical potential wall that many of our operators show, versus the free wave,
for certain momentum $p$.
}
\end{figure}

\subsection{Symmetric representation}
As for higher rank Wilson loops, Paper III found the D3-brane embedding dual to
the straight Wilson line of length $l$ in symmetric representation, with the help of the supersymmetric condition \eqref{susyCondition}.
The worldvolume metric is induced from the deformed $AdS$ part of \eqref{metricPW} in string frame\footnote{
We changed to mostly minus signature in order to follow Paper III.
The string metric $g$ and the Einstein metric $G$ are related by $g=e^{-\frac{4 \Phi }{D-2}} G$,
where $\Phi$ is the dilaton.
}:
\begin{equation}
 ds^2 = \dfrac{A M^2 L^2}{c^2-1}\left(dx^2  - \rho(c)^2 d\Omega_2^2 \right)
	-L^2\left(\dfrac{1}{A \left(c^2-1\right)^2} + \dfrac{A M^2 \rho'(c)^2}{c^2-1} \right) dc^2,
\end{equation}
where
\begin{equation}
 \rho(c)= \kappa \, \sqrt{c^2-1},
\end{equation}
since the deformed sphere shrinks to $\theta=\pi/2$ and $\phi=0$.
The worldvolume gauge field is given by
\begin{equation}
 \frac{1} {T_\text{F1}} F (c)  = -\dfrac{M L^2}{(c^2-1)^{3/2}} dx\wedge dc.
\end{equation}
As expected, it also reduces to the analogous case in $AdS_5 \times S^5$ close to the boundary.

The regularized on-shell action reduces to
\begin{equation}
 S_{D3} = - \sqrt{\lambda} k M \dfrac{l}{2\pi}.
%  , \quad (l \rightarrow \infty).
\end{equation}
This agrees with the matrix model result \eqref{WsymPW} according to \eqref{WLDbrane}, only in the low rank limit
\begin{equation}
 \kappa \ll M l.
\end{equation}
Furthermore, for $k=1$, we recover the fundamental case \eqref{W1leading}.
We can conclude that this D3-brane configuration cannot probe the entire matrix model region,
and a full dual object is still to be understood.

For the antisymmetric case, it is technically challenging to find the D5-brane solution.
So far, we have not succeeded.
We do expect it though to match the leading order field theory result,
because the matrix model result \eqref{WantisymPW} is proportional to $Ml$, the same as in the D-brane action.
It would be definitely interesting to compute the subleading order to determine the phase-transitions observed.


\section{Measure and Integration}
\subsection{Measure Spaces}
  \paragraph{1.}
  \begin{proof}
    Put $B_1=A_1$ and $B_n=A_n\setminus A_{n-1}$ for $n\ge 2$. $(B_n)$ is a
    sequence of disjoint measurable sets. By the
    countable additivity of $\mu$,
    \[
      \mu\left(\bigcup_{k=1}^\infty B_k\right)=
      \sum_{k=1}^\infty\mu(B_k)=
      \lim_{n\to\infty}\sum_{k=1}^n\mu(B_k)=
      \lim_{n\to\infty}\mu\left(\bigcup_{k=1}^n B_k\right).
    \]
    Since $\bigcup_{k=1}^n B_k=\bigcup_{k=1}^n A_k$ for $k=1,\dots,n,\dots,
    \infty$, this implies $\mu(\bigcup A_k)=\lim\mu(\bigcup_{k=1}^n A_k)$.
  \end{proof}

  \paragraph{3.}
  \begin{proof}
    $\,$\par
    (a) First,
    \[
      0=\mu(E_1\bigtriangleup E_2)=\mu(E_1\setminus E_2\cup E_2\setminus E_1)=
      \mu(E_1\setminus E_2)+\mu(E_2\setminus E_1).
    \]
    Together with the nonnegativity of $\mu$, we conclude that $\mu(E_1
    \setminus E_2)=\mu(E_2\setminus E_1)=0$. Note that
    \[
      \mu(E_1\cup E_2)=\mu(E_1\setminus E_2\cup E_2)=
      \mu(E_1\setminus E_2)+\mu(E_2).
    \]
    Hence, $\mu(E_1\cup E_2)=\mu(E_2)$. Similarly, $\mu(E_1\cup E_2)=\mu(E_1)$.
    Thus, $\mu(E_1)=\mu(E_2)$.\par
    (b) Since $\mu(E_1\bigtriangleup E_2)=0$ and $E_2\setminus E_1\subset E_1
    \bigtriangleup E_2$, by the completeness of $\mu$, $E_2\setminus E_1\in
    \mathcal{B}$. Similarly, $E_1\setminus E_2\in\mathcal{B}$. In consequence,
    $E_1\cap E_2 = E_1\setminus(E_1\setminus E_2)\in\mcal{B}$ and, therefore,
    $E_2=(E_1\cap E_2)\cup(E_2\setminus E_1)\in\mcal{B}$.
  \end{proof}

  \paragraph{7.}
  \begin{proof}
    Let $\mcal{B}_0$ be the collection of all sets $E=A\cup B$ where $B\in
    \mcal{B}$ and $A\subset C$, $C\in\mcal{B}$, $\mu C=0$. Clear that $\mcal{B}
    \subset\mcal{B}_0$. Now we show that it is a $\sigma$-algebra. Since $X\in
    \mcal{B}$, $X\in\mcal{B}_0$. Let $E_n=A_n\cup B_n$ be a sequence of elements
    of $\mcal{B}_0$. Then, $\bigcup E_n=(\bigcup A_n)\cup(\bigcup B_n)$ also
    belongs to $\mcal{B}_0$ since $\bigcup B_n\in\mcal{B}$ and $\bigcup A_n
    \subset\bigcup C_n$, which is a countable union of sets of measure zero.
    Hence, $\mcal{B}_0$ is closed under countable union. Now, let $E=A\cup B\in
    \mcal{B}_0$. Note that
    \[
      E^c=A^c\cap B^c=(C\setminus A)\cup(B^c\setminus C),
    \]
    where $C\setminus A\subset C$ and $B^c\setminus C\in\mcal{B}$. Hence,
    $\mcal{B}_0$ is closed under complement. Thus, it is a $\sigma$-algebra.\par
    We define $\mu_0:\mcal{B}_0\to[0,\infty]$ by $\mu_0 E=\mu_0(A\cup B)=\mu B$.
    First, we show that it is well-defined, that is, if $E=A\hp\cup B\hp$, then
    $\mu B=\mu B\hp$. Since $C\in\mcal{B}$ contains $A$, $(A\cup B)\setminus C
    \in\mcal{B}$. Meanwhile, since $\mu C=0$,
    \begin{equation}
      \label{eq:11.7-1}
      \mu B=\mu((A\cup B)\setminus C)=\mu(E\setminus C).
    \end{equation}
    Since $E\setminus C\subset E\cup C\hp$,
    \begin{equation}
      \label{eq:11.7-2}
      \mu(E\setminus C)\le \mu(E\cup C\hp)=\mu((A\hp\cup B\hp)\cup C\hp)=
      \mu B\hp,
    \end{equation}
    where the measurability of $E\cup C\hp$ and the last equality both comes
    from the fact that $A\hp\subset C\hp\in\mcal{B}$ and $\mu C\hp=0$. Combine
    \eqref{eq:11.7-1} and \eqref{eq:11.7-2} and we get $\mu B\le\mu B\hp$.
    Interchanging the role of $A\cup B$ and $A\hp\cup B\hp$ yields $\mu B\ge
    \mu B\hp$. Hence, $\mu B=\mu B\hp$ and, in consequence, $\mu_0$ is
    well-defined. Meanwhile, clear that for $E\in\mcal{B}$, $\mu E=\mu_0 E$.\par
    Finally, we show that $\mu_0$ is a measure. Clear that $\mu_0$ is
    nonnegative and $\mu_0\varnothing=0$. Let $\langle E_n\rangle\subset
    \mcal{B}_0$ be a sequence of disjoint sets. Then
    \[
      \mu_0\left(\bigcup E_n\right)=
      \mu_0\left(\bigcup A_n \cup \bigcup B_n\right)=
      \mu\left(\bigcup B_n\right)=
      \sum\mu B_n=
      \sum\mu_0 E_n.
    \]
    Namely, $\mu_0$ is countably additive. Thus, $\mu_0$ is a measure.
  \end{proof}

  \paragraph{9.}
  \begin{proof}
    $\,$\par
    (a) First, we argue by contradiction to show that $\mcal{R}$ and
    $\mcal{R}$. Assume that there exists some $E\in\mcal{R}\cap\mcal{R}\hp$,
    that is, $E\in\mcal{R}$ and $E^c\in\mcal{R}$. Then $X=E\cup E^c\in
    \mcal{R}$, which contradicts the assumption that $\mcal{R}$ is not a
    $\sigma$-algebra. Thus, $\mcal{R}\cap\mcal{R}\hp=\varnothing$.\par
    Clear that $\mcal{R}\cup\mcal{R}\hp$ is a $\sigma$-algebra containing
    $\mcal{R}$. Hence, $\mcal{R}\cup\mcal{R}\hp\supset\mcal{B}$. Meanwhile,
    since $\mcal{B}=\sigma(\mcal{R})$, $\mcal{R}\cup\mcal{R}\hp\subset
    \mcal{B}$. Thus, $\mcal{R}\cup\mcal{R}\hp=\mcal{B}$.\par
    (b) Since $\varnothing\in\mcal{R}$, $\bar{\mu}\varnothing=\mu\varnothing
    =0$. Meanwhile, clear that $\bar{\mu}$ is nonnegative. Let $(E_n)\subset
    \mcal{B}$ be a sequence of disjoint sets. By part (a), each $E_n$ is either
    an element of $\mcal{R}$ or $\mcal{R}\hp$. If all $E_n\in\mcal{R}$, then by
    the countable additivity of $\mu$, $\mu(\bigcup E_n)=\sum\mu E_n$. Suppose
    there exists some $E_n$ in $\mcal{R}$ and some $E_m$ in $\mcal{R}\hp$. Let
    $F_1$ and $F_2$ be the union of theses sets respectively. Since
    $\sigma$-ring is closed under union, $F_1\in\mcal{R}$, and since $(\bigcup
    E_m)^c=\bigcap E_m^c$, $F_2\in\mcal{R\hp}$. Hence, $F_1\cup F_2\in\mcal{R}
    \hp$, otherwise, $F_2=(F_1\cup F_2)\setminus F_1$ would be an element of
    $\mcal{R}$. Therefore, $\mu(\bigcup E_n)=\infty=\sum\mu E_n$. Thus, $\bar{
    \mu}$ is a measure on $\mcal{B}$.\par
    (c) Clear that $\ubar{\mu}$ is nonnegative and $\ubar{\mu}\varnothing=0$.
    Let $(E_n)\subset\mcal{B}$ be disjoint. Note that for $E\in\mcal{R}$, $\mu
    E=\sup\{\mu A:\,A\subset E,A\in\mcal{R}\}$. Hence, it suffices to show that
    \[
      M=\sup\left\{\mu A:\, A\subset\bigcup_n E_n,A\in\mcal{R}\right\}=
      \sum_n\sup\{\mu A:\, A\subset E_n,A\in\mcal{R}\}=\sum_n M_n.
    \]
    By definition, for all $\vep>0$, there exists a sequence $(A_n)\subset
    \mcal{R}$ such that $A_n\subset E_n$ and $M_n<\mu A_n+\vep/2^n$. Put $A=
    \bigcup A_n$. Since $(A_n)$ are disjoint as $(E_n)$ are,
    \[
      \sum M_n < \vep+\sum\mu A_n =\vep+\mu A.
    \]
    Meanwhile, since $A\subset\bigcup E_n$ and $A\in\mcal{R}$, $\mu A\le M$.
    Therefore, $\sum M_n<\vep+M$. Thus, $\sum M_n\le M$.\par
    For the converse, similarly, for every $\vep>0$, there exists an $A\in
    \mcal{R}$ such that $A\subset\bigcup E_n$ and $M-\vep>\mu A$. Put $A_n=E_n
    \cap A$. If $E_n\in\mcal{R}$, $A_n\in\mcal{R}$ by definition. If $E_n\in
    \mcal{R}\hp$, $A_n=A\setminus E_n^c\in\mcal{R}$. Hence, $A_n\in\mcal{R}$
    for each $n$. Thus,
    \[
      M-\vep<\mu A=\sum_n\mu A_n\le\sum_n M_n,
    \]
    implying that $M\le \sum M_n$. Therefore, $M=\sum M_n$, i.e., $\ubar{\mu}$
    is countably additive. Thus, we conclude that $\ubar{\mu}$ is a measure on
    $\mcal{B}$.\par
    (d) Clear that $\mu_\beta$ is nonnegative and $\mu_beta\varnothing=0$. The
    preceding discussion, \textit{mutatis mutandis}, yields the countable
    additivity.
  \end{proof}
% end
\subsection{Measurable Functions}
  \paragraph{10.}
  \begin{proof}
    For every integers $n$ and $k$, let
    \begin{align*}
      &E_{n,k}=\{x:\, k2^{-n}\le f(x)<(k+1)2^{-n}\}, (k\le 2^{2n})\\
      &E_{n,2^{2n}+1}=\{x:\, f(x)\ge(2^{2n}+1)2^{-n})\},\\
      &\varphi_n=2^{-n}\sum_{k=0}^{2^{2n}+1}k\chi_{E_{n,k}}
    \end{align*}
    Since $f$ is measurable, all $E_{n,k}$ are measurable. Thus, $\langle
    \varphi_n\rangle$ is a sequence of nonnegative simple functions. Clear that
    for fixed $n$, $\langle E_{n,k}\rangle_k$ are disjoint. Let $x\in X$ be
    fixed. If $x\in E_{n,k}$ for some $k\le 2^{2n}$, then $x\in E_{n+1,2k}\cup
    E_{n+1,2k+1}$. Hence, $\varphi_{n+1}(x)\ge 2k/2^{-(n+1)}=\varphi_n(x)$. If
    $x\in E_{n,2^{2n}+1}$, then $x\in E_{n+1,k\hp}$ for some $k\hp\ge
    2^{2n+2}$. Hence, $\varphi_{n+1}(x)\ge 2k/2^{-(n+1)}=\varphi_n(x)$. Thus,
    $\varphi_{n+1}\ge\varphi_n$ for all $n$.\par
    Now, we show that $\varphi_n$ converges to $f$ pointwisely. Let $x\in X$ be
    fixed. If $f(x)=\infty$, then $\varphi_n(x)=2^{-n}(2^{2n}+1)\to\infty$ as
    $n\to\infty$. If $f(x)<\infty$, then $f(x)<2^{N}$ for some integer $N$.
    For all $n>N$, $x\in E_{n,k_n}$ where $k_n=\lfloor 2^nf(x)\rfloor$. Thus,
    \[
      f(x)-\varphi_n(x)=f(x)-2^{-n}\lfloor 2^nf(x)\rfloor\to 0
    \]
    as $n\to\infty$. Namely, $\varphi_n(x)\to f(x)$.\par
    If the measure space is $\sigma$-finite, then let $(X_n)\subset X$ be a
    sequence of measurable sets such that $X_n\subset X_{n+1}$, $\mu X_n<
    \infty$ and $X=\bigcup X_n$. Replacing $E_{n,k}$ with $E_{n,k}\cap X_n$
    yields a sequence $\langle\varphi_n\rangle$ satisfying all previous
    requirements and vanishing outside $X_n$ for each $n$.
  \end{proof}

  \paragraph{11.}
  \begin{proof}
    Put $F_\alpha=\{x:\,f(x)\le\alpha\}$, $G_\alpha=\{x:\,g(x)\le\alpha\}$,
    $E=\{x:\,f(x)\ne g(x)\}$ and $E_\alpha=\{x\in E: g(x)\le\alpha\}$. Then
    $G_\alpha=(F_\alpha\setminus E)\cup E_\alpha$. Since $F$ is measurable, all
    $F_\alpha$ are measurable. Since $f=g$ a.e., $E$ is of measure zero.
    Meanwhile, since $\mu$ is complete, $E_\alpha\subset E$ is measurable.
    Thus, $G_\alpha$ is measurable. Namely, $g$ is measurable.
  \end{proof}

  \paragraph{13.}
  \begin{proof}
    Note that $f_n$ converges to $f$ in measure iff for every $\vep>0$,
    \begin{equation*}
      \lim_{n\to\infty}\mu\{x\in X:\, |f_n(x)-f(x)|\ge\vep\}=0.
    \end{equation*}\par
    (a) By definition, for every $\vep_m=2^{-m}$, there exists some integer
    $N_m$ such that for all $n\ge N_m$, $\mu\{x:\,|f_n(x)-f(x)|\ge\vep_m\}<
    \vep_m$. Consider the subsequence $\langle f_{N_m}\rangle_m$. We show that
    it converges to $f$ almost everywhere. Put $E_m=\{x:\,|f_{N_m}-f(x)|\ge
    \vep_m\}$ and $E=\limsup E_m$. Then, for each $k$,
    \[
      \mu E\le \bigcup_{m=k}^\infty E_m\le \sum_{m=k}^\infty 2^{-m+1}\to 0,
      \quad\text{as}\quad k\to\infty.
    \]
    For every $x\notin E$, $x\notin\bigcup_{m=k}^\infty E_m$ for some $k$. Then
    for all $m>k$, $|f_{N_m}(x)-f(x)|<\vep_{N_m}$. Hence, $f_{N_m}(x)\to f(x)$.
    Namely, $f_{N_m}\to f$ almost everywhere.\par
    (b) First we prove a lemma: Let $\langle E_n\rangle$ be a sequence of
    measurable subset of $A$. Then $\limsup\mu E_n\le \mu(\limsup E_n)$. Let
    $F_N=\bigcup_{n=N}^\infty E_n$. Clear that $F_{n+1}\subset F_n$ and $\mu
    F_1<\infty$. Hence, by Prop. 2,
    \[
      \limsup\mu E_n\le \lim\mu F_n=
      \mu\left(\bigcap_{n=1}^\infty F_n\right)=\mu(\limsup E_n).
    \]
    Thus, the lemma holds.\par
    For fixed $\vep>0$, let $E_n=\{x\in A:\, |f_n(x)-f(x)|\ge\vep\}$. We
    show that $\lim\mu E_n=0$. First, clear that $0\le\limsup\mu E_n$.
    Meanwhile, if $x\in\limsup E_n$, then $x$ belongs to infinitely many $E_n$.
    As a consequence, $f_n$ does not converges to $f$ at $x$. Since $f_n$
    converges to $f$ a.e., $\mu(\limsup E_n)=0$. Note that all $E_n\subset A$
    are of finite measure. Hence, by the preceding lemma, $\limsup\mu E_n\le
    0$. Thus, $\lim\mu E_n=0$. Let $F_n$ denote $\{x\in X:\,|f_n(x)-f(x)|\ge
    \vep\}$ and $G$ the collection of points at which $f_n$ does not converge
    to $f$. Since all $f_n$ vanishes outside $A$, for a point outside to belong
    to $F_n$, it has to belong to $G$, a set of measure zero. Therefore, $E_n
    \subset F_n\subset E_n\cup G$, implying that $\mu F_n=\mu E_n$. Thus, $f_n$
    converges to $f$ in measure.\par
    (c) By definition, for each positive integer $k$, there is an integer $N_k$
    such that for all $n,m\ge N_k$, $\mu\{x\in X:\,|f_n(x)-f_m(x)|\ge 2^{-k}\}<
    2^{-k}$. We may assume without loss of generality that $N_k$ is increasing.
    Put $E_k=\{x:\, |f_{N_{k+1}}-f_{N_k}|\ge 2^{-k}\}$ and $E=\limsup E_k$. By
    our construction, $\mu E=0$. For $x\notin E$, $|f_{N_{k+1}}(x)-f_{N_k}(x))|
    <2^{-k}$ for large $k$ and, therefore, the number series $\sum(f_{N_{k+1}}
    (x)-f_{N_k}(x))$ converges to some point, say, $g(x)$. Hence, $f_{N_k}$
    converges to $f=f_{N_1}+g$ almost everywhere. Since all $f_{N_k}$ are
    measurable, $f$ is measurable.\par
    Now we show that $f_n$ converges to $f$ in measure. Let $D$ be the set of
    points at which $f_{N_k}$ does not converge to $f$. For every $\vep>0$,
    let $F_n=\{x\in X\setminus D:\, |f_n(x)-f(x)|\ge\vep\}$. Note that for
    all sufficiently large $N_k$,
    \begin{align*}
      F_n
      &\subset\{x\in X\setminus D:\,|f_n(x)-f_{N_k}(x)|+|f_{N_k}(x)-f(x)|
      \ge\vep \}\\
      &\subset\{x\in X\setminus D:\,|f_n(x)-f_{N_k}(x)|\ge\vep/2\},
    \end{align*}
    where the measure of the last set can be less than $\vep$ for sufficiently
    large $n$ and $N_k$ as $\langle f\rangle$ is Cauchy in measure. Since $D$
    is of measure zero, we conclude that $\langle f_n\rangle$ converges to $f$
    in measure.
  \end{proof}

  \paragraph{16.}
  \begin{proof}
    Egoroff: Let $(X,\mcal{B},\mu)$ be a measure space and $E\subset X$ is of
    finite measure. Let $\langle f_n\rangle$ be a sequence of measurable
    functions which converge to some function $f$ a.e. on $E$. Then
    for every $\eta>0$, there is a subset $A\subset E$ with $\mu A<\eta$ such
    that $f_n$ converges to $f$ uniformly on $E\setminus A$.\par
    We may assume without loss of generality that all $f_n$ vanish outside $E$.
    Then, by Prob. 13(b), $f_n$ converges to $f$ in measure over $E$. Fix
    $\eta>0$. First, we construct $A$. Put $\delta_m=\delta/2^m$. For every
    $m$, there exists some integer $N_m$ and a measurable set $A_m$ with $\mu
    A_m<\delta_m$ such that for all $n>N_m$ and $x\notin A_m$, $|f_n(x)-f(x)|<
    \delta_m$. Put $A=\bigcup A_m$. Clear that $\mu A<\delta$.\par
    Now we show that $f_n$ converges to $f$ uniformly on $E\setminus A$. Fix
    $x\in E\setminus A$. For every $\vep>0$, suppose there is an $m$ such that
    $0<\delta_m<\vep$. For all $n>N_m$, since $x\notin A$, $|f_n(x)-f(x)|<
    \delta_m<\vep$. Thus, $f_n\to f$ uniformly on $E\setminus A$.
  \end{proof}
% end
\subsection{Integration}
  \paragraph{19.}
  \begin{proof}
    Since $|\int_E f|\le \int_E|f|$, it suffices to show the result for
    nonnegative $f$. Fix $\vep>0$. By definition, there is a nonnegative simple
    function $\varphi=\sum_{i=1}^n c_i\chi_{E_i}$ such that $\int f<\int
    \varphi+\vep/2$. Put $M=\max_ic_i$ and $\delta=\vep/2Mn$. Then, for every
    measurable $E$ with $\mu E<\delta$, we have
    \[
      \int_E f<\int_E\varphi+\vep/2=
      \sum_{i=1}^nc_i\mu(E_i\cap E)+\vep/2\le
      Mn\delta+\vep/2=\vep.
    \]
  \end{proof}

  \paragraph{20.}
  \begin{proof}
    We show here Fatou's Lemma: Let $\langle f_n\rangle$ be a sequence of
    nonnegative measurable functions which converges to a function $f$ in
    measure on a measurable set $E$. Then $\int_E f\le\lowlim\int_E f_n$.\par
    Since the collection of limits point of $\int_E f_n$ forms a closed set,
    there exists a subsequence $\langle f_{n_k}\rangle_k$ such that $\lim\int_E
    f_{n_k}=\liminf\int_E f_n$. Since $f_{n_k}$ also converges to $f$ in
    measure, by Prob. 13(a), there is a subsequence $\langle f_{n_{k_j}}\rangle$
    which converges to $f$ a.e. on $E$. Hence, by Theorem 10,
    \[
      \int_E f\le \liminf_j \int_E f_{n_{k_j}}=
      \lim_j \int_E f_{n_{k_j}}=
      \liminf_n\int_E f_n.
    \]
  \end{proof}

  \paragraph{21.}
  \begin{proof}
    $\,$\par
    (a) We may assume without loss of generality that $f$ is nonnegative since
    replacing $f$ by $|f|$ dose not change the integrability and the set $E=
    \{x:\,f(x)\ne 0\}$. For every positive integer $n$, since $\int f<\infty$,
    the set $E_n=\{x:\, f(x)\ge 1/n\}$ is of finite measure. Thus, $E=
    \bigcup_{n=1}^\infty E_n$ is of $\sigma$-finite measure.\par
    (b) It follows immediately from part (a) and Prop. 7.\par
    (c) If $f\ge 0$, then the existence of such a $\varphi$ comes directly from
    the definition. For general cases, let $f=f^+-f^-$ and $\varphi^+,\varphi^-$
    two simple functions such that
    \[
      \int|f^+-\varphi^+|<\vep/2
      \quad\text{and}\quad
      \int|f^--\varphi^-|<\vep/2.
    \]
    Note that $\varphi=\varphi^+-\varphi^-$ is also a simple function and
    \[
      \int|f-\varphi|\le
      \int|f^+-\varphi^+|+\int|f^--\varphi^-|
      <\vep.
    \]
  \end{proof}

  \paragraph{22.}
  \begin{proof}
    $\,$\par
    (a) Clear that $\nu$ is nonnegative and $\nu\varnothing=0$. Let $\langle
    E_n\rangle$ be a sequence of disjoint measurable sets and $E=\bigcup_n E_n$.
    By Corollary 14, we have
    \[
      \nu E=\int_E g\rd\mu=
      \int_E\sum g\chi_{E_n}\rd\mu=
      \sum\int_E g\chi_{E_n}\rd\mu=
      \sum\int_{E_n}g\rd\mu=
      \sum\nu E_n.
    \]
    Thus, $\nu$ is a measure.\par
    (b) First, we show the identity for an arbitrary simple function $\varphi=
    \sum_{k=1}^n c_k\chi_{E_k}$ where $E_k$ are disjoint.
    \[
      \int\varphi\rd\nu=
      \sum_{k=1}^nc_k\nu E_k=
      \sum_{k=1}^nc_k\int g\chi_{E_k}\rd\mu=
      \int \varphi g\rd\mu.
    \]\par
    Let $f$ be a nonnegative measurable function and $\langle\varphi_n\rangle$ a
    increasing sequence of simple functions converging to $f$, the existence of
    which is guaranteed by Prop. 7. Then, By the monotone convergence theorem,
    \[
      \int f\rd\nu=\lim\int\varphi_n\rd\nu=\lim\int\varphi_n g\rd\mu.
    \]
    Note that $\langle\varphi_ng\rangle$ is a increasing sequence of functions
    converging to $fg$ and with $\varphi_ng\le fg$. Hence, again by the
    monotone convergence theorem,
    \[
      \lim\int\varphi_n g\rd\mu=\int fg\rd\mu.
    \]
    Thus, $\int f\rd\nu=\int fg\rd\mu$.
  \end{proof}
% end
\subsection{General Convergence Theorems}
  \paragraph{24.}
  \begin{proof}
    Since $\mu_n E$ is increasing for every $E$, such limits do exists. Clear
    that $\mu$ is nonnegative and $\mu\varnothing=0$. Let $\langle E_k\rangle$
    be a sequence of disjoint measurable sets. Then
    \[
      \mu\left(\bigcup_{k=1}^\infty E_k\right)=
      \lim_{n\to\infty}\mu_n\left(\bigcup_{k=1}^n E_k\right)=
      \lim_{n\to\infty}\sum_{k=1}^\infty\mu_n(E_k).
    \]
    Since for fixed $k$, $\mu_n(E_k)\le\mu_{n+1}(E_k)$, it is valid to change
    the order of the limit and the summation, which implies that $\mu(\bigcup
    E_k)=\sum\mu E_k$. Thus, $\mu$ is a measure.
  \end{proof}
  % TODO: 11.26
% end
\subsection{Signed Measures}
  \paragraph{27.}
  \begin{proof}
    $\,$\par
    (a) Consider the usual Lebesgue measure on $\mathbb{R}$. Let $A$ be any
    countable subset of $\mathbb{R}$ and $B=\mathbb{R}\setminus A$. Clear that
    $A$ is negative set while $B$ is a positive set. Namely, $A$ and $B$ form a
    Hahn decomposition of $\mathbb{R}$ for $\mu$.\par
    (b) Let $\{A_1,B_1\}$ and $\{A_2,B_2\}$ be two Hahn decomposition of $X$
    for $\nu$ and $A_1$ and $A_2$ are two positive sets. We show that $A_1
    \bigtriangleup A_2$ is a null set. Since the roles of $A_1$ and $A_2$ are
    interchangeable, it suffices to show that $A_1\setminus A_2$ is a null set.
    Since $A_1$ is positive, every subset $E\subset A_1\setminus A_2\subset
    A_1$ is of nonnegative measure. Meanwhile, $A_1\setminus A_2$ is also
    contained in $B_2$, a negative set. Hence, $\nu E\le 0$. Thus, $\nu E=0$,
    implying that $A_1\bigtriangleup A_2$ is a null set.
  \end{proof}

  \paragraph{28.}
  \begin{proof}
    Let $\nu=\nu^+-\nu^-$ be the Jordan decomposition of $\nu$ and $A$ and $B$
    be such that $X=A\cup B$ and $\nu^+(A)=\nu^-(B)=0$. For every $E\subset A$,
    \[
      \nu E=\nu^+E-\nu^-E=-\nu^-E\le 0.
    \]
    Hence, $A$ is a negative set. Similarly, $B$ is positive set. Thus, $\{A,
    B\}$ is a Hahn decomposition of $X$.\par
    Let $\nu=\nu_1+\nu_2$ be another Jordan decomposition of $\nu$ and $\{C,
    D\}$ be the corresponding Hahn decomposition. By Prob. 27(b), $\{A,B\}$ and
    $\{C,D\}$ only differ by two null sets. Thus, $\nu_1=\nu^+$ and $\nu_2=
    \nu^-$. Namely, the decomposition is unique.
  \end{proof}

  \paragraph{31.}
  \begin{proof}
    Clear that
    \begin{align*}
      \left|\int_E f\rd\nu\right|
      \le \left|\int_E f\rd\nu^+\right|+\left|\int_E f\rd\nu^-\right|
      \le M\nu^+E+M\nu^-E=M|\nu|(E).
    \end{align*}
    Let $\{A,B\}$ be the corresponding Hahn decomposition of $X$ and $A$ is the
    positive set. Then define $f$ by
    \[
      f(x)=\begin{cases}
        1, & x\in A,\\
        -1, & x\notin A.
      \end{cases}
    \]
    Clear that $|f|\le 1$ and
    \[
      \int_E f\rd\nu=
      \int_E f\rd\nu^+-\int_E f\rd\nu^-=
      \mu^+(A\cap E)+\nu^-(A\cap B)=
      |\nu|(E).
    \]
  \end{proof}

  \paragraph{32.}
  \begin{proof}
    $\,$\par
    (a) Put $\mu\wedge\nu=\frac{1}{2}(\mu+\nu-|\mu-\nu|)$, which can be
    verified to be a measure. For every $E\subset X$, suppose $\mu E\le\nu E$.
    Then
    \[
      (\mu\wedge\nu)(E)=
      \frac{1}{2}(\mu E+\nu E-|\mu-\nu|(E))=
      \frac{1}{2}(\mu E+\nu E-\nu E+\mu E)=
      \mu E.
    \]
    Similarly, $(\mu\wedge\nu)(E)=\nu E$ if $\nu E\le\mu E$. Hence, $\mu
    \wedge\nu$ is smaller than both $\mu$ and $\nu$. Note that $(\mu\wedge\nu)
    (E)=\min\{\mu E, \nu E\}$. Thus, clear that it is larger than any other
    signed measure smaller than $\mu$ and $\nu$.\par
    (b) Put $\mu\vee\nu=\frac{1}{2}(|\mu-\nu|+\mu+\nu)$. The previous argument,
    \textit{mutatis mutandis}, shows that $(\mu\vee\nu)(E)=\max\{\mu E,\nu E
    \}$. Thus, it is the smallest measure larger than $\mu$ and $\nu$.
    Meanwhile, clear that $\mu\wedge\nu+\mu\vee\nu=\mu+\nu$.\par
    (c) Suppose that $\mu$ and $\nu$ are mutually singular and let $\{A,B\}$
    be such that $A\cup B=X$ $\mu A=\nu B=0$. Then
    \[
      (\mu\wedge\nu)(E)\le(\mu\wedge\nu)(E\cap A)+(\mu\wedge\nu)(E\cap B)
      \le\mu A+\nu B=0.
    \]
    For the converse, suppose that $\mu\wedge\nu=0$. If $\mu=0$ or $\nu=0$,
    then $\mu\perp\nu$ holds vacuously. Suppose that both $\mu$ and $\nu$ are
    nonzero. Since the roles of $\mu$ and $\nu$ are interchangeable, we may
    assume without loss of generality that $\mu E=0$ and $\nu E>0$ for some
    measurable $E$. Then, $\mu E^c\ne 0$, forcing $\nu E^c$ to be zero.
    Therefore, $\mu E=\nu E^c=0$, implying that $\mu\perp\nu$.
  \end{proof}
% end
\subsection{The Radon-Nikodym Theorem}
  \paragraph{33.}
  \begin{proof}
    Suppose $X=\bigcup_{n=1}^\infty X_i$ and $\mu X_i<\infty$ for each $n$
    and $X_i$ are disjoint. Then both $\mu|_{X_i}$ and $\nu|_{X_i}$, the
    restrictions to $X_i$, are finite. In consequence, by the Radon-Nikodym
    theorem for finite measure, there is a nonnegative measurable function
    $f_i:X_i\to\mathbb{R}$ such that $\nu(E\cap X_i)=\int_{(E\cap X_i)}
    f_i\rd\mu$. Without loss of generality, we may consider $f_i$ to be a
    function on $X$ (instead of $X_i$) that vanishes outside $X_i$.\par
    Put $f=\sum f_i$. Since $X_i$ are disjoint and $f_i$ vanishes outside $X_i$,
    the summation does make sense. Meanwhile, clear that $f$ is nonnegative and
    measurable. Note that for each measurable $E$,
    \[
      \nu E=\sum_{n=1}^\infty\nu(E\cap X_i)=
      \sum_{n=1}^\infty\int_E f_i\rd\mu=
      \int_E f\rd\mu,
    \]
    where the last equality comes from Corollary 14. Namely, $\nu E=\int_E
    f\rd\mu$.\par
    Finally, we show that $f$ is unique up to almost equality. Let $g$ be a
    nonnegative measurable function with this property. Then, $g|_{X_i}$, the
    restriction of $g$ to $X_i$, equals to $f_i$ a.e. [$\mu$]. Thus, $g=f$
    a.e. [$\mu$].
  \end{proof}

  \paragraph{34. Radon-Nikodym derivatives}
  \begin{proof}
    $\,$\par
    (a) It suffices to show the result for simple functions. Let $\varphi=
    \sum_{k=1}^nc_k\chi_{E_k}$ be a simple function. Then
    \begin{equation*}
      \int \varphi\,\rd\nu=\sum_{k=1}^nc_i\nu E_k.
    \end{equation*}
    Meanwhile,
    \[
      \int \varphi\left[\frac{\rd\nu}{\rd\mu}\right]\,\rd\mu=
      \sum_{k=1}^n c_k\int_{E_k}\left[\frac{\rd\nu}{\rd\mu}\right]\,\rd\mu=
      \sum_{k=1}^nc_i\nu E_k.
    \]
    Thus, $\int\varphi\,\rd\nu=\int\varphi[\rd\nu/\rd\mu]\rd\mu$.
  \end{proof}

  \paragraph{35.}
  \begin{proof}
    $\,$\par
    (d) Let $\rho_0,\rho_1$ be two measures with $\rho_0\perp\mu$, $\rho_1\ll
    \mu$ and $\nu=\rho_0+\rho_1$. We show that $\rho_0=\nu_0$ and $\rho_1
    =\nu_1$. Since $\nu_0\perp\mu$ and $\rho_0\perp\mu$, there exists measurable
    $A,B$ and $C,D$ such that $A\cup B=C\cup D=X$, $A\cap B=C\cap D=\varnothing$
    and $\nu_0A=\mu B=\rho_0C=\mu D=0$. Put $U=A\cap C$ and $V=B\cup D$. Note
    that
    \begin{align*}
      U\cup V=(A\cap C)\cup(B\cup D)=(A\cup B\cup D)\cap(C\cup B\cup D)=X,\\
      U\cap V=(A\cap C)\cap(B\cup D)=(A\cap C\cap B)\cup(C\cap B\cap D)=
      \varnothing.
    \end{align*}
    For every measurable $E$, if $E\subset U$, then $\nu_0E=\rho_0E=0$ and
    $(\nu_0+\nu_1)(E)=(\rho_0+\rho_1)(E)$ implies that $\nu_1 E=\rho_1 E$.
    If $E\subset V$, then $\mu E=0$, implying that $\nu_1E=\rho_1E=0$ and,
    therefore, $\nu_0E=\rho_0E$. Since $U$ and $V$ partitions $X$, this implies
    that $\nu_0=\rho_0$ and $\nu_1=\rho_1$ for all measurable $E$.
  \end{proof}

  \paragraph{36.}
  \begin{proof}
    We show that: Let $(X,\mcal{B},\mu)$ be a $\sigma$-finite signed measure
    space, and let $\nu$ be a signed measure on $\mcal{B}$ with $\nu\ll\mu$.
    Then there is a measurable function such that for all measurable $E$ we have
    $\nu E=\int_E f\,\rd\mu$. Furthermore, the function $f$ is unique up to
    almost equality with respect to $\mu$.\par
    Let $\mu=\mu^+-\mu^-$ and $\nu=\nu^+-\nu^-$ be the Jordan decompositions.
    Clear that $\nu^+\ll\mu^+$ and $\nu^-\ll\mu^-$. Hence, by the Radon-Nikodym
    theorem for measures, there exists nonnegative $g$ and $h$ such that
    \[
      \nu^+E=\int_E g\,\rd\mu^+
      \quad\text{and}\quad
      \nu^-E=\int_E h\,\rd\mu^-
    \]
    for all measurable $E$. Put $f=g-h$. Clear that it is measurable. Meanwhile,
    \[
      \nu E=\nu^+E-\nu^-E=
      \int_E g\,\rd\mu^+-\int_E h\,\rd\mu^-=
      \int_E (g-h)\,\rd\mu
    \]
    where the last equality comes from the mutual singularity of $\mu^+$ and
    $\mu^-$. And the argument in Prob. 33, \textit{mutatis mutandis}, gives the
    uniqueness.
  \end{proof}

  \paragraph{40.}
  \begin{proof}
    Let $I$ denote the index set of $\{X_\alpha\}$ and, just for convenience,
    let $\sum_J$ denote $\sum_{\alpha\in J}\mu(E\cap X_\alpha)$.\par
    (a) First, we suppose that $E$ is of finite measure. Let $J$ be any finite
    index subset of $I$. Then, since $X_\alpha$ are disjoint, $\mu E\ge\sum_J$.
    Hence, $\mu E\ge\sum_I$. For the converse, since, by our previous result,
    all $\sum_J$ are bounded by $\mu E$, $\sum_I$ is finite. For each positive
    integer $n$, there is a finite subset $J_n$ of $I$ such that $\sum_I-1/n<
    \sum_{J_n}$. Put
    \[
      J=\bigcup_{n=1}^\infty J_n
      \quad\text{and}\quad
      Y=\bigcup_{\beta\in J}X_\beta.
    \]
    We show that (1) $\mu(Y\cap E)\le\sum_I$ and (2) $\mu E=\mu(Y\cap E)$ to
    complete the proof. Since $\{X_\beta\}_{\beta\in J}$ is a countable
    collection of disjoint sets,
    \[
      \mu(Y\cap E)=\sum_{\beta\in J}\mu(X_\beta\cap E)\le
      \sum_{\alpha\in I}\mu(X_\beta\cap E).
    \]
    Namely, (1) holds. To show (2), we first show that, for each $\alpha\in I$,
    the set $X_\alpha\cap(E\setminus Y)$ is of measure zero. Assume, to obtain
    a contradiction, that there is some $\alpha$ such that $\mu(X_\alpha\cap(
    E\setminus Y))=\delta>0$. Since
    \[
      X_\alpha\cap(E\setminus Y)=
      X_\alpha\cap E\cap\left(\bigcap_{\beta\in J}X_\beta^c\right),
    \]
    this implies that $\alpha\notin J_n$ for all $n$ and $\mu(X_\alpha\cap E)=
    \delta$. Since $\delta>1/n$ for some large $n$, this leads to the
    contradiction
    \[
      \sum_{J_n\cup\{\alpha\}}=\sum_{J_n}+\mu(X_\alpha\cap E)
      >\sum_I-\frac{1}{n}+\delta\ge\sum_I.
    \]
    Hence, $\mu(X_\alpha\cap(E\setminus Y))=0$ for all $n$ and, therefore,
    $\mu(E\setminus Y)=0$. Note that $E\setminus(Y\cap E)=E\setminus Y$, this
    implies that $\mu(E\setminus(Y\cap E))=0$. In consequence, $\mu E=\mu(Y\cap
    E)$. Thus, $\mu E\le\sum_I$.\par
    Now suppose $\mu E=\infty$. If all $\sum_J$ are finite
  \end{proof}

  \paragraph{40.}
  \begin{proof}
    Let $I$ denote the index set of $\{X_\alpha\}$. Fix a measurable $E$. Put
    \[
      J=\{\alpha\in I:\,\mu(E\cap X_\alpha)>0\}
      \quad\text{and}\quad
      Y=\bigcup_{\beta\in J}X_\beta.
    \]
    First we show that $\mu E=\mu(E\cap Y)$. Clear that $\mu E\ge\mu(E\cap Y)$.
    For the converse, consider the set $E\setminus(E\cap Y)=E\setminus Y$. For
    every $X_\alpha$, if $\alpha\notin J$, by the construction of $J$, $\mu(
    X_\alpha\cap(E\setminus Y))=0$. If $\alpha\in J$, then
    \[
      X_\alpha\cap(E\setminus Y)=
      X_\alpha\cap E\cap\left(\bigcap_{\beta\in J}X_\beta\right)=
      \varnothing.
    \]
    As a result, $\mu(X_\alpha\cap(E\setminus Y))=0$ for all $\alpha\in I$.
    Since $\{X_\alpha\}$ is a decomposition, this implies that $\mu(E\setminus
    Y)=0$. Therefore, $\mu E\le \mu(E\cap Y)$. Thus, $\mu E=\mu(E\cap Y)$.\par
    (a) For each positive integer $n$, put
    \[
      J_n=\{\alpha\in I:\,\mu(E\cap X_\alpha)>1/n\}.
    \]
    Clear that $J=\bigcup_n J_n$. If $J$ is uncountable, then there must exist
    some uncountable $J_n$, which implies that $\mu E=\sum\mu(X_\alpha\cap E)=
    \infty$. If $J$ is countable, then
    \[
      \mu E=\mu(E\cap Y)=\sum_{\beta\in J}\mu(E\cap X_\beta)=
      \sum_{\alpha\in I}\mu(E\cap X_\alpha).
    \]
    Thus, $\mu E=\sum\mu(E\cap X_\alpha)$.
  \end{proof}
% end
\subsection{The $L^p$ Spaces}
  \paragraph{41.}
  \begin{proof}
    First, we prove the following lemma: For $a,b\ge 0$, $|a-b|^p\le 2|a^p-
    b^p|$. It suffices to show that $(a-b)^p\le 2(a^p-b^p)$ for all $a\ge b\ge
    0$. If $p=1$, then the inequality holds trivially. Suppose $p>1$ and put
    $h(x)=(x-b)^p-2(x^p-b^p)$. Clear that $h(b)=0$. Meanwhile, for $x\ge b$,
    \[
      h\hp(x)=p(x-b)^{p-1}-2px^{p-1}=px^{p-1}
      \left(\left(1-\frac{b}{x}\right)^{p-1}-2\right)<0.
    \]
    Thus, $h(x)\le 0$ for all $x\ge b$, which implies that $|a-b|^p\le 2|a^p-
    b^p|$ for all $a,b\ge 0$.\par
    Since $|f|^p$ is integrable, by Prob. 21(a), the set on which $f$ does not
    vanish is of $\sigma$-finite measure. Hence, $\int|f|^p=\sup\int\varphi$
    as $\varphi$ ranges over all simple functions that each vanishes outside a
    set of finite measure. Thus, for every $\vep>0$, there is a nonnegative
    simple function $\tilde{\varphi}\le|f|^p$, vanishing outside a set $E$ of
    finite measure, such that $\int(|f|^p-\tilde{\varphi})<\vep^p/2$. Put
    $\varphi=\sqrt[p]{\tilde{\varphi}}$, which is also a nonnegative simple
    function that vanishes outside $E$. Meanwhile, by the previous inequality,
    \[
      \|f-\varphi\|_p^p=
      \int|f-\varphi|^p\le
      2\int(|f|^p-\tilde{\varphi})<
      \vep^p.
    \]
    Namely, Prop. 26 holds.
  \end{proof}

  \paragraph{42.}
  \begin{proof}
    We may assume without loss of generality that $g$ is nonnegative. Assume,
    to obtain a contradiction, that $\esssup|g|>M$, that is, the measure of
    $E=\{t:\,g(t)>M+\eta\}$ is nonzero for some positive $\eta$. Meanwhile,
    since $\mu$ is finite, $\mu E<\infty$. Let $\varphi=\chi_E$, which is
    clearly a simple function. Then
    \[
      \left|\int g\varphi\right|\ge
      (M+\eta)\mu E>
      M\|\varphi\|_1.
    \]
    Contradiction. Hence, $\esssup|g|\le M$, implying that $g\in L^\infty$.
  \end{proof}

  \paragraph{43.}
    The case $p=1$ is left undone.
  \begin{proof}
    Suppose that $p>1$.
    Let $\langle X_n\rangle$ be such that $\mu X_n<\infty$ and $X=\bigcup X_n$.
    Furthermore, we may assume without loss of generality that $X_n$ are
    disjoint. Put $g_n=\sum g\chi_{X_n}$. By Lemma 27, for $n$, $g\chi_{X_n}\in
    L^q$ and $\|g_n\|_q\le M$. Since $g_n\to g$, by Fatou's lemma, $\|g\|_q\le
    M$. Thus, $g\in L^q$.
  \end{proof}

  \paragraph{44.}
  \begin{proof}
    Note that
    \[
      \int|f|^p=\sum\int|f|^p\chi_{E_n}=\sum\int|f_n|^p=\sum\|f_n\|^p.
    \]
    Thus, $f\in L^p$ iff $\sum\|f_n\|^p<\infty$.
  \end{proof}

  \paragraph{45.}
  \begin{proof}
    For every $f\in L^p$ with $\|f\|_p=1$,
    \[
      \int|fg|\le \|f\|_p\|g\|_q = \|g\|_q.
    \]
    Hence, $\|F\|\le\|g\|_q$. For the reverse inequality, put
    \[
      f=(\sgn g)|g|^{q-1}=(\sgn g)|g|^{p/q}.
    \]
    Note that $|f|^p=|g|^q$. Therefore, $g\in L^q$ implies $f\in L^q$.
    Meanwhile, $\|f\|_p^p=\|g\|_q^q$. Hence,
    \[
      \|F\|\|f\|_p \ge |F(f)| = \int|g|^q = \|g\|_q^q
      \quad\Rightarrow\quad
      \|F\|\ge\|g\|_q.
    \]
    Thus, $\|F\|=\|g\|_q$.
  \end{proof}
% end


\section{MODULE DESIGN}
\subsection{DATA PREPROCESSING}
JPEG uses a lossy image compression. Each re-encoding process (new saving) performed on the image leads to further loss of quality. The JPEG algorithm is based on a 8x8 pixel grid. Each 8x8 square grid is thereby treated and compressed separately. If the image is untouched, then all these 8x8 squares will show the same error level potential.
\subsubsection{Algorithm:}
\begin{enumerate}
    \item The image is resaved with 95\%(or 90\%)JPEG quality.
    \item Compare each(8*8) blocks of corresponding original and new resaved image.
\item If image is unmodified, then all 8 x8 squares should have similar error potentials.
\item Else modified areas will appear with a higher potential error level.
\end{enumerate}

INPUT \ \ \ \ : Tampered image

OUTPUT : The output of ELA is image with higher error potential.

\subsection{TRAINING THE CNN}
\begin{figure}[htp]
\centering
\includegraphics[scale=0.5,width=17cm]{Figures/cnn.PNG}
\caption{Training the model}
\label{fig:universe}
\end{figure}
The training process of a CNN is done through an iterative algorithm that alternates between feedforward  and back propagation passes of the data. The weights of the convolutional filters and fully-connected layers are updated at each iteration of the backpropagation passes. CNN is capable of learning classification features directly from the data. The ReLU activation function is applied to each value in the feature maps of every convolutional layer. The convolutional layers are followed by the max pooling layers. We use a batch normalization layer after each regular convolutional layer. However, the prediction error convolutional filters outputs are directly convolved with the next convolutional layer without using the batch normalization layer. We consider the RMSProp optimizer  to train our model. This module is proposed to extract features related to the traces left by different editing operations, and which are utilized to check the authenticity of images.

INPUT \ \ \ \ : The pre-processed images.

OUTPUT : The trained classifier to detect the tampered images.

\subsubsection{Algorithm:}
1. Initialize w_k 's\  using \ randomly\  drawn\  weights.

2. Assign i=1

3. While  i \leq  maximum\_iteration \ do

4. Feedforward  pass.

5. Update filter weights  and backpropagate errors.

6. Set w_k(0, 0)^(^1^) = 0  for \ all \ K \ filters

7. Normalize w_k^(^1^)  ’s \ such \ that \  \Sigma_l_,_m_ \neq _0 w_k^(^1^)   (l, m) = 1

8. Set w_k(0, 0)^(^1^) = - 1  \ for \ all \  K \ filters

9. i = i + 1

10. If training accuracy converges then

11. exit

12. end
\newpage
\subsubsection{RMSPROP OPTIMISER }
The RMSprop optimizer is similar to the gradient descent algorithm with momentum. The RMSprop optimizer restricts the oscillations in the vertical direction. Therefore, we can increase our learning rate and our algorithm could take larger steps in the horizontal direction converging faster.

              vdw =\beta. vdw  + (1- \beta).dw2

                     where  \beta \ is \ a \ momentum \ in \ learning \ rate

              vdb  = \beta. vdw  + (1- \beta).db2

              W = W -\alpha dw/(\sqrt(v\_db )+∈)

                     where W are weights to be updated during the back propagation and  \alpha \ is \ a \ value \  always \textless 1.

              b = b - \alpha dw/(\sqrt(v\_db )+\epsilon)

                     where b is the calculated gradient of the system while learning and \epsilon \  is\ a \ small \ value \  added \ to \ prevent \ gradient \ from \ blowing \ up.

\subsubsection{CROSS ENTROPY LOSS FUNCTION}
Cross Entropy is commonly-used in binary classification (labels are assumed to take values 0 or 1) as a loss function (For multi-classification, use Multiclass Cross Entropy), which is computed by

       L=-1/n \Sigma_(i_=_1)^n [\ (\ y^(^i^)  log(\ \^y^i)\ +(\ 1-y^i)log(\ 1-\^y^i) ]\

Where L is a loss calculated which is the difference between the actual and the predicted output.
Cross entropy measures the divergence between two probability distribution, if the cross entropy is large, which means that the difference between two distribution is large, while if the cross entropy is small, which means that two distribution is similar to each other. When the difference between predicted value and actual value is large, the learning speed, i.e., convergence speed, is fast, otherwise, the difference is small, the learning speed is small. Cross entropy cost function has the advantages of fast convergence and is more likely to reach the global optimization.

\subsection{CLASSIFICATION BLOCK}
\begin{figure}[htp]
\centering
\includegraphics[scale=0.5,width=10cm]{Figures/soft.PNG}
\caption{Classification}
\label{fig:universe}
\end{figure}
This first layer of the classification block contains about 256 nodes and accepts input as vectors. This layer uses ReLU activation function where negative values will not be considered significant hence makes it more efficient. To give the accurate result the last layer in the classification block of the neural network uses the softmax activation function which gives the highest activation level. The CNN model extracts the feature and classifies the pre-processed forged image to detect whether the given image is spiced or not.

\subsection{COPY MOVE TYPE DETECTION}
A copy move attack is commonly used to conceal parts of an image or to remove unwanted portions in an image. A portion from the picture is copied and pasted over any unwanted portion in the same image.
This block is where the image that is not detected to be spliced is checked for copy move forgery using the following steps:
\begin{enumerate}
    \item Blur image for eliminating image details.

\item Convert image to degraded palette.

\item Decompose the image into small NxN pixel blocks.

\item Alphabetically order these blocks by their pixel values.

\item Extract only these adjacent blocks which have small absolute color difference.

\item Cluster these blocks into clusters by intersection area among blocks.

\item Extract only these clusters which are bigger than block size.

\item Extract only these clusters which have similar cluster, by using some sort of similarity function (in this case Hausdorff distance between clusters).

\item Draw discovered similar clusters on image.

\end{enumerate}

\section{COMPLEXITY ANALYSIS}
\subsection{COMPLEXITY OF THE PROJECT}
\begin{itemize}
    \item  The complexity of the project lies in determining the passive type of forgery the image has undergone  rather than just determining if the image is only forged or not. The neural network is used to detect the spliced images.
    \item The accuracy of the neural network also affects the efﬁciency of the output. Hence efficient loss function and optimiser with the appropriate parameters needs to be chosen.
    \item Certain additional hints need to be added to the images in order to efficiently detect the tampered regions in the images. Error Level Analysis is used for this purpose. This analysis is made to all images irrespective of their formats and error potential.
    \item Determining the identical regions in a copy move image is done by the extraction of similar properties between those regions for which efficient similarity functions has to be used.
    \item The identification of copy move image is done without any comparison with the original image but rather the input image itself which makes it a tedious task to implement.
\end{itemize}