\chapter{fMRI model specification \label{Chap:fmri_spec}}

Statistical analysis of fMRI data uses a mass-univariate approach based on General Linear Models (GLMs). It comprises the following steps (1) specification of the GLM design matrix, fMRI data files and filtering (2) estimation of GLM parameters using classical or Bayesian approaches and (3) interrogation of results using contrast vectors to produce Statistical Parametric Maps (SPMs) or Posterior Probability Maps (PPMs).

The design matrix defines the experimental design and the nature of hypothesis testing to be implemented.  The design matrix has one row for each scan and one column for each effect or explanatory variable. (eg. regressor or stimulus function). You can build design matrices with separable session-specific partitions.  Each partition may be the same (in which case it is only necessary to specify it once) or different.

Responses can be either event- or epoch related, the only distinction is the duration of the underlying input or stimulus function. Mathematically they are both modeled by convolving a series of delta (stick) or box functions (u), indicating the onset of an event or epoch with a set of basis functions.  These basis functions model the hemodynamic convolution, applied by the brain, to the inputs.  This convolution can be first-order or a generalized convolution modeled to second order (if you specify the Volterra option). The same inputs are used by the Hemodynamic model or Dynamic Causal Models which model the convolution explicitly in terms of hidden state variables.

Event-related designs may be stochastic or deterministic.  Stochastic designs involve one of a number of trial-types occurring with a specified probability at successive intervals in time.  These probabilities can be fixed (stationary designs) or time-dependent (modulated or non-stationary designs).  The most efficient designs obtain when the probabilities of every trial type are equal. A critical issue in stochastic designs is whether to include null events. If you wish to estimate the evoked response to a specific event type (as opposed to differential responses) then a null event must be included (even if it is not modeled explicitly).

\begin{figure}
\begin{center}
\includegraphics[width=100mm]{fmri_spec/fmri_model}
\end{center}
\caption{\em After starting SPM in fMRI mode and pressing the ``Specify 1st-level'' button, the SPM batch editor window should appear as above. The options for ``fMRI model specification'' can be examined by clicking on them. A single click will bring up some help text in the lower subwindow (not shown in the above graphic). Options highlighted with a ``$<$-X'' are mandatory and must be filled in by the user. Each of the options shown above is described in this chapter. \label{spec}}
\end{figure}

In SPM, analysis of data from multiple subjects typically proceeds in two stages using models at two ``levels''. The ``first level'' models are used to implement a within-subject analysis. Typically there will be as many first level models as there are subjects. Analysis proceeds as described using the ``Specify first level'' and ``Estimate'' options. The results of these analyses can then be presented as ``case studies''. More often, however, one wishes to make inferences about the population from which the subjects were drawn. This is an example of a ``Random-Effects (RFX) analysis'' (or, more properly, a mixed-effects analysis). In SPM, RFX analysis is implemented using the ``summary-statistic'' approach where contrast images from each subject are used as summary measures of subject responses. These are then entered as data into a ``second level'' model.

Figure~\ref{spec} shows how the SPM graphics window appears during fMRI model specification.

\section{Timing parameters}

Specify various timing parameters needed to construct the design matrix. This includes the units of the design specification and the interscan interval.

Also, with long TRs you may want to shift the regressors so that they are aligned to a particular slice.  This is effected by changing the microtime resolution and onset.

\subsection{Units for design}

The onsets of events or blocks can be specified in either scans or seconds.

\subsection{Interscan interval}

Interscan interval, TR, (specified in seconds).  This is the time between acquiring a plane of one volume and the same plane in the next volume.  It is assumed to be constant throughout.

\subsection{Microtime resolution}

In Echo-Planar Imaging (EPI), data is acquired a plane at a time. To acquire a whole volume of data takes at least a second or two.

It is possible, however, that experimental events may occur between scan (volume) acquisition times. This can be specified when building your design matrix either by (i) specifying your design in scans and using non-integer values  or (ii) specifying your design in seconds at a resolution greater than the TR.

SPM takes these timing specifications and builds its regressors using a `microtime' time-scale. The microtime resolution, t, is the number of time-bins per scan.

Do not change this parameter unless you have a long TR and wish to shift regressors so that they are aligned to a particular slice.

\subsection{Microtime onset}

The microtime onset, t0, is the first time-bin at which the regressors are resampled to coincide with data acquisition.  If t0 = 1 then the regressors will be appropriate for the first slice.  If you want to temporally realign the regressors so that they match responses in the middle slice then make t0 = t/2 (assuming there is a negligible gap between volume acquisitions).

Do not change the default setting unless you have a long TR.

A typical use of the t and t0 parameters is to set them to correspond to the results of any slice timing correction you have made eg. if you have 24 slices and have made slice 12 the reference slice you would set t=24, t0=12.

\section{Data \& Design}

The design matrix defines the experimental design and the nature of hypothesis testing to be implemented.  The design matrix has one row for each scan and one column for each effect or explanatory variable. (e.g. regressor or stimulus function).  Figure~\ref{design} shows an example of a design matrix.

\begin{figure}
\begin{center}
\includegraphics[width=100mm]{fmri_spec/design}
\end{center}
\caption{\em Design matrix for fMRI data from two sessions. There are 24 experimental conditions for each session. The last two columns model the average activity in each session, giving a total of 50 regressors. There are 191 fMRI scans for each session. The overall design matrix therefore has 382 rows and 50 columns. \label{design}}
\end{figure}

You can build design matrices with separable session-specific partitions.  Each partition may be the same (in which case it is only necessary to specify it once) or different.  Responses can be either event- or epoch related, where the latter model involves prolonged and possibly time-varying responses to state-related changes in experimental conditions.  Event-related response are modelled in terms of responses to instantaneous events.  Mathematically they are both modelled by convolving a series of delta (stick) or box-car functions, encoding the input or stimulus function. with a set of hemodynamic basis functions.

\subsection{Subject/Session}

The design matrix for fMRI data consists of one or more separable, session-specific partitions.  These partitions are usually either one per subject, or one per fMRI scanning session for that subject.

\subsubsection{Scans}

Select the fMRI scans for this session.  They must all have the same image dimensions, orientation, voxel size etc. This is implemented using SPM's file selector.

\subsubsection{Conditions}

You are allowed to combine both event- and epoch-related responses in the same model and/or regressor. Any number of condition (event or epoch) types can be specified.  Epoch and event-related responses are modeled in exactly the same way by specifying their onsets [in terms of onset times] and their durations.  Events are specified with a duration of 0.  If you enter a single number for the durations it will be assumed that all trials conform to this duration.For factorial designs, one can later associate these experimental conditions with the appropriate levels of experimental factors.

\paragraph{Condition}

An array of input functions is constructed, specifying occurrence events or epochs (or both). These are convolved with a basis set at a later stage to give regressors that enter into the design matrix. Interactions of evoked responses with some parameter (time or a specified variate) enter at this stage as additional columns in the design matrix with each trial multiplied by the [expansion of the] trial-specific parameter. The 0th order expansion is simply the main effect in the first column.

\subparagraph{Name}

Condition Name

\subparagraph{Onsets}

Specify a vector of onset times for this condition type. This can be entered using the keyboard eg. typing in ``100 300'' and then hitting return or ``100;300'' or ``[100,300]'' or ``[100,300]''.

More usually, however, this specification takes place using variables that have been created before and loaded into matlab. For example, an \verb!my_onsets! cell array\footnote{Cell arrays are usually used in preference to matrices as different event types can then have different numbers of events.} might exist in a file you created earlier called \verb!my_design.mat!. You would then type \verb!load my_design! at the matlab command prompt before pressing the `Specify 1st-level' button.

You could then specify the onsets for condition 2 by typing in eg. \verb!my_onsets{2}! instead of entering the numbers via the keyboard.

\subparagraph{Durations}

Specify the event durations. Epoch and event-related responses are modeled in exactly the same way but by specifying their different durations.  Events are specified with a duration of 0.  If you enter a single number for the durations it will be assumed that all trials conform to this duration. If you have multiple different durations, then the number must match the number of onset times.

\subparagraph{Time Modulation}

This option allows for the characterisation of nonstationary responses. Specifically, you can model either linear or nonlinear time effects. For example, 1st order modulation would model the stick functions and a linear change of the stick function heights over time. Higher order modulation will introduce further columns that contain the stick functions scaled by time squared, time cubed etc.

\subparagraph{Parametric Modulations}

The stick function itself can be modulated by some parametric variate (this can be time or some trial-specific variate like reaction time) modeling the interaction between the trial and the variate. The events can be modulated by zero or more parameters.

See \cite{parametric_pet,parametric_fmri} for further details of parametric modulations.

\subsubsection{Multiple conditions}

If you have multiple conditions then entering the details a condition at a time is very inefficient. This option can be used to load all the required information in one go.

You will need to create a \verb!*.mat! file containing the relevant information. This \verb!*.mat! file must include the following cell arrays: names, onsets and durations eg. \verb!names{2}='SSent-DSpeak'!, \verb!onsets{2}=[3 5 19 222]!, \verb!durations{2}=[0 0 0 0]! contain the required details of the second condition. These cell arrays may be made available by your stimulus delivery program eg. COGENT. The duration vectors can contain a single entry if the durations are identical for all events.

You then need to use SPM's file selector to select this \verb!*.mat! file.

\subsubsection{Regressors}

Regressors are additional columns included in the design matrix, which may model effects that would not be convolved with the haemodynamic response.  One such example would be the estimated movement parameters, which may confound the data.

\paragraph{Regressor}

\subparagraph{Name}

Enter name of regressor eg. First movement parameter

\subparagraph{Value}

Enter the values that the regressor takes. This could also be, for example, the name of a variable in MATLAB's work space that you have previously loaded in from a file. This might be a subjects movement parameters or reaction times.

\subsubsection{Multiple regressors}

If you have mutliple regressors eg. realignment parameters, then entering the details a regressor at a time is very inefficient. This option can be used to load all the required information in one go.

You will first need to create a \verb!*.mat! file containing a matrix R. Each column of R will contain a different regressor. When SPM creates the design matrix the regressors will be named R1, R2, R3, ..etc.

You then need to use SPM's file selector to select this \verb!*.mat! file.

\subsubsection{High-pass filter}

The default high-pass filter cutoff is 128 seconds. Slow signal drifts with a period longer than this will be removed. Use ``Explore design'' to ensure this cut-off is not removing too much experimental variance. This is described later in section~\ref{explore}. High-pass filtering is implemented using a residual forming matrix (i.e. it is not a convolution) and is simply a way to remove confounds without estimating their parameters explicitly.  The constant term is also incorporated into this filter matrix.

\section{Factorial design}

If you have a factorial design then SPM can automatically generate the contrasts necessary to test for the main effects and interactions.

This includes the F-contrasts necessary to test for these effects at the within-subject level (first level) and the simple contrasts necessary to generate the contrast images for a between-subject (second-level) analysis.

To use this option, create as many factors as you need and provide a name and number of levels for each.  SPM assumes that the condition numbers of the first factor change slowest, the second factor next slowest etc. It is best to write down the contingency table for your design to ensure this condition is met. This table relates the levels of each factor to the conditions.

For example, if you have 2-by-3 design  your contingency table has two rows and three columns where the the first factor spans the rows, and the second factor the columns. The numbers of the conditions are 1,2,3 for the first row and 4,5,6 for the second.

See \cite{rnah_anova} for more information on SPM and factorial designs.

\subsection{Factor}

Add a new factor to your experimental design.

\subsubsection{Name}

Name of factor, eg. 'Repetition'

\subsubsection{Levels}

Enter number of levels for this factor, eg. 2

\section{Basis Functions}

SPM uses basis functions to model the hemodynamic response. This could be a single basis function or a set of functions. The most common choice is the `Canonical HRF' with or without time and dispersion derivatives.

\subsection{Canonical HRF}

Canonical Hemodynamic Response Function (HRF). This is the default option. Contrasts of these effects have a physical interpretation and represent a parsimonious way of characterising event-related responses. This option is also useful if you wish to look separately at activations and deactivations. This is implemented using a t-contrast with a +1 or -1 entry over the canonical regressor.

\subsubsection{Model derivatives}

Model HRF Derivatives. The canonical HRF combined with time and dispersion derivatives comprise an `informed' basis set, as the shape of the canonical response conforms to the hemodynamic response that is commonly observed. The incorporation of the derivative terms allow for variations in subject-to-subject and voxel-to-voxel responses. The time derivative allows the peak response to vary by plus or minus a second and the dispersion derivative allows the width of the response to vary by a similar amount.

A positive estimate of the time-derivative regression coefficient implies that the peak hemodynamic response occurs earlier than usual ie. than would be expected using just the canonical regressor. A positive estimate for the dispersion derivative implies a less dispersed response than usual.

The informed basis set requires an SPM{F} for inference. T-contrasts over just the canonical are perfectly valid but assume constant delay/dispersion. The informed basis set compares favourably with eg. FIR bases on many data sets \cite{rnah_basis}.

\subsection{Other basis sets}

The other basis sets supported by SPM are

\begin{enumerate}
\item{Fourier Set}
\item{Fourier Set (Hanning)}
\item{Gamma Functions}
\item{Finite Impulse Response (FIR)}
\end{enumerate}

For each of these options you must also specify the {\bf window length} which is the length in seconds of the post-stimulus time window that the basis functions span. You must also specify the {\bf order}, that is, how many basis functions to use.

Usually, an informed basis set should be sufficient for most data sets. If this does not provide a good fit to the data it may be worthwhile re-considering how the neuronal events are modelled ie. is the timing correct ? should events be split into subsets ?

Alternatively, the gamma basis functions are an interesting choice as a particular linear combination of them is actually used to specify the canonical HRF. The FIR approach is of interest as it is equivalent to the method of `selective averaging'. See \cite{rnah_conv} for further details.

\section{Model Interactions (Volterra)}

Generalized convolution of inputs, $U$, with basis set, $bf$.

For first order expansions the causes are simply convolved (e.g. stick functions) in $U$ by the basis functions in $bf$ to create a design matrix $X$.  For second order expansions new entries appear that correspond to the interaction among the original causes. The basis functions for these effects are two dimensional and are used to assemble the second order kernel.

Interactions or response modulations can enter at two levels.  Firstly the stick function itself can be modulated by some parametric variate. This can be time or some trial-specific variate like reaction time modeling the interaction between the trial and the variate. Secondly interactions among the trials themselves can be modeled using a Volterra series formulation that accommodates interactions over time (and therefore within and between trial types).

This last option is useful for accommodating nonlinearities in the hemodynamic response. For example, if two events occur within a second or so of each other then the hemodynamic response to the pair may be less than the sum of the responses to each event when occuring in isolation. This type of `sub-linear' response can be modelled using Volterra kernels. See \cite{balloon} for further details.

\section{Directory}

Select a directory where the SPM.mat file containing the specified design matrix will be written. If this directory already contains an SPM.mat file then SPM will warn you of this before overwriting it, when the specification job is run.

\section{Global normalisation}

SPM can normalise fMRI data in one of two ways. These are selected using the options `None' (the default) and `Scaling'.

Both methods are based on first estimating the average within-brain fMRI signal, $g_{ns}$, where $n$ denotes scan and $s$ denotes session. If you select `Scaling', SPM will multiply each fMRI value in scan $n$ and session $s$ by $100/g_{ns}$.

If you select ``None'' then SPM computes the grand mean value, $g_s=\frac{\sum_{n=1}^N g_{ns}}{N}$ where N is the number of scans in that session. This is the fMRI signal averaged over all voxels within the brain and all time points within session $s$. SPM then implements ``Session-specific grand mean scaling'' by multiplying each fMRI data point in session $s$ by $100/g_s$.

See \cite{ja_global} for further discussion of this issue.

\section{Explicit mask}

Specify an image for explicitly masking the analysis. A sensible option here is to use a segmentation of structural images to specify a within-brain mask. If you select that image as an explicit mask then only those voxels in the brain will be analysed. This both speeds the estimation and restricts SPMs/PPMs to within-brain voxels. Alternatively, if such structural images are unavailable or no masking is required, then leave this field empty.

\section{Serial correlations}

Serial correlations in fMRI time series due to aliased biorhythms and unmodelled neuronal activity can be accounted for using an autoregressive AR(1) model during Classical (ReML) parameter estimation.

This estimate assumes the same correlation structure for each voxel, within each session.  ReML estimates are then used to correct for non-sphericity during inference by adjusting the statistics and degrees of freedom appropriately. The discrepancy between estimated and actual correlations are greatest at low frequencies.  Therefore specification of the high-pass filter is particularly important.

Serial correlation can be ignored if you choose the ``none'' option. Note that the above options only apply if you later specify that your model will be estimated using the Classical (ReML) approach. If you choose Bayesian estimation these options will be ignored. For Bayesian estimation, the choice of noise model (AR model order) is made under the estimation options. See \cite{peb1,vb_fmri_ar} for further discussion of these issues.

\section{Reviewing your design \label{explore}}

After you have completed the SPM ``job'' file for specifying your fMRI design, and have run it, you will then be able to review your design by pressing the ``Review'' button in SPM's button window (the top-left window). This is particularly useful, for example, for checking that your experimental variance has not been removed by high-pass filtering, as shown in Figure~\ref{rev4}.

\begin{figure}
\begin{center}
\includegraphics[width=100mm]{fmri_spec/reg4}
\end{center}
\caption{\em After pressing ``Review'', selecting the pull-down `Design' menu, Explore-$>$Session, and selecting the regressor you wish to look at, you should get a plot similar to the one above. The top row shows time and frequency domain plots of the time-series corresponding to this regressor. In this particular case we have four events. Each event or ``stick function'' has been convolved with the hemodynamic response function shown in the bottom panel. The frequency domain graph is useful for checking that experimental variance is not removed by high-pass filtering. The grayed out section of the frequency plot shows those frequencies which are removed. For this regressor we have plenty of remaining experimental variance (see the peak at about 0.04Hz). \label{rev4}}
\end{figure}


%\documentclass [12pt]{article}
%\usepackage{amssymb}
\documentclass[twocolumn,showpacs,preprintnumbers,amsmath,amssymb]{revtex4}
\usepackage{dcolumn}
\usepackage{bm}

\usepackage{gb4e} % added by ES

\begin {document}

\title {The strong superadditivity conjecture holds for the quantum depolarizing channel in any dimension}

\author {Grigori G. Amosov}

\email {gramos@mail.ru}

\affiliation {Department of Higher Mathematics\\
Moscow Institute of Physics and Technology\\ Dolgoprudny
141700\\RUSSIA}

\date{\today}

\begin {abstract}
Given a quantum channel $\Phi $ in a Hilbert space $H$ put $\hat
H_{\Phi}(\rho)=\min \limits _{\rho _{av}=\rho }\Sigma
_{j=1}^{k}\pi _{j}S(\Phi (\rho _{j}))$, where $\rho _{av}=\Sigma
_{j=1}^{k}\pi _{j}\rho _{j}$, the minimum is taken over all
probability distributions $\pi =\{\pi _{j}\}$ and states $\rho
_{j}$ in $H$, $S(\rho)=-Tr\rho\log\rho$ is the von Neumann
entropy of a state $\rho$. The strong superadditivity conjecture
states that $\hat H_{\Phi \otimes \Psi}(\rho)\ge \hat
H_{\Phi}(Tr_{K}(\rho))+\hat H_{\Psi}(Tr_{H}(\rho))$ for two
channels $\Phi $ and $\Psi $ in Hilbert spaces $H$ and $K$,
respectively. We have proved the strong superadditivity
conjecture for the quantum depolarizing channel in any dimensions.

\end {abstract}

\pacs {03.67.-a, 03.67.Hk}

\maketitle

\section {Introduction}

A linear trace-preserving map $\Phi $ on the set of states
(positive unit-trace operators) $\mathfrak{S}(H)$ in a Hilbert
space $H$ is said to be a quantum channel if $\Phi ^{*}$ is
completely positive (\cite {Hol}). The channel $\Phi $ is called
bistochastic if $\Phi (\frac {1}{d}I_{H})=\frac {1}{d}I_{H}$.
Here and in the following we denote by $d$ and $I_{H}$ the
dimension of $H,\ dimH=d<+\infty ,$ and the identity operator in
$H$, respectively.

Given a quantum channel $\Phi $ in a Hilbert space $H$ put (\cite
{Sh})
\begin {equation}\label {quant}
\hat H_{\Phi}(\rho)=\min \limits _{\rho _{av}=\rho}\sum \limits
_{j=1}^{k}\pi _{j}S(\Phi (\rho _{j})),
\end {equation}
where $\rho _{av}=\sum \limits _{j=1}^{k}\pi _{j}\rho _{j}$ and
the minimum is taken over all probability distributions $\pi
=\{\pi _{j}\}$ and states $\rho _{j}\in \mathfrak{S}(H)$. Here
and in the following $S(\rho)=-Tr(\rho\log \rho)$ is the von
Neumann entropy of a state $\rho $. The strong superadditivity
conjecture states that
\begin {equation}\label {strong}
\hat H_{\Phi \otimes \Psi}(\rho)\ge \hat
H_{\Phi}(Tr_{K}(\rho))+\hat H_{\Psi}(Tr_{H}(\rho)),
\end {equation}
$\rho \in \mathfrak{S}(H\otimes K)$ for two channels $\Phi $ and
$\Psi $ in Hilbert spaces $H$ and $K$, respectively. Start-ex.

%%%%%%%%%%%%%%%%%INSERT HERE

\ea\label{ex:culo:24}
  \ea
\textit{Aber Sie wissen nichts. \textup{(GO\_FICTION\_007)}}\\
  \ex
\textit{But you don't know anything. \textup{(ETrans\_FICTION\_007)}}
  \z
\z

\ea \label{ex:culo:25}
  \ea
\textit{Die Frauen hat das nicht gerade zimperlich gemacht. \textup{(GO\_FICTION\_007)}}\\
   \ex \textit{The women weren't exactly prudes. \textup{(ETrans\_FICTION\_007)}}
   \z
\z

\ea \label{ex:culo:26}
   \ea
\textit{Wenn wir also in diesem Sinne unseren Interessen und Werten dienen wollen, dann   muss Europa erstens wachsam gegenüber den neuen Bedrohungen sein, denen die   freien und offenen Gesellschaften ausgesetzt sind. \textup{(GO\_SPEECH\_010)}}\\
   \ex
   \textit{So if we want to serve our interests and values in line with this definition, Europe must:   firstly, be vigilant to the new threats to which the free and open societies are exposed.   \textup{(ETrans\_SPEECH\_010)}}
   \z
\z

\ea \label{ex:culo:27}
     \ea \textit{Every country has its own political issues and this makes resolution of our disputes increasingly difficult.} (EO\_SPEECH\_009)\\
      \ex \textit{Jedes Land hat seine eigenen politischen Anliegen, wodurch die Streitschlichtung zunehmend erschwert wird.} (GTrans\_SPEECH\_009)
      \z
\z

\ea \label{ex:culo:28}
   \ea \textit{And if the EU does as it has in the past, and provides financing to Airbus at below-  market rates of return, we could be facing a very large and highly contentious fight in the WTO.} (EO\_SPEECH\_009)\\
    \ex \textit{Und wenn die EU sich wie in der Vergangenheit verhält und dem Airbus Finanzierung zu Zinssätzen unter den auf dem Markt gültigen bietet, könnte uns ein großer und sehr kontroverser Kampf in der WTO bevorstehen.} (GTrans\_SPEECH\_009)
    \z
\z

%%%%%%%%%%%%END INSERT

The infimum of the output entropy of a quantum channel $\Phi $ is
defined by the formula
\begin {equation}\label {addit}
S_{min}(\Phi)=\inf \limits _{\rho\in \mathfrak{S}(H)}S(\Phi
(\rho)).
\end {equation}
The additivity conjecture for the quantity $S_{min} (\Phi)$ states
(\cite {Hol2})
\begin {equation}\label {conj}
S_{min} (\Phi\otimes \Psi)=S_{min} (\Phi)+S_{min} (\Psi)
\end {equation}
for an arbitrary quantum channel $\Psi $. It was shown in (\cite
{Sh}) that if the strong superadditivity conjecture holds, then
the additivity conjecture for the quantity $S_{min}$ holds too.
Nevertheless the conjecture (\ref {strong}) is stronger than
(\ref {addit}).

In the present paper we shall prove the strong superadditivity
conjecture for the quantum depolarizing channel for all dimensions
of $H$.

\section {The estimation of the output entropy}

Our approach is based upon the estimate of the output entropy
proved in \cite {C02}. Combining formulae (111) and (112) in
\cite {C02} we get the lemma formulated below.

{\bf Lemma.}{\it Let $\Phi _{dep}(\rho)=(1-p)\rho+\frac
{p}{d}I_{H},\ \rho\in \mathfrak{S} (H),\ 0\le p\le \frac
{d^{2}}{d^{2}-1},$ be the quantum depolarizing channel in the
Hilbert space $H$ of the dimension $d$. Then, for any quantum
channel $\Psi $ there exist the orthonormal basis $\{e_{s},\ 1\le
s\le d\}$ in $H$ and $d$ states $\rho_{s}\in \mathfrak {S}(K),\
1\le s\le d,$ such that
\begin {equation}\label {XJ}
S((\Phi _{dep}\otimes \Psi)(\rho))\ge -(1-\frac {d-1}{d}p)\log
(1-\frac {d-1}{d}p)-
\end {equation}
$$
\frac {d-1}{d}p\log \frac {p}{d}+ \frac {1}{d}\sum \limits
_{s=1}^{d}S(\Psi (\rho_{s}))
$$
and
$$
\frac {1}{d}\sum \limits _{s=1}^{d}\rho _{s}=Tr_{H}(\rho ),
$$
where $\rho\in \mathfrak{S} (H\otimes K),\
\rho_{s}=dTr_{H}((|e_{s}><e_{s}|\otimes I_{K})\rho)\in \mathfrak
{S} (K),\ 1\le s\le d$. }

In the present paper our goal is to prove the following theorem.

{\bf Theorem.}{\it Let $\Phi _{dep}$ be the quantum depolarizing
channel in the Hilbert space of the dimension $d$. Then, for an
arbitrary quantum channel $\Psi $ in a Hilbert space $K$ the
strong superadditivity conjecture holds, i.e.
\begin {equation}\label {theorem}
\hat H_{\Phi _{dep}\otimes \Psi}(\rho)\ge \hat H_{\Phi
_{dep}}(Tr_{K}(\rho))+\hat H_{\Psi}(Tr_{H}(\rho)).
\end {equation}
}

Proof.

Suppose that
\begin {equation}\label {avr}
\rho =\sum \limits _{j=1}^{k}\pi _{j}\rho _{j}
\end {equation}
and the states $\rho _{j},\ 1\le j\le k,$ form the optimal
ensemble for (\ref {quant}) in the sense that
\begin {equation}\label {avr2}
\hat H_{\Phi _{dep}\otimes \Psi}(\rho)=\sum \limits _{j} \pi
_{j}S((\Phi _{dep}\otimes \Psi)(\rho _{j}))
\end {equation}
Applying (\ref {XJ}) to each element of the sum in (\ref {avr2})
we get
\begin {equation}\label {A1}
\hat H_{\Phi _{dep}\otimes \Psi}(\rho)\ge -(1-\frac
{d-1}{d}p)\log (1-\frac {d-1}{d}p)-
\end {equation}
$$
\frac {d-1}{d}p\log \frac {p}{d}+\frac {1}{d}\sum \limits
_{j=1}^{k}\pi _{j}\sum \limits _{s=1}^{d}S(\Psi (\rho_{js})),
$$
where $\rho_{js}=dTr_{H}((|e_{js}><e_{js}|\otimes I_{K})\rho
_{j})\in \mathfrak {S} (K),\ 1\le j\le d$, and each the set
$\{e_{js},\ 1\le s\le d\}$ forms the orthonormal basis of $H$ for
$1\le j\le k$.

It follows from Lemma that
\begin {equation}\label {Sup1}
\frac {1}{d}\sum \limits _{j=1}^{k}\pi _{j}\sum \limits
_{s=1}^{d}\Psi (\rho_{js})=\sum \limits _{j=1}^{k}\pi _{j}\Psi (
Tr_{H}(\rho _{j}))=\Psi (Tr_{H}(\rho)).
\end {equation}
The equality (\ref {Sup1}) results in
\begin {equation}\label {E2}
\frac {1}{d}\sum \limits _{j=1}^{k}\pi _{j}\sum \limits
_{s=1}^{d}S(\Psi (\rho_{js}))\ge \hat H_{\Psi}(Tr_{H}(\rho)).
\end {equation}
Notice that the quantity (\ref {quant}) is always bounded from
below by the quantity (\ref {addit}). For the quantum
depolarizing channel $\Phi _{dep}$ (\ref {quant}) coincides with
(\ref {addit}) for any state because (\ref {addit}) is achieved on
any pure input state due to the covariance property of $\Phi
_{dep}$. Thus, we get
\begin {equation}\label {E3}
\hat H_{\Phi _{dep}}(\rho)=-(1-\frac {d-1}{d}p)\log (1-\frac
{d-1}{d}p)-
\end {equation}
$$
\frac {d-1}{d}p\log \frac {p}{d}=S_{min} (\Phi _{dep})
$$
for any state $\rho \in \mathfrak {S}(H)$. Taking into account
(\ref {A1}),(\ref {E2}) and (\ref {E3}) we get
$$
\hat H_{\Phi _{dep}\otimes \Psi}(\rho)\ge \hat H_{\Phi _{dep}
}(Tr_{K}(\rho))+\hat H_{\Psi}(Tr_{H}(\rho)),
$$
$\rho \in \mathfrak{S}(H\otimes K).$ Thus, the strong
superadditivity conjecture for the quantum depolarizing channel
is proved.

$\Box $

\section {Conclusion}

At the first time the additivity conjecture (\ref {conj}) for the
quantum depolarizing channel was proved in \cite {C02}. The method
was based upon the estimation of $l_{p}$-norms of the channel. On
the other hand in the papers \cite {Amo, Amo1, Amo2} it was shown
that the decreasing property of the relative entropy also can be
used to prove the additivity conjecture for some partial cases at
least. In the present paper we have proved that the estimation of
the output entropy obtained in \cite {C02} allows to prove the
strong superadditivity conjecture (\ref {strong}) for the quantum
depolarizing channel. One of a possible basis for considering the
strong superadditivity conjecture can be drawn from the paper
\cite {Sh}. There was presented the proof of the global
equivalence of the additivity conjecture for the constrained
channels and the strong superadditivity conjecture.

\section*{Acknowledgments}

The author is grateful to M.E. Shirokov for an inspiration of this
work and many fruitful discussions. The work is partially
supported by intas grant Ref. Nr. 06-1000014-6077.

\begin {thebibliography}{99}

\bibitem {Amo} Amosov G.G. Remark on the additivity conjecture for
the depolarizing quantum channel. Probl. Inf. Transm. 42 (2006)
3-11; e-print quant-ph/0408004.

\bibitem {Amo1} Amosov G.G. On the Weyl  channels being covariant
with respect to the maximum commutative group of unitaries. J.
Math. Phys. 48 (2007); e-print quant-ph/0605177 v.3.

\bibitem {Amo2} Amosov G.G. On the additivity conjecture for the
Weyl channels being covariant with respect to the maximum
commutative group of unitaries. e-print quant-ph/0606040 v.3.

\bibitem {AHW} Amosov G.G., Holevo A.S., Werner R.F. On some additivity problems in
quantum information theory.  Probl. Inf. Transm. 2000. V. 36. N 4.
P. 24-34; e-print quant-ph/0003002.

\bibitem {Ruskai} Datta N, Ruskai M.B. Maximal output purity and capacity for asymmetric unital qudit channels
J. Physics A: Mathematical and General 38 (2005) 9785-9802.
e-print quant-ph/0505048.

\bibitem {Fukuda} Fukuda M., Holevo A.S. On Weyl-covariant
channels. e-print quant-ph/0510148.

\bibitem {Hol} Holevo A.S. On the mathematical theory of quantum communication
channels. Probl. Inf. Transm. 8 (1972) 62 - 71.

\bibitem {Hol1} Holevo A.S. Some estimates for the amount of information
transmittable by a quantum communications channel. (Russian)
Probl. Inf. Transm. 9 (1973) 3 - 11.

\bibitem {Hol2} Holevo A.S. Quantum coding theorems. Russ.
Math. Surveys 53 (1998) 1295-1331; e-print quant-ph/9808023.

\bibitem {Sh} Holevo A.S., Shirokov M.E. On Shor's channel
extension and constrained channels. Commun. Math. Phys. 249
(2004) 417-436.

\bibitem {Ivan} Ivanovich I.D. Geometrical description of quantum state
determination. J. Physics A 14 (1981) 3241-3245.

\bibitem {Cerf} Karpov E., Daems D., Cerf N.J. Entanglement
enhanced classical capacity of quantum communication channels
with correlated noise in arbitrary dimensions. e-print
quant-ph/0603286.

\bibitem{C02} King C. The capacity of the quantum depolarizing
channel // IEEE Trans. Inform. Theory. - 2003. - V. 49, N 1. - P.
221-229; e-print quant-ph/0204172.

\end {thebibliography}

\end {document}


%
% set up at March 31th, 2009
%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Perturbation treatment for the time-dependent systems}
\label{perturbation_in_time}
%
%  what's the perturbation treatment for the time-dependent system?
%  quantum transition is mostly important
%  zero order and first order expression
%
In quantum mechanics, the study related to the quantum states can be
divided into two groups:
\begin{itemize}
  \item the possible states for describing the system
  \item the quantum system evolves with time
\end{itemize}

In the first case, all the study concentrate on the eigen states and
eigen values. For the specific system, we choose its CSCCO and
evaluate the corresponding eigen states. By using such eigen states,
we can figure out any physical quantity, obviously such physical
quantity should be time independent; such as the dipole moments for
the molecule.

For the second case, nearly all the study concentrate on the
perturbation treatment for the time dependent system. In practice,
it's usually impossible to derive the general form for the evolution
of wave functions as time varies. Instead, to determine the quantum
transition probabilities is much more important in practical
application. For example, in the photochemistry to determine the
excitation energy level due to some perturbed radiation, or in the
UV spectrum to determine the ultraviolet spectrum intensity. they
are all related to the transition probability between two quantum
states. therefore, we usually express the time dependent part as
some ``perturbed'' operator:
\begin{equation}\label{}
\hat{H} = \hat{H}_{0} + \hat{H}^{'}(t)
\end{equation}
So we calculate the response of the wave functions to this perturbed
operator by progressively expanding it as:
\begin{align}\label{}
\hat{H} &= \hat{H}_{0} + \lambda\hat{H}^{'}(t) \nonumber \\
\Psi(r,t) &= \Psi^{(0)}(r) + \lambda\Psi^{(1)}(r,t) +
\lambda^{2}\Psi^{(2)}(r,t) + \cdots
\end{align}

For the $\hat{H}_{0}$, we can calculate its eigen states. Suggest
that such eigen states for the $\hat{H}_{0}$ are labeled as
$\psi_{i}(r)$ ($i=1,2,\cdots$) so that for the zero order
approximation, an arbitrary state of $\Psi^{(0)}(r)$ can be
expressed as:
\begin{equation}\label{}
\Psi^{(0)}(r) = \sum_{i}a_{i}^{(0)}\psi_{i}(r)
\end{equation}
Here the $\Psi^{(0)}(r)$ can be any states for the $\hat{H}_{0}$.
However, in practical application the system usually resides in the
ground state for the $\hat{H}_{0}$; so here we can extent this
condition by requiring that:
\begin{equation}\label{}
\Psi^{(0)}(r) = \psi_{k}(r)
\end{equation}
So the initial state for the system is assumed in $\ket{k}$ state.
Therefore, for the zero order approximation we have:
\begin{equation}\label{PTFTDSeq:4}
a_{i}^{(0)} = \delta_{ik}
\end{equation}

As the perturbation of $\hat{H}^{'}(t)$ is switched on at $t > 0$,
the original eigen states will be broken down; instead the new
states will be the linear combination of the original states (see
the discussion in \ref{SE:5}):
\begin{equation}\label{PTFTDSeq:1}
\Psi(r,t) = \sum_{i}a_{i}(t)\psi_{i}(r)e^{-iE_{i}t/\hbar}
\end{equation}
Here the coefficients of $a_{i}$ should be time dependent.
Furthermore, in (\ref{PTFTDSeq:1}) the wave function is no longer
the eigen states for Hamiltonian anymore, the new state will be
partially in state $\psi_{i}$ or partially in state $\psi_{j}$,
which is decided by the coefficient of $a_{i}$, it is in turn
influenced by the time of $t$.

In perturbation treatment, now we can expand the $\Psi(r,t)$ as well
as the coefficients of $a_{i}(t)$ in order of $\lambda$. however,
let's firstly bring the (\ref{PTFTDSeq:1}) into the Schrodinger
equation to see the general form:
\begin{equation}\label{}
i \hbar \frac{\partial \Psi(r,t)}{\partial t} = (\hat{H}_{0} +
\hat{H}^{'}(t))\Psi(r,t)
\end{equation}
Which it yields:
\begin{multline}\label{}
\sum_{i}i\hbar \psi_{i}(r)e^{-iE_{i}t/\hbar}\frac{\partial
a_{i}(t)}{\partial t} +
\sum_{i}a_{i}(t)E_{i}\psi_{i}(r)e^{-iE_{i}t/\hbar} = \\
\sum_{i}a_{i}(t)E_{i}\psi_{i}(r)e^{-iE_{i}t/\hbar} +
\sum_{i}a_{i}(t)e^{-iE_{i}t/\hbar}\hat{H}^{'}(t)\psi_{i}(r)
\end{multline}

Then we can drop the some terms in the above equation to make it to
be:
\begin{equation}\label{}
\sum_{i}i\hbar \psi_{i}(r)e^{-iE_{i}t/\hbar}\dot{a}_{i}(t) =
\sum_{i}a_{i}(t)e^{-iE_{i}t/\hbar}\hat{H}^{'}(t)\psi_{i}(r)
\end{equation}
By using the orthogonal condition (whatever we can always get some
orthogonal sets) for the $\psi_{i}(r)$, we can multiply both side of
the equation with $\bra{\psi_{j}(r)}$:
\begin{align}\label{PTFTDSeq:2}
i\hbar e^{-iE_{j}t/\hbar}\dot{a}_{j}(t) &=
\sum_{i}a_{i}(t)e^{-iE_{i}t/\hbar}\hat{H}^{'}_{ji}
 \quad \underrightarrow{e^{iE_{j}t/\hbar}}\nonumber \\
i\hbar \dot{a}_{j}(t) &= \sum_{i}a_{i}(t)e^{-i\omega_{ij}
t}\hat{H}^{'}_{ji}
\end{align}
Here we have $\omega_{ij}$ as:
\begin{equation}\label{}
\omega_{ij} = \frac{E_{i} - E_{j}}{\hbar}
\end{equation}

For the first order perturbation, where we can express the first
order correlated wave function as:
\begin{equation}\label{}
\Psi^{(1)}(r,t) =
\sum_{i}a^{(1)}_{i}(t)\psi_{i}(r)e^{-iE_{i}t/\hbar}
\end{equation}
So now it's easy to transform the (\ref{PTFTDSeq:2}) into the first
order equation:
\begin{equation}\label{PTFTDSeq:3}
i\hbar \dot{a}^{(1)}_{j}(t) = \sum_{i}a^{(0)}_{i}(t)e^{-i\omega_{ij}
t}\hat{H}^{'}_{ji}
\end{equation}
Here it's worthy to note that the $\hat{H}^{'}$ already has the
order of $\lambda$ so that the coefficients of $a_{i}(t)$ should be
in zero order on the right side of (\ref{PTFTDSeq:3}). Furthermore,
by using the relation in the (\ref{PTFTDSeq:4}) where $a_{i}^{(0)} =
\delta_{ik}$; we can finally get:
\begin{equation}\label{PTFTDSeq:5}
i\hbar \dot{a}^{(1)}_{j}(t) = e^{-i\omega_{kj} t}\hat{H}^{'}_{jk}
\end{equation}
Here the label of $k$ indicates that the system is originally in the
$\ket{k}$ state. by integrating the (\ref{PTFTDSeq:5}), it gives:
\begin{equation}\label{}
a^{(1)}_{j}(t) = -\frac{i}{\hbar}\int_{0}^{t}
\hat{H}^{'}_{jk}e^{-i\omega_{kj} t}dt
\end{equation}

For the (\ref{PTFTDSeq:6}), now in this equation we have two index:
$j$ and $k$. $k$ indicates the original state, while $j$ stands for
the component for $\ket{j}$ in the first order correlated wave
functions. Hence it's better to express the $a^{(1)}_{j}(t)$ as two
indices $a^{(1)}_{kj}(t)$:
\begin{equation}\label{PTFTDSeq:6}
a^{(1)}_{kj}(t) = -\frac{i}{\hbar}\int_{0}^{t}
\hat{H}^{'}_{jk}e^{-i\omega_{kj} t}dt
\end{equation}
This equation fixes the first order approximated wave function.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Periodic situation}
%
%
%
Now let's analyze some important situation where the perturbation
operator can be expressed as periodic function of time\cite{Landau}.

In this case, $\hat{H}^{'}$ is:
\begin{equation}\label{}
\hat{H}^{'}(t) = \hat{F}e^{-i\omega t} + \hat{G}e^{i\omega t}
\end{equation}
therefore we have $\hat{H}^{'}(t) = \hat{H}^{'}(t +
\frac{2k\pi}{\omega})$.

Here the operator of $\hat{F}$ and $\hat{G}$ are time independent.
Since that the $\hat{H}^{'}$ is required to be some physical
quantity, thus it's some hermite operator:
\begin{equation}\label{}
\hat{F}e^{-i\omega t} + \hat{G}e^{i\omega t} = \hat{F}^{+}e^{i\omega
t} + \hat{G}^{+}e^{-i\omega t} \Rightarrow \hat{F} = \hat{G}^{+}
\end{equation}
Then for the $H^{'}_{jk}$, we have:
\begin{align}\label{}
a^{(1)}_{kj}(t) &= -\frac{i}{\hbar}\int_{0}^{t}
\left\{\hat{F}_{jk}e^{-i(\omega_{kj}+\omega) t} +
\hat{F}^{*}_{kj}e^{-i(\omega_{kj}-\omega) t}\right\}dt \nonumber
\\
&=-\frac{1}{\hbar}\bigg\{
\frac{\hat{F}_{jk}e^{-i(\omega_{kj}+\omega)t}} {\omega_{kj}+\omega}
+ \frac{\hat{F}^{*}_{kj}e^{-i(\omega_{kj}-\omega)t}}
{\omega_{kj}-\omega}\bigg\}
\end{align}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../../main"
%%% End:


\section{Conclusion}

	From the results contains in this report:

	\paragraph{} The \textbf{Exact Method} (EM) for instance less or equal to 100 nodes remain the best choice. We get the optimal solution guaranteed in a reasonable amount of time. Anyway it's interesting to note that Exact Method with emulated real instances (\verb|fb| instances) it takes more time to compute the solution. Finally in the real instances tested the use of this method require a large investment of resources (hardware, people and time).

	\paragraph{} The \textbf{Local Search} (LS) is extremely fast and its best use cases are in the real-time contexts. Also for small instances of nodes the LS isn't able to reach the optimum. Instead the \textbf{Tabu Search} (TS) is a good trade-off, for small instances it found the optimal solution and also in instance with about 500 nodes it performs well, in my opinion time limits parameter is a nice feature. TS limitation starts when we use it on real instances. Here the calibration require more effort, code optimizations are needed and a higher maximum time need to be set. Both LS and TS could use the parallel computation in order to reduce the times.

	\paragraph{Domain considerations} About the possible domains I think that EM could be used only if the build of the board are huge and the production of the same board last for month or year. In this case an optimal solution guarantees a big saving. Otherwise in the context where the production of boards are limited in time and in quantity the EM is not the best choice, in my opinion here a Tabu Search is the best choice.

	Another example where meta heuristics methods are a better choice is for test board, still in developing phase. In this case the production is limited to some prototype and also a Local Search is sufficient.

	Another important factor is that for the use EM it is needed an expensive license for CPLEX. It is a remarkable disadvantage, mostly for small companies.

	\paragraph{} Finally I want to do a last consideration a bit out of the assignment, I want to thank my colleagues that gives me useful tools, advices and discussions. I believe that the collaboration is another essential "feature" in order to tackle these problems.


\documentclass[bigger]{beamer}

\input{header-beam} % change to header-handout for handouts

% ====================
\title[Lecture 4]{Logic I F13 Lecture 4}
\date{September 19, 2013}
% ====================

\include{header}

\section[Boolean Connectives]{The Boolean Connectives}

\subsec{The Boolean Connectives}{

\bit
\item Negation (``not''): $\lnot$
\item Conjunction (``and''): $\land$
\item Disjunction (inclusive ``or''): $\lor$
\eit

}

\subsec{Sentences of FOL}{

\bit
\item Every atomic sentence is a sentence (duh!)
\item If $P$ is a sentence, then $\lnot P$ is a sentence as well.
\bit
\item Note: no parentheses
\item Instead of $\lnot a = b$ we write $a \neq b$
\eit
\item If $P$ and $Q$ are sentences, then so are\\
$(P \land Q)$ and $(P \lor Q)$
\bit
\item Note parentheses
\item But: we will leave off the outermost parentheses
\eit
\eit
}

\subsec{Constructing Sentences}{

\bits
\item $\sf Large(a)$, $\sf Cube(a)$, $\sf a = b$
\item $\sf \lnot Large(a)$, $\sf \lnot Cube(a)$, $\sf a \neq b$
\item $\sf \lnot\lnot Large(a)$, $\sf \lnot\lnot\lnot Large(a)$, \dots
\item $\sf (Cube(a) \land \lnot Large(a))$
\item $\sf ((Cube(a) \lor Tet(a)) \land \lnot(Large(a) \lor Medium(a)))$\\
\dots
\eit
}

\subsec{Ill-formed Expressions}{

Examples of expressions that are \emph{not} sentences:
\bit
\item $\sf \lnot (a = b)$
\item $\sf Cube(a \land b)$
\item $\sf Cube(\lnot a)$
\item $\sf Large(Cube(a))$
\item $\sf Cube(a) \lor Small(a) \land LeftOf(a, c)$
\item $\sf (Large \land Cube)(a)$
\item
\eit

}

\subsec{Semantics of the Boolean Connectives}{

\bit
\item Atomic sentences $P(a)$ are true or false according to whether the object named by $a$ has the determinate property assigned to $P$
\item Non-atomic sentences are true or false according to
\bit
\item what the \emph{main connective} is (*)
\item the truth values of the \emph{immediate subsentences} ($P$, $Q$)
\item the \emph{truth table} for the main connective
\eit
\eit
\begin{align*}
\underbrace{(Cube(a) \lor Tet(a))}_P \underbrace{\land}_\text{*} \underbrace{\lnot(Large(a) \lor Medium(a))}_Q \\
\underbrace{\lnot}_*\underbrace{(Large(a) \lor Medium(a))}_P
\end{align*}

}

\subsec{Truth Tables for the Boolean Connectives}{

\[
\begin{array}{c|c}
P & \lnot P\\
\hline
\T & \F \\
\F & \T
\end{array}
\qquad
\begin{array}{cc|c}
P & Q & (P \land Q)\\
\hline
\T & \T & \T\\
\T & \F & \F\\
\F & \T & \F\\
\F & \F & \F
\end{array}
\qquad
\begin{array}{cc|c}
P & Q & (P \lor Q)\\
\hline
\T & \T & \T\\
\T & \F & \T\\
\F & \T & \T\\
\F & \F & \F
\end{array}
\]

}

\subsec{Truth Conditions of Sentences}{

\bit
\item $\lnot P$ is
\bit
\item true iff $P$ is false
\item false iff $P$ is true
\eit
\item $P \land Q$ is
\bit
\item true iff $P$ and $Q$ are both true
\item false iff at least one of $P$, $Q$ is false
\eit
\item $P \lor Q$ is
\bit
\item true iff at least one of $P$, $Q$ is true
\item false iff $P$ and $Q$ are both false
\eit
\eit
}

\section{English and FOL}

\subsec{Negation}{

\bit
\item To negate a sentence, you use ``isn't'' or ``doesn't'':
\bit
\item b is a cube --- b \emph{isn't} a cube
\item a adjoins b --- a \emph{doesn't} adjoin b
\eit
\item You can prefix a sentence by ``it isn't the case that'':
\bit
\item a adjoins b --- \emph{it isn't the case that} a adjoins b
\eit
\item ``neither \dots nor \dots''
\bit
\item \emph{Neither a nor b} is a cube.
\eit
\eit
}

\subsec{Coordination}{

\bit
\item Can combine names, verbs, adjectives, nouns, even whole clauses using ``conjunctions'' (and, or, yet, but, neither, \dots)
\bit
\item \emph{a and b} are cubes.
\item a \emph{equals and adjoins} b.
\item a is \emph{large or small}.
\item a is a \emph{tetrahedron or dodecahedron}.
\item a is a cube \emph{and} b is a tetrahedron.
\item a and b are left of c and d, but e is not left of c or not left of d.
\item a and b are large cubes both of which adjoin c.
\eit
\eit

}

\subsec{English into FOL}{

\bit
\item a adjoins b --- a \emph{doesn't} adjoin b\\
$\sf Adjoins(a, b)$ --- $\sf\lnot Adjoins(a, b)$
\item \emph{a and b} are cubes.\\
$\sf Cube(a) \land Cube(b)$
\item a \emph{is left of and adjoins} b.\\
$\sf LeftOf(a, b) \land Adjoins(a, b)$
\item a is \emph{large or small}.\\
$\sf Large(a) \lor Small(a)$
\item a is a \emph{tetrahedron or dodecahedron}.\\
$\sf Tet(a) \lor Dodec(a)$
\item a is a cube \emph{but} b is a tetrahedron.\\
$\sf Cube(a) \land Tet(b)$
\eit
}

\section[Expressive Power]{Expressive Power of the Boolean Connectives}

\subsec{Neither \dots nor \dots}{

\bits
\item Neither a nor b is a cube
\item $\sf \lnot Cube(a) \land \lnot Cube(b)$
\item $\sf \lnot (Cube(a) \lor Cube(b))$
\eit

}

\subsec{Not Both}{

\bits
\item a and b are not both large
\item $\sf \lnot(Large(a) \land Large(b))$
\item $\sf \lnot Large(a) \lor \lnot Large(b)$
\eit

}

\subsec{Exclusive ``Or''}{

\bits
\item a or b is a cube (but not both)
\item $\sf (Cube(a) \lor Cube(b)) \land \lnot(Cube(a) \land Cube(b))$
\item $\sf (Cube(a) \land \lnot Cube(b)) \lor (\lnot Cube(a) \land Cube(b))$
\eit
}

\subsec{At Least One Of}{

\bits
\item At least one of a, b, and c is small
\item $\sf Small(a) \lor Small(b) \lor Small(c)$
\eit

}

\subsec{At Least One Of}{

\bits
\item At least two of a, b, and c are small
\item $\sf (Small(a) \land Small(b)) \lor (Small(a) \land Small(c)) \lor (Small(b) \land Small(c))$
\eit

}

\subsec{At Least As Large As and $\le$}{

\bits
\item a is at least as large as b
\item $\sf Larger(a, b) \lor SameSize(a, b)$
\item $\sf \lnot Smaller(a, b)$, $\sf\lnot Larger(b, a)$
\item $2 \le 3$
\item $(1+1) < (1+(1+1)) \lor (1+1) = (1+(1+1))$
\item $\lnot (1 + (1+1)) < (1+1)$
\eit

}

\end{document} %got to here

\section{Step-by-Step Translations}

\subsec{Step-by-Step Method of Translation}{

\bit
\item a and b are left of c or right of d, \emph{but}\\ e is neither left of c nor right of d.
\bit
\item a and b are left of c or right of d
\item but
\item e is neither left of c nor right of d
\eit\eit
}

\subsec{Step-by-Step Method of Translation}{

\bits
\item a \emph{and} b are left of c or right of d
\bit
\item a is left of c \emph{or} right of d
\bit
\item a is left of c or a is right of d\\
$\sf LeftOf(a, c) \lor RightOf(a, d)$
\eit
\item b is left of c \emph{or} right of d
\bit
\item b is left of c or b is right of d\\
$\sf LeftOf(b, c) \lor RightOf(b, d)$
\eit
\eit
\eit
\begin{align*}
(LeftOf(a, c) \lor {} & RightOf(a, d)) \land {}\\
(LeftOf(b, c) \lor {} & RightOf(b, d))
\end{align*}

}

\subsec{Step-by-Step Method of Translation}{

\bits
\item e is neither left of c nor right of d
\[\sf \lnot(LeftOf(e, c) \lor RightOf(e, d))\]
\eit
}

\subsec{Step-by-Step Method of Translation}{

\bit
\item a and b are left of c or right of d, but\\ e is neither left of c nor right of d.
\bit
\item a and b are left of c or right of d
\begin{align*}
(LeftOf(a, c) \lor {} & RightOf(a, d)) \land {}\\
(LeftOf(b, c) \lor {} & RightOf(b, d))
\end{align*}
\item but
$\land$
\item e is neither left of c nor right of d
\[\sf \lnot(LeftOf(e, c) \lor RightOf(e, d))\]
\eit\eit
\begin{multline*}
((LeftOf(a, c) \lor RightOf(a, d)) \land {} \\
(LeftOf(b, c) \lor RightOf(b, d))) \land {}\\
\lnot(LeftOf(e, c) \lor RightOf(e, d))
\end{multline*}

}

\section{Ambiguity}

\subsec{Ambiguity in English}{

\bit
\item Lexical ambiguity: one word---many meanings \\
e.g., ``bank'', ``crane''
\item Syntactic ambiguity: one sentence---many readings\\
e.g., ``Flying planes can be dangerous''
\eit

}

\subsec{Connectives and Ambiguity}{

\bits
\item a adjoins b and c or d
\item a adjoins [[b and c] or d]\\
$\sf (Adjoins(a, b) \land Adjoins(a, c)) \lor Adjoins(a, d)$
\item a adjoins [b and [c or d]]\\
$\sf Adjoins(a, b) \land (Adjoins(a, c) \lor Adjoins(a, d))$
\eit

}

\subsec{The Man Who Was Hanged by a Comma}{

\bit
\item Sir Roger Casement (1864--1916)
\item British consul to Congo and Peru
\item Tried to recruit Irish revolutionaries in Germany during WWI
\item Tried for treason
\eit

}

\subsec{Treason Act of 1351}{

\small
ITEM, Whereas divers Opinions have been before this Time in what Case
Treason shall be said, and in what not; the King, at the Request of
the Lords and of the Commons, hath made a Declaration in the Manner as
hereafter followeth, that is to say; When a Man doth compass or
imagine the Death of our Lord the King, or of our Lady his Queen or of
their eldest Son and Heir; or if a Man do violate the King’s
Companion, or the King’s eldest Daughter unmarried, or the Wife of the
King’s eldest Son and Heir; or \textbf{if a Man do levy War against our Lord
the King in his Realm, or be adherent to the King’s Enemies in his
Realm, giving to them Aid and Comfort in the Realm, or elsewhere}, and
thereof be probably attainted of open Deed by the People of their
Condition: \dots And it is to be
understood, that in the Cases above rehearsed, that ought to be judged
Treason which extends to our Lord the King, and his Royal Majesty:
\dots

}

\subsec{R v. Casement in the Blocks Language}{

\bits
\item a is a cube in front of b, or a tetrahedron in front of b[,] or in back of b.

\item Without comma:
\begin{align*}
(Cube(a) \land {} & FrontOf(a, b)) \lor {}\\
(Tet(a) \land {} & (FrontOf(a,
b) \lor BackOf(a, b)))
\end{align*}
\item With comma:
\begin{align*}
(Cube(a) \land {} & (FrontOf(a, b) \lor BackOf(a, b))) \lor {}\\
(Tet(a) \land {} & (FrontOf(a, b) \lor BackOf(a, b))
\end{align*}
\eit
}

\end{document}


%%\documentclass[handout]{beamer}
%\documentclass[aspectratio=169,13pt]{beamer}

%\input{./preamble}

\subtitle{Numerical Integration and Differentiation}

\date{}
\begin{document}

\begin{frame}
  \titlepage
\end{frame}

\section{Introduction to Numerical Integration}

\begin{frame}{Integrability and Sensitivity}

\begin{itemize}

\item Seek to compute $\mathcal{I}(f)=\int_{a}^b f(x) dx$:

\mdcond{
\begin{itemize}
\item $f$ is integrable if continuous and bounded.
\mitem Finite number of discontinuities is also often permissible.
\end{itemize}
}

\item The condition number of integration is bounded by the distance $b-a$:

\lgcond{
Suppose the input function is perturbed $\hat{f}=f+ \delta f$, then
\begin{align*}
\delta I &=  |\mathcal{I}(\hat{f}) - \mathcal{I}(f)| \\
               &\leq |\mathcal{I}(\delta f)| \\
               &\leq (b-a) ||\delta f||_\infty, \quad \text{where} \quad |f||_\infty = \max_{x\in[a,b]} | f(x)|.
%\left|\int_{a}^b \hat{f}(x) dx - \int^b_a f(x) dx\right| \\
%               &\leq |\int_{a}^b \underbrace{|\hat{f}(x) dx - \int^b_a f(x)|}_{\leq||\hat{f}-f||_\infty = \delta f}dx \\
%               &\leq (b-a) \delta f
\end{align*}
Note that this result {\it does not depend on the magnitude of $f$ or its derivatives}, which means integration is generally very well-conditioned, which makes sense since integration corresponds to averaging.
}

\end{itemize}

\end{frame}

\section{Quadrature Rules}

\begin{frame}{Quadrature Rules}

\begin{itemize}

\item Approximate the integral $\mathcal{I}(f)$ by a weighted sum of function values:
\lgcond{
\[\mathcal{I}(f) \approx Q_n(f)= \sum_{i=1}^n w_i f(x_i)\]
\begin{itemize}
\item $\{x_i\}_{i=1}^n$ are quadrature \coloremph{nodes} or \coloremph{abscissas},
%\item
 $\{w_i\}_{i=1}^n$ are quadrature \coloremph{weights}.
\mitem Quadrature rule %defined by $(\{x_i\}_{i=1}^n,\{w_i\}_{i=1}^n)$
is \coloremph{closed} if $x_1=a,x_n=b$ and \coloremph{open} otherwise.
\mitem Rule is \coloremph{progressive} if nodes of $Q_n$ are a subset of those of $Q_{n+1}$.
\end{itemize}
}

\sitem For a fixed set of $n$ nodes, polynomial interpolation followed by integration give \coloremph{$(n-1)$-degree quadrature rule}:

\lgcond{
\begin{itemize}
\item Accuracy depends on interpolant, is exact for all $(n-1)$-degree polynomials.
\mitem Can obtain weights by expressing the unique $(n-1)$-degree polynomial interpolant in the Lagrange basis
$p(x)=\sum_{i=1}^{n} \phi_i(x)f(x_i)$, so that
%, the coefficients are then % of $f$ is given by the Vandermonde system,
%\[\B y = \B y, \quad \text{where} \quad y_i= f(x_i) \quad \text{and} \quad d_{ii}=\phi_i(x_i).\]
%The quadrature rule is defined by
\[Q_n(f)=\mathcal{I}(p)= \sum_{i=1}^{n} \underbrace{\mathcal{I}(\phi_i)}_{w_i}f(x_i).\]
\end{itemize}
}

\end{itemize}

\end{frame}

\begin{frame}{Determining Weights in a General Basis}

\begin{itemize}
\item A quadrature rule provides $\B x$ and $\B w$ so as to approximate
\lgcond{
  \[\mathcal{I}(f)\approx Q_n(f)=\langle \B w, \B y \rangle, \quad \text{where} \quad y_i=f(x_i)\]
$Q_n$ is the integral of the polynomial interpolant $p$ of $(x_1,y_1),\ldots,(x_n,y_n)$.
%\begin{itemize}
%\item
%\end{itemize}
}
\item \coloremph{Method of undetermined coefficients} obtains $\B y$ from \coloremph{moment equations} based on Vandermonde system:
\lgcond{
\[
\mathcal{I}(p) = \mathcal{I}(\langle \{\phi_i(x)\}_{i=1}^n, \underbrace{\B V(\B x, \{\phi_i\}_{i=1}^n)^{-1} \B y}_\text{interpolant coefficients}\rangle) =
 \langle \underbrace{\B V(\B x, \{\phi_i\}_{i=1}^n)^{-T}\{\mathcal{I}(\phi_i(x))\}_{i=1}^n}_{\B w}, \B y\rangle\]
%\begin{bmatrix} \int_a^b \phi_1(x) dx & \cdots &\int_a^b \phi_n(x)dx \end{bmatrix} \B V(\B x, \{\phi_i\}_{i=1}^n)^{-1} \B y.\]
%\begin{bmatrix} \int_a^b \phi_1(x) dx & \cdots &\int_a^b \phi_n(x)dx \end{bmatrix} \B V(\B x, \{\phi_i\}_{i=1}^n)^{-1} \B y.\]
\begin{itemize}
\item Thus to obtain $\B w$, we need to solve the linear system,
\[\B V(\B x, \{\phi_i\}_{i=1}^n)^T\B w = \begin{bmatrix} \int_a^b \phi_1(x) dx & \cdots &\int_a^b \phi_n(x)dx \end{bmatrix}^T,\]
\item Note that the weights $\B w$ are \coloremph{independent} of the function values $\B y$.
\end{itemize}
}
\end{itemize}

\end{frame}

\begin{frame}{Newton-Cotes Quadrature}
\urcornerlinkdemo{08-quadrature-and-differentiation}{Newton-Cotes weight finder}

\begin{itemize}
\item \coloremph{Newton-Cotes} quadrature rules are defined by equispaced nodes on $[a,b]$:

\mdcond{
open: $x_i=a+i(b-a)/(n+1)$, closed: $x_i=a+(i-1)(b-a)/(n-1)$.
}

\item The \coloremph{midpoint rule} is the $n=1$ open Newton-Cotes rule:

\mdcond{
\[M(f) = (b-a)f\left(\frac{a+b}{2}\right)\]
}

\item The \coloremph{trapezoid rule} is the $n=2$ closed Newton-Cotes rule:

\mdcond{
\[T(f) = \frac{(b-a)}{2}(f(a) + f(b))\]
}

\item \coloremph{Simpson's rule} is the $n=3$ closed Newton-Cotes rule:

\mdcond{
\[S(f)=\frac{b-a}{6}\left(f(a) + 4f\left(\frac{a+b}{2}\right) + f(b)\right)\]
}

\end{itemize}

\end{frame}

\subsection{Error and Conditioning of Quadrature Rules}
\begin{frame}[fragile]{Error in Newton-Cotes Quadrature}
\urcornerlinkdemo{08-quadrature-and-differentiation}{Accuracy of Newton-Cotes}

\begin{itemize}
\item Consider the Taylor expansion of $f$ about the midpoint of the integration interval $m=(a+b)/2$:
\mdcond{
\[f(x) = f(m) + f'(m)(x-m) + \frac{f''(m)}{2}(x-m)^2 +\ldots\]
}

Integrating the Taylor approximation of $f$, we note that the odd terms drop:
\lgcond{
\[\mathcal{I}(f) = \underbrace{f(m)(b-a)}_{M(f)} + \underbrace{\frac{f''(m)}{24}(b-a)^3}_{E(f)} + O((b-a)^5)\]
Consequently, the midpoint rule is third-order accurate (first degree).
}
\end{itemize}

\end{frame}

\begin{frame}{Error Estimation}

\begin{itemize}

%\item Quadrature weights can be alternatively determined for a rule by solving the moment equations:
%\lgcond{
%\begin{align*}
%\B V(\B x, \{\phi_i\}_{i=1}^n) \B w = \B y(\{\phi_i\}_{i=1}^n), \quad \text{where} \quad y_i = \mathcal{I}(\phi_i)
%\end{align*}
%}
\item The trapezoid rule is also first degree, despite using higher-degree polynomial interpolant approximation, since
\lgcond{
\begin{align*}
f(m) = \frac{1}{2}\bigg(&f(a) - f'(m)(a-m) - \frac{f''(m)}{2}(a-m)^2 +\ldots \\
+&f(b) - f'(m)(b-m) - \frac{f''(m)}{2}(b-m)^2 +\ldots \bigg) \\
\mathcal{I}(f)= T(f)  -& \underbrace{\frac{f''(m)}{12}(b-a)^3}_{2E(f)} - O((b-a)^5)
\end{align*}
}
\item The above derivation allows us to obtain an error approximation via a difference of midpoint and trapezoidal rules:
\lgcond{
\[T(f)-M(f)\approx 3E(f).\]
This approximation rapidly becomes accurate as $b-a$ decreases.
}
\end{itemize}
\end{frame}

\begin{frame}{Error in Polynomial Quadrature Rules}

\begin{itemize}

\item We can bound the error for a an arbitrary polynomial quadrature rule by
\lgcond{
\begin{align*}
|\mathcal{I}(f)-Q_n(f)| &= |\mathcal{I}(f-p)| \\
              &\leq (b-a) || f-p||_\infty \\
              &\leq \frac{b-a}{4n}h^n || f^{(n)}||_\infty
\end{align*}
where $h=\max_i(x_{i+1}-x_i)$.
}
\lgcond{
}

\end{itemize}

\end{frame}

\begin{frame}{Conditioning of Newton-Cotes Quadrature}

\begin{itemize}
\item We can ascertain stability of quadrature rules, by considering the amplification of a perturbation $\hat{f} = f+ \delta f$:
\lgcond {
\begin{align*}
|Q_n(\hat{f})-Q_n(f)| &= |Q_n(\delta f)| \\
                      &= \sum_{i=1}^n w_i \delta f(x_i) \\
                      &\leq ||\B w||_1 ||\delta f||_\infty.
\end{align*}
Note that we always have $\sum_i w_i=b-a$, since the quadrature rule must be correct for a constant function.
So if $\B w$ is positive $||\B w||_1=b-a$, the quadrature rule is stable, i.e. it matches the conditioning of the problem.
}
\item Newton-Cotes quadrature rules have at least one negative weight for any $n\geq 11$:
\lgcond{
More generally, $||\B w||_1\to \infty$ as $n \to \infty$ for fixed $b-a$. This means that the Newton-Cotes rules can be ill-conditioned.
}
\end{itemize}

\end{frame}

\subsection{Chebyshev Quadrature}

\begin{frame}{Clenshaw-Curtis Quadrature}

\begin{itemize}
\item To obtain a more stable quadrature rule, we need to ensure the integrated interpolant is well-behaved as $n$ increases:

\lgcond{
\begin{itemize}
\mitem Chebyshev quadrature nodes ensure that interpolant polynomial has bounded coefficients so long as $f$ is bounded, since the Vandermonde system defining its coefficients is well-conditioned.
\mitem Formally, it can be shown that $w_i>0$ for the Chebyshev-node ({\color{red} Clenshaw-Curtis}) quadrature.
\mitem The weights for Clenshaw-Curtis quadrature rules can be obtained by solutions to Vandermonde systems on $[-1,1]$ with Chebyshev-spaced nodes, then translating to a desired integration interval.
\end{itemize}
}
\end{itemize}

\end{frame}

%\begin{frame}{Gaussian Quadrature}
%
%\begin{itemize}
%\item So far, we have only considered quadrature rules based on a fixed set of nodes, but we can also choose a set of nodes to improve accuracy:
%
%\lgcond{
%Choice of nodes gives additional $n$ parameters for a total of $2n$ degrees of freedom, permitting representation of polynomials of degree $2n-1$.
%}
%\item The \coloremph{unique} $n$-point \coloremph{Gaussian quadrature rule} is defined by the solution of the nonlinear form of the moment equations in terms of \textit{both} $\B x$ and $\B w$:
%\lgcond{
%Given any complete basis, we seek to solve the nonlinear equations,
%\[\B V(\B x, \{\phi_i\}_{i=1}^{2n+1}) \B w = \B y(\{\phi_i\}_{i=1}^{2n+1}), \quad \text{where} \quad y_i = \mathcal{I}(\phi_i)\]
%For fixed $\B x$, we have an overdetermined system of linear equations for $\B w$.
%}
%%To obtain a more stable quadrature rule, we need to ensure the integrated interpolant is well-behaved as $n$ increases:
%%
%%\lgcond {
%%Chebyshev quadrature nodes ensure that interpolant polynomial has bounded coefficients so long as $f$ is bounded, since the Vandermonde system defining its coefficients is well-conditioned.
%%
%%Formally, it can be shown that $w_i>0$ for Chebyshev-node (Clenshaw-Curtis) quadrature.
%%}
%\end{itemize}
%
%\end{frame}
%
%\begin{frame}{Using Gaussian Quadrature Rules}
%
%\begin{itemize}
%\item Gaussian quadrature rules are hard to determine and usually, but can be enumerated for a fixed interval, e.g. $a=0,b=1$, so it suffices to transform the integral to $[0,1]$
%
%\lgcond{
%We have that
%\[\mathcal{I}(f) = \int_{a}^b f(x)dx = \int_0^1 g(t) dt \quad \text{where} \quad g(x) = f(t), t=\frac{x+b-a}{b-a}\]
%
%Choice of nodes gives additional $n$ parameters for a total of $2n$ degrees od freedom, permitting representation of polynomials of degree $2n-1$.
%}
%\item The \coloremph{unique} $n$-point \coloremph{Gaussian quadrature rule} is defined by the solution of the nonlinear form of the moment equations in terms of \textit{both} $\B x$ and $\B w$:
%\lgcond{
%Given any complete basis, we seek to solve the nonlinear equations,
%\[\B V(\B x, \{\phi_i\}_{i=1}^{2n+1}) \B w = \B y(\{\phi_i\}_{i=1}^{2n+1}), \quad \text{where} \quad y_i = \mathcal{I}(\phi_i)\]
%For fixed $\B x$, we have an overdetermined system of linear equations for $\B w$.
%}
%%To obtain a more stable quadrature rule, we need to ensure the integrated interpolant is well-behaved as $n$ increases:
%%
%%\lgcond {
%%Chebyshev quadrature nodes ensure that interpolant polynomial has bounded coefficients so long as $f$ is bounded, since the Vandermonde system defining its coefficients is well-conditioned.
%%
%%Formally, it can be shown that $w_i>0$ for Chebyshev-node (Clenshaw-Curtis) quadrature.
%%}
%\end{itemize}
%
%\end{frame}
%
%\begin{frame}{Improvements to Gaussian Quadrature}
%
%\begin{itemize}
%\item Gaussian quadrature rules are are accurate and stable but not progressive (nodes cannot be reused to obtain higher-degree approximation):
%
%\mdcond{}
%
%\item \coloremph{Kronod} quadrature rules construct $(2n+1)$-point quadrature $K_{2n+1}$ that is progressive w.r.t. Gaussian quadrature rule $G_n$
%
%\mdcond{}
%
%\item Gaussian quadrature rules are in general open, but Gauss-Radau and Gauss-Lobatto rules permit including end-points:
%
%\mdcond{
%Gauss-Radau uses one of two end-points as a node, while Gauss-Lobatto quadrature uses both.
%}
%
%\end{itemize}
%
%
%\end{frame}
%
%
%\begin{frame}{Composite and Adaptive Quadrature}
%
%\begin{itemize}
%\item Composite quadrature rules are obtained by integrating a piecewise interpolant of $f$:
%
%\lgcond{}
%
%\item Adaptive quadrature corresponds to using composite quadrature with adaptive refinement:
%
%\lgcond{
%Introduce new nodes where error estimate is large.
%Error estimate can be obtained by e.g. comparing trapezoid and midpoint rules, but can be completely wrong if function is insufficiently smooth.
%}
%
%\end{itemize}
%
%
%\end{frame}

%\end{document}

\subsection{Gaussian Quadrature}

\begin{frame}{Gaussian Quadrature}
\urcornerlinkdemo{08-quadrature-and-differentiation}{Gaussian quadrature weight finder}

\begin{itemize}
\item So far, we have only considered quadrature rules based on a fixed set of nodes, but we may also be able to choose nodes to maximize accuracy:

\lgcond{
\begin{itemize}
\item Choice of nodes gives additional $n$ parameters for total $2n$ degrees of freedom.
\mitem Permits exact integration of degree-$(2n-1)$ polynomials and corresponding general accuracy.
\end{itemize}
}
\item The \coloremph{unique} $n$-point \coloremph{Gaussian quadrature rule} is defined by the solution of the nonlinear form of the moment equations in terms of \textit{both} $\B x$ and $\B w$:

\lgcond{
Given any complete basis, we seek to solve the nonlinear equations for $\B x,\B w$,
\[\B V(\B x, \{\phi_i\}_{i=1}^{2n+1})^T \B w = \B y, \quad \text{where} \quad y_i = \mathcal{I}(\phi_i).\]
\begin{itemize}
\item These nonlinear equations generally have a unique solution $(\B x^*, \B w^*)$.
\mitem For fixed $\B x$, we have an overdetermined system of linear equations for $\B w$.
\end{itemize}
}
%To obtain a more stable quadrature rule, we need to ensure the integrated interpolant is well-behaved as $n$ increases:
%
%\lgcond {
%Chebyshev quadrature nodes ensure that interpolant polynomial has bounded coefficients so long as $f$ is bounded, since the Vandermonde system defining its coefficients is well-conditioned.
%
%Formally, it can be shown that $w_i>0$ for Chebyshev-node (Clenshaw-Curtis) quadrature.
%}
\end{itemize}

\end{frame}

\begin{frame}{Using Gaussian Quadrature Rules}

\begin{itemize}
\item Gaussian quadrature rules are hard to compute, but can be enumerated for a fixed interval, e.g. $a=0,b=1$, so it suffices to transform the integral to $[0,1]$

\lgcond{
\begin{itemize}
\item We can transform a given integral using variable substitution $t=\frac{x-a}{b-a}$,
\[\mathcal{I}(f) = \int_{a}^b f(x)dx = (b-a)\int_0^1 g(t) dt \quad \text{where} \quad g(t) = f(t(b-a)+a)).\]
\item For quadrature rules defined on $[-1,1]$, we can transform via the substitution $t=2\frac{x-a}{b-a}-1$,
\[\mathcal{I}(f) = \int_{a}^b f(x)dx = \frac{b-a}{2}\int_{-1}^1 g(t) dt \quad \text{where} \quad g(t) = f((t+1)(b-a)/2+a).\]
\end{itemize}
}

\item Gaussian quadrature rules are accurate and stable but not progressive (nodes cannot be reused to obtain higher-degree approximation):

\mdcond{
\begin{itemize}
\item maximal degree is obtained
\sitem weights are always positive (perfect conditioning)
\end{itemize}
}

\end{itemize}

\end{frame}

\begin{frame}{Progressive Gaussian-like Quadrature Rules}

\begin{itemize}
\item \coloremph{Kronod} quadrature rules construct $(2n+1)$-point $(3n+1)$-degree quadrature $K_{2n+1}$ that is progressive with respect to Gaussian quadrature rule $G_n$:

\lgcond{
\begin{itemize}
\item Gaussian quadrature rule $G_{2n+1}$ would use same number of points and have degree $4n+1$.
\mitem Kronod rule points are optimal chosen to reuse all points of $G_n$, so $n+1$ rather than $2n+1$ new evaluations are necessary.
\end{itemize}
}
\item \coloremph{Patterson} quadrature rules use $2n+2$ more points to extend $(2n+1)$-point Kronod rule  to degree $6n+4$, while reusing all $2n+1$ points.

\item Gaussian quadrature rules are in general open, but \coloremph{Gauss-Radau} and \coloremph{Gauss-Lobatto} rules permit including end-points:

\lgcond{
Gauss-Radau uses one of two end-points as a node, while Gauss-Lobatto quadrature uses both.
}

\end{itemize}

\end{frame}

\begin{frame}{Composite and Adaptive Quadrature}

\begin{itemize}
\item \coloremph{Composite quadrature rules} are obtained by integrating a piecewise interpolant of $f$:

\lgcond{
For example, we can derive simple composite Newton-Cotes rules by partitioning the domain into sub-intervals $[x_i,x_{i+1}]$:
\begin{itemize}
\sitem composite midpoint rule
  \[\mathcal{I}(f) = \sum_{i=1}^{n-1} \int_{x_i}^{x_{i+1}} f(x)dx \approx \sum_{i=1}^{n-1} (x_{i+1}-x_i)f((x_{i+1}+x_i)/2)\]
\item composite trapezoid rule
  \[\mathcal{I}(f) = \sum_{i=1}^{n-1} \int_{x_i}^{x_{i+1}} f(x)dx \approx \sum_{i=1}^{n-1} \frac{(x_{i+1}-x_i)}2 (f(x_{i+1})+f(x_i))\]
\end{itemize}
}

\item Composite quadrature can be done with adaptive refinement:

\lgcond{
Introduce new nodes where error estimate is large.
Error estimate can be obtained by e.g. comparing trapezoid and midpoint rules, but can be completely wrong if function is insufficiently smooth.
}

\end{itemize}

\end{frame}

\begin{frame}{More Complicated Integration Problems}

\begin{itemize}
\item To handle improper integrals can either transform integral to get rid of infinite limit or use appropriate open quadrature rules.

\mdcond{}

\item Double integrals can simply be computed by successive 1-D integration.

\mdcond{
Composite multidimensional rules are also possible by partitioning the domain into chunks.
}

\item High-dimensional integration is often effectively done by \coloremph{Monte Carlo}:

\lgcond{
\[\int_\Omega f(\B x) d\B x = E[Y], \quad Y = \frac{|\Omega|}{N} \sum_{i=1}^N Y_i, \quad Y_i = f(\B x_i), \quad \B x_i \ \  \text{chosen randomly from $\Omega$}.\]
\begin{itemize}
\item Convergence rate is independent of function (effective polynomial degree approximation) or dimension of integration domain.
\mitem Instead, it depends on number of samples ($N$), with error scaling as $O(1/\sqrt{N})$.
\end{itemize}
}

\end{itemize}

\end{frame}

\begin{frame}{Integral Equations}

\begin{itemize}
\item Rather than evaluating an integral, in solving an \coloremph{integral equation} we seek to compute the integrand. A typical linear integral equation has the form
\[\int_a^b K(s,t)u(t) dt = f(s), \quad \text{where} \quad K \quad \text{and} \quad f \quad \text{are known}.\]
\lgcond{
\begin{itemize}
\item Useful for recovering signal $u$ given response function with kernel $K$ and measurements of $f$.
\mitem Also arise from solve equations arising from Green's function methods for PDEs.
\end{itemize}
}
\item Using a quadrature rule with weights $w_1,\ldots, w_n$ and nodes $t_1,\ldots, t_n$ obtain
\lgcond{
\[\sum_{j=1}^n w_jK(s,t_j)u(t_j) = f(s).\]
Discrete sample of $f$ on $s_1,\ldots, s_n$ yields a linear system of equations,
\[\sum_{j=1}^n w_jK(s_i,t_j)u(t_j) = f(s_i).\]
%The resulting matrix $\B A$ can be ill-conditioned for many kernels $K$.
}
\end{itemize}

\end{frame}

%\begin{frame}{Challenges in Solving Integral Equations}
%
%\begin{itemize}
%\item Integral equations based on response functions tend to be ill-conditioned, which is resolved using
%
%\begin{itemize}
%\item truncated singular value decomposition of $\B A$, where $a_{ij}=w_jK(s_i,t_j)$
%
%\mdcond{}
%
%\item replacing the linear system with a regularized linear least squares problem,
%
%\mdcond{}
%
%\item expressing the solution using a basis
%
%\mdcond{Let $u(t)\approx \sum_{j=1}^n c_j \phi_j(t)$ and derive equations for the coefficients.}
%
%\end{itemize}
%\end{itemize}
%
%
%\end{frame}

\begin{frame}{Numerical Differentiation}
\urcornerlinkdemo{08-quadrature-and-differentiation}{Taking Derivatives with Vandermonde Matrices}

\begin{itemize}
\item Automatic (symbolic) differentiation is a surprisingly viable option:
\lgcond{
\begin{itemize}
\item Any computer program is differentiable, since it is an assembly of basic arithmetic operations.
\item Existing software packages can automatically differentiate whole programs.
\end{itemize}
}
\item Numerical differentiation can be done by interpolation or finite differencing:

\lgcond{
\begin{itemize}
\item Given polynomial interpolant, its derivative is easy to obtain by differentiating the basis in which it is expressed,
\[f'(x)\approx p'(x) = \begin{bmatrix} \phi'_1(x) & \cdots &\phi'_n(x) \end{bmatrix}^T\B V(\B t, \{\phi_i\}_{i=1}^n)^{-1} \B y, \ \text{where} \ y_i=f(t_i).\]
\item Obtaining the values of the derivative at the interpolation nodes, can be done via
\[\underbrace{\B V(\B t, \{\phi_i'\}_{i=1}^n)\B V(\B t, \{\phi_i\}_{i=1}^n)^{-1}}_\text{Differentiation matrix} \B y, \ \text{where} \ y_i=f(t_i).\]
\item Finite-differencing formulas effectively use linear interpolant.
\end{itemize}
}

\end{itemize}

\end{frame}

\begin{frame}{Accuracy of Finite Differences}

\dblurcornerlinkdemo{08-quadrature-and-differentiation}{Finite Differences vs Noise}{08-quadrature-and-differentiation}{Floating point vs Finite Differences}

\begin{itemize}
\item \coloremph{Forward and backward differencing} provide first-order accuracy:

\lgcond{
These can be derived, respectively from forward and backward Taylor expansions of $f$ about $x$,
\begin{align*}
f(x+h) &= f(x) + f'(x)h + f''(x) h^2 /2 + \ldots \\
f(x-h) &= f(x) - f'(x)h + f''(x) h^2 /2 - \ldots
\end{align*}
For forward differencing, we obtain an approximation from the first equation,
\[f'(x) = \frac{f(x+h)- f(x)}h + f''(x) h /2 + \ldots.\]
}
\item \coloremph{Centered differencing} provides second-order accuracy.
\lgcond{
Subtracting the backward Taylor expansion from the forward, we obtain centered differencing,
\[f'(x) = \frac{f(x+h)- f(x-h)}{2h} + O(h^2).\]
Second order accuracy is due to cancellation of odd terms like $f''(x)h/2$.
}

\end{itemize}

\end{frame}

\begin{frame}{Extrapolation Techniques}

\urcornerlinkdemoinclass{08-quadrature-and-differentiation}{Richardson with Finite Differences}{inclass-richardson}{Richardson Extrapolation}

\begin{itemize}
\item Given a series of approximate solutions produced by an iterative procedure, a more accurate approximation may be obtained by \coloremph{extrapolating} this series.

\lgcond{
For example, as we lower the step size $h$ in a finite-difference formula, we can try to extrapolate the series to $h=0$, if we know that
\[F(h)=a_0 + a_1h^p + O(h^r) \ \text{as} \ h\to 0 \ \text{and seek to determine $F(0)=a_0$},\]
for example in centered differences $p=2$ and $r=4$.
}
\item In particular, given two guesses, \coloremph{Richardson extrapolation} eliminates the leading order error term.

\lgcond{
Seek to eliminate $a_1h^p$ term in  $F(h)$, $F(h/2)$ to improve approximation of $a_0$,
\begin{align*}
F(h) &= a_0 + a_1h^p + O(h^r), \\
F(h/2) &= a_0 + a_1h^p/2^p + O(h^r), \\
a_0 &= F(h) - \frac{F(h)-F(h/2)}{1-1/2^{p}} + O(h^r).
\end{align*}
}

\end{itemize}

\end{frame}

\begin{frame}{High-Order Extrapolation}

\begin{itemize}
\item Given a series of $k$ approximations, \coloremph{Romberg integration} applies $(k-1)$-levels of Richardson extrapolation.

\lgcond{
Can apply Richardson extrapolation to each of $k-1$ pairs of consecutive nodes, then proceed recursively on the $k-1$ resulting approximations.
}

\item Extrapolation can be used within an iterative procedure at each step:

\lgcond{
For example, Steffensen's method for finding roots of nonlinear equations,
\[x_{n+1} = x_n + \frac{f(x_n)}{1-f(x_n+f(x_n))/f(x_n)},\]
derived from Aitken's delta-squared extrapolation process:
\begin{itemize}
\item achieves quadratic convergence,
\sitem requires no derivative,
\sitem competes with the Secant method (quadratic versus superlinear convergence, but an extra function evaluation necessary).
\end{itemize}
}

\end{itemize}

\end{frame}

%\end{document}


\documentclass{article}

\usepackage{url}
\usepackage{proof}
\usepackage{amssymb}
\usepackage{stmaryrd}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{multicol}

\newcommand{\todo}[1]{\textbf{TODO: #1}}

\setlength{\parskip}{0pt}

%subcode-inline{bnf-inline} name langRev
%! swap+ = \mathit{swap}^+
%! swap* = \mathit{swap}^*
%! dagger =  ^{\dagger}
%! assocl+ = \mathit{assocl}^+
%! assocr+ = \mathit{assocr}^+
%! assocl* = \mathit{assocl}^*
%! assocr* = \mathit{assocr}^*
%! identr* = \mathit{uniti}
%! identl* = \mathit{unite}
%! dist = \mathit{distrib}
%! factor = \mathit{factor}
%! (o) = \fatsemi
%! (;) = \fatsemi
%! (*) = \times
%! (+) = +

%subcode-inline{bnf-inline} regex \{\{(((\}[^\}])|[^\}])*)\}\} name main include langRev
%! [^ = \ulcorner
%! ^] = \urcorner
%! [v = \llcorner
%! v] = \lrcorner
%! |-->* = \mapsto^{*}
%! |-->> = \mapsto_{\ggg}
%! |-->let = \mapsto_{let}
%! |--> = \mapsto
%! <--| = \mapsfrom
%! |- = \vdash
%! in = \!\!\in\!\!
%! <=> = \Longleftrightarrow
%! <-> = \leftrightarrow
%! ~> = \leadsto
%! ::= = ::=
%! /= = \neq
%! vi = v_i
%! di = d_i
%! si = s_i
%! sj = s_j
%! F = \texttt{F}
%! T = \texttt{T}
%! forall = \forall
%! exists = \exists
%! empty = \emptyset
%! eta = \eta
%! where = \textbf{where}
%! epsilon = \varepsilon
%! least = \phi
%! trace+ = trace
%! trace* = trace_{\times}
%! loop+ = loop_{+}
%! loop* = loop_{\times}
%! CatC = {\mathcal C}
%! CatA = {\mathcal A}
%! gamma = \gamma
%! {[ = \{
%! ]} = \}
%! elem = \in
%! dagger = ^\dagger
%! alpha = \alpha
%! beta = \beta
%! rho = \rho
%! < = \langle
%! > = \rangle
%! @@~ = \tilde{\mu}
%! @@ = \mu
%! @ = \,@\,
%! * = \times
%! FC = \mathcal{C}
%! langRev = \Pi
%! langRevT = \Pi^{o}
%! langRevEE = \Pi^{\eta\epsilon}_{+}
%! bullet = \bullet

\urldef{\mails}\path|{rpjames, sabry}@indiana.edu|

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\title{ Logic of {{langRevEE}} }
% \titlerunning{On the construction of Isomorphic Interpreters}
% \author{Roshan P. James \and Amr Sabry}
%\institute{School of Informatics and Computing, Indiana University\\
% \mails}
\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{abstract}
\end{abstract}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Logic}

By Curry-Howard of the presentataion of {{langRevEE}}, we simply erase
the terms to reveal the underlying logic. Sequents have the form
{{b1~|-~b2}} with just one formula on the left and right of the sequent.

%subcode{proof} include main
%@ ~
%@@  0 + b |- b
%
%@ ~
%@@  b1 + b2 |- b2 + b1
%
%@ ~
%@@  b1 + (b2 + b3) |- (b1 + b2) + b3
%---
%@ ~
%@@  1 * b |- b
%
%@ ~
%@@  b1 * b2 |- b2 * b1
%
%@ ~
%@@  b1 * (b2 * b3) |- (b1 * b2) * b3
%---
%@ ~
%@@ 0 * b |- 0
%
%@ ~
%@@ (b1 + b2) * b3 |- (b1 * b3) + (b2 * b3)
%---
%@ ~
%@@ 0 |- (-b) + b
%
%@ ~
%@@ 1 |- (1/b) * b
%

%subcode{proof} include main
%@  ~
%@@ b |- b
%
%@ b1 |- b2
%@@ b2 |- b1
%
%@ b1 |- b2
%@ b2 |- b3
%@@ b1 |- b3
%---
%@ b1 |- b3
%@ b2 |- b4
%@@ b1 + b2 |- b3 + b4
%
%@ b1 |- b3
%@ b2 |- b4
%@@ b1 * b2 |- b3 * b4

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{scriptsize}
\bibliographystyle{splncs03}
\bibliography{cites}
\end{scriptsize}
\end{document}


\newpage
\section{High Energy Physics}

\begin{Introduction}{HEPHYS}
The High-energy Physics package is historic for REDUCE, since REDUCE
originated as a program to aid in computations with Dirac expressions.
The commutation algebra of the gamma matrices is independent of their
representation, and is a natural subject for symbolic mathematics.  Dirac
theory is applied to \IFTEX{$\beta$}{beta} decay and the computation of
cross-sections and scattering.  The high-energy physics operators are
available in the REDUCE main program, rather than as a module which must
be loaded.
\end{Introduction}

\begin{Operator}[HE-dot]{.}
The . operator is used to denote the scalar product of two Lorentz
four-vectors.
\begin{Syntax}
\meta{vector} \name{.} \meta{vector}
\end{Syntax}

\meta{vector} must be an identifier declared to be of type \name{vector} to have
the scalar product definition.  When applied to arguments that are not
vectors, the \nameref{cons} operator is used,
whose symbol is also ``dot.''

\begin{Examples}
vector aa,bb,cc; \\
let aa.bb = 0; \\
aa.bb;                               &     0 \\
aa.cc;                               &     AA.CC \\
q := aa.cc;                          &     Q := AA.CC \\
q;                                   &     AA.CC
\end{Examples}

\begin{Comments}
Since vectors are special high-energy physics entities that do not contain
values, the . product will not return a true scalar product.  You can
assign a scalar identifier to the result of a . operation, or assign a .
operation to have the value of the scalar you supply, as shown above.  Note
that the result of a . operation is a scalar, not a vector.

The metric tensor g(u,v) can be represented by \name{u.v}.  If contraction
over the indices is required, \name{u} and \name{v} should be declared to
be of type \nameref{index}.

The dot operator has the highest precedence of the infix operators, so
expressions involving . and other operators have the scalar product
evaluated first before other operations are done.
\end{Comments}
\end{Operator}

\begin{Operator}{EPS}
The \name{eps} operator denotes the completely antisymmetric tensor of
order 4 and its contraction with Lorentz four-vectors, as used in
high-energy physics calculations.
\begin{Syntax}
\name{eps}\(\meta{vector-expr},\meta{vector-expr},\meta{vector-expr},
\meta{vector-expr}\)
\end{Syntax}

\meta{vector-expr} must be a valid vector expression, and may be an index.

\begin{Examples}
vector g0,g1,g2,g3; \\
eps(g1,g0,g2,g3);               &      - EPS(G0,G1,G2,G3); \\
eps(g1,g2,g0,g3);               &      EPS(G0,G1,G2,G3); \\
eps(g1,g2,g3,g1);               &      0
\end{Examples}

\begin{Comments}
Vector identifiers are ordered alphabetically by REDUCE.  When an odd number
of transpositions is required to restore the canonical order to the four
arguments of \name{eps}, the term is ordered and carries a minus sign.  When an
even number of transpositions is required, the term is returned ordered and
positive.  When one of the arguments is repeated, the value 0 is returned.
A contraction of the form
\IFTEX{$\epsilon_{ij\mu\nu}p_{\mu}q_{\nu}$}{eps(_i j mu nu p_mu q_nu)}
is represented by \name{eps(i,j,p,q)} when \name{i} and \name{j} have been
declared to be of type \nameref{index}.
\end{Comments}
\end{Operator}

\begin{Operator}{G}
\name{g} is an n-ary operator used to denote a product of gamma matrices
contracted with Lorentz four-vectors, in high-energy physics.
\begin{Syntax}
\name{g}\(\meta{identifier},\meta{vector-expr}
\{,\meta{vector-expr}\}\optional\)
\end{Syntax}

\meta{identifier} is a scalar identifier representing a fermion line
identifier, \meta{vector-expr} can be any valid vector expression,
representing a vector or a gamma matrix.

\begin{Examples}
vector aa,bb,cc; \\
vector a; \\
g(line1,aa,bb);                 &     AA.BB \\
g(line2,aa,a);                  &     0 \\
g(id,aa,bb,cc);                 &     0 \\
g(li1,aa,bb) + k;               &     AA.BB + K \\
let aa.bb = m*k; \\
g(ln1,aa)*g(ln1,bb);            &     K*M \\
g(ln1,aa)*g(ln2,bb);            &     0
\end{Examples}
\begin{Comments}
The vector \name{A} is reserved in arguments of \name{g} to denote the
special gamma matrix \IFTEX{$\gamma_{5}$}{gamma_5}.  It must be declared to
be a vector before you use it.

Gamma matrix expressions are associated with fermion lines in a Feynman
diagram.  If more than one line occurs in an expression, the gamma
matrices involved are separate (operating in independent spin space), as
shown in the last two example lines above.  A product of gamma matrices
associated with a single line can be entered either as a single \name{g}
command with several vector arguments, or as products of separate \name{g}
commands each with a single argument.

While the product of vectors is not defined, the product, sum and
difference of several gamma expressions are defined, as is the product of
a gamma expression with a scalar.  If an expression involving gamma
matrices includes a scalar, the scalar is treated as if it were the
product of itself with a unit \IFTEX{$4 \times 4$}{4 x 4} matrix.

Dirac expressions are evaluated by computing the trace of the expression
using the commutation algebra of gamma matrices.  The algorithms used are
described in articles by J. S. R. Chisholm in \meta{Il Nuovo Cimento X,} Vol.
30, p. 426, 1963, and J. Kahane, \meta{Journal of Mathematical Physics},
Vol. 9, p. 1732, 1968.  The trace is then divided by 4 to distinguish
between the trace of a scalar and the trace of an expression that is the
product of a scalar with a unit \IFTEX{$4 \times 4$}{4 x 4} matrix.

Trace calculations may be prevented over any line identifier by declaring it
to be \nameref{nospur}.   If it is later desired to evaluate these traces,
the declaration can be undone with the \nameref{spur} declaration.

The notation of Bjorken and Drell, \meta{Relativistic Quantum Mechanics,}
1964, is assumed in all operations involving gamma matrices.  For an
example of the use of \name{g} in a calculation, see the \meta{REDUCE
User's Manual}.
\end{Comments}
\end{Operator}

\begin{Declaration}{INDEX}
The declaration \name{index} flags a four-vector as an index for subsequent
high-energy physics calculations.
\begin{Syntax}
\name{index} \meta{vector-id}\{,\meta{vector-id}\}\optional
\end{Syntax}

\meta{vector-id} must have been declared of type \name{vector}.

\begin{Examples}
vector aa,bb,cc; \\
index uu; \\
let aa.bb = 0; \\
(aa.uu)*(bb.uu);                  &      0 \\
(aa.uu)*(cc.uu);                  &      AA.CC
\end{Examples}

\begin{Comments}
Index variables are used to represent contraction over components of
vectors when scalar products are taken by the . operator, as well as
indicating contraction for the \nameref{eps} operator or metric tensor.

The special status of a vector as an index can be revoked with the
declaration \nameref{remind}.  The object remains a vector, however.
\end{Comments}
\end{Declaration}

\begin{Command}{MASS}
The \name{mass} command associates a scalar variable as a mass with
the corresponding vector variable, in high-energy physics calculations.
\begin{Syntax}
\name{mass} \meta{vector-var}\name{=}\meta{scalar-var}
\{,\meta{vector-var}\name{=}\meta{scalar-var}\}\optional
\end{Syntax}

\meta{vector-var} can be a declared vector variable;  \name{mass} will declare
it to be of type \name{vector} if it is not.  This may override an existing
matrix variable by that name.  \meta{scalar-var} must be a scalar variable.

\begin{Examples}
vector bb,cc; \\
mass cc=m; \\
mshell cc; \\
cc.cc;                            &         M^{2}
\end{Examples}

\begin{Comments}
Once a mass has been attached to a vector with a \name{mass} declaration,
the \nameref{mshell} declaration puts the associated particle ``on the mass
shell.''  Subsequent scalar (.) products of the vector with itself will be
replaced by the square of the mass expression.
\end{Comments}
\end{Command}

\begin{Command}{MSHELL}
The \name{mshell} command puts particles on the mass shell in high-energy
physics calculations.
\begin{Syntax}
\name{mshell} \meta{vector-var}\{,\meta{vector-var}\}\optional
\end{Syntax}

\meta{vector-var} must have had a mass attached to it by a \nameref{mass}
declaration.

\begin{Examples}
vector v1,v2; \\
mass v1=m,v2=q; \\
mshell v1; \\
v1.v1;                       &            M^{2} \\
v2.v2;                       &            V2.V2 \\
mshell v2; \\
v1.v1*v2.v2;                 &            M^{2}*Q^{2}
\end{Examples}

\begin{Comments}
Even though a mass is attached to a vector variable representing a
particle, the replacement does not take place until the \name{mshell}
declaration is given for that vector variable.
\end{Comments}
\end{Command}

\begin{Declaration}{NOSPUR}
The \name{nospur} declaration prevents the trace calculation over the given
line identifiers in high-energy physics calculations.
\begin{Syntax}
\name{nospur} \meta{line-id}\{,\meta{line-id}\}\optional
\end{Syntax}

\meta{line-id} is a scalar identifier that will be used as a line identifier.

\begin{Examples}
vector a1,b1,c1; \\
g(line1,a1,b1)*g(line2,b1,c1);      &     A1.B1*B1.C1 \\
nospur line2; \\
g(line1,a1,b1)*g(line2,b1,c1);      &     A1.B1*G(LINE2,B1,C1)
\end{Examples}

\begin{Comments}
Nospur declarations can be removed by making the declaration \nameref{spur}.
\end{Comments}
\end{Declaration}

\begin{Declaration}{REMIND}
The \name{remind} declaration removes the special status of its arguments
as indices, which was set in the \nameref{index} declaration, in
high-energy physics calculations.
\begin{Syntax}
\name{remind} \meta{identifier}\{,\meta{identifier}\}\optional
\end{Syntax}

\meta{identifier} must have been declared to be of type \nameref{index}.
\end{Declaration}

\begin{Declaration}{SPUR}
The \name{spur} declaration removes the special exemption from trace
calculations that was declared by \nameref{nospur}, in high-energy physics
calculations.
\begin{Syntax}
\name{spur} \meta{line-id}\{,\meta{line-id}\}\optional
\end{Syntax}

\meta{line-id} must be a line-identifier that has previously been declared
\name{nospur}.
\end{Declaration}

\begin{Command}{VECDIM}
The command \name{vecdim} changes the vector dimension from 4 to an arbitrary
integer or symbol.  Used in high-energy physics calculations.
\begin{Syntax}
\name{vecdim} \meta{dimension}
\end{Syntax}

\meta{dimension} must be either an integer or a valid scalar identifier that
does not have a floating-point value.

\begin{Comments}
The \nameref{eps} operator and the \IFTEX{$\gamma_{5}$}{gamma_5}
symbol (\name{A}) are not properly defined in anything except four
dimensions and will print an error message if you use them that way.  The
other high-energy physics operators should work without problem.
\end{Comments}
\end{Command}

\begin{Declaration}{VECTOR}
The \name{vector} declaration declares that its arguments are of type \name{vector}.
\begin{Syntax}
\name{vector} \meta{identifier}\{,\meta{identifier}\}\optional
\end{Syntax}

\meta{identifier} must be a valid REDUCE identifier.  It may have already been
used for a matrix, array, operator or scalar variable.  After an identifier
has been declared to be a vector, it may not be used as a scalar variable.

\begin{Comments}
Vectors are special entities for high-energy physics calculations.  You
cannot put values into their coordinates; they do not have coordinates.
They are legal arguments for the high-energy physics operators
\nameref{eps}, \nameref{g} and \name{.} (dot).  Vector variables are
used to represent gamma matrices and gamma matrices contracted with Lorentz
4-vectors, since there are no Dirac variables per se in the system.
Vectors do follow the usual vector rules for arithmetic operations:
\name{+} and \name{-} operate upon two or more vectors, producing a
vector; \name{*} and \name{/} cannot be used between vectors; the
scalar product is represented by the . operator; and the product of a
scalar and vector expression is well defined, and is a vector.

You can represent components of vectors by including representations of unit
vectors in your system.  For instance, letting \name{E0} represent the unit
vector (1,0,0,0), the command

\name{V1.E0 := 0;}

would set up the substitution of zero for the first component of the vector
\name{V1}.

Identifiers that are declared by the \name{index} and \name{mass} declarations are
automatically declared to be vectors.

The following errors can occur in calculations using the high energy
physics package:

\name{A represents only gamma5 in vector expressions}
\begin{quote}
You have tried to use A in some way other than gamma5 in a
high-energy physics expression.
\end{quote}

\name{Gamma5 not allowed unless vecdim is 4}
\begin{quote}
You have used \IFTEX{$\gamma_{5}$}{gamma_5} in a high-energy physics
computation involving a vector dimension other than 4.
\end{quote}

\meta{ID} \name{has no mass}
\begin{quote}
One of the arguments to \nameref{mshell} has had no mass assigned to it, in
high-energy physics calculations.
\end{quote}

\name{Missing arguments for G operator}
\begin{quote}
A line symbol is missing in a gamma matrix expression in high-energy physics
calculations.
\end{quote}

\name{Unmatched index} \meta{list}
\begin{quote}
The parser has found unmatched indices during the evaluation of a
gamma matrix expression in high-energy physics calculations.
\end{quote}
\end{Comments}
\end{Declaration}