How to get a very compact TOC

The titletoc can achieve this though the \titlecontents command. The starred version places all the titles on the same paragraph.

The command isn't the most user friendly to use, so I tried to annotate as best as I could.

\documentclass{book}

\usepackage{titletoc}
\titlecontents{chapter}             % Section
  [0em]                             % Left
  {\vspace*{\baselineskip}}         % Above code
  {\bfseries\thecontentslabel\quad} % Numbered format
  {}                                % Numberless format
  {\quad\thecontentspage}           % Filler
  []                                % Separator
\titlecontents*{section} % Section
  [0em]                  % Left
  {\space}               % Above code
  {\thecontentslabel~}   % Numbered format
  {}                     % Numberless format
  {}                     % Filler
  [.\space]              % Separator
\titlecontents*{subsection} % Section
  [0em]                     % Left
  {\space}                  % Above code
  {}                        % Numbered format
  {}                        % Numberless format
  {}                        % Filler
  [.\space]                 % Separator

\begin{document}

\tableofcontents

\clearpage

\chapter{Introduction}

\chapter{The Principle of Locality in Classical Physics and the Relativity Theories}

\subsection{Faraday's vision}
\subsection{Fields}

\section{Special relativity}

\subsection{Poincar\'e group}
\subsection{Lorentz group}
\subsection{Spinors}
\subsection{Conformal group}

\section{Maxwell theory}

\section{General Relativity}

\chapter{Poincar\'e Invariant Quantum Theory}

\section{Geometric symmetries in quantum physics}
\subsection{Projective representations and the covering group}

\section{Wigner's analysis of irreducible, unitary representation of the Poincar\'e group}

\section{Single particle states}
\subsection{Spin}

\section{Many particle states: Bose--Fermi alternative, Fock space, creation operators}
\subsection{Separation of CM-motion}
\end{document}

output

An important thing to note is that due to the way the table of contents is generated, LaTeX struggles to create line breaks. In order to allow line breaks between successive elements, I have added \space in the above code and also in the separator. Do not use ~ as this is creates a space that cannot break across lines. The only time I have used ~ is between the a section's number and its title in order to avoid:

... Faraday's vision. Fields. 2.1

Special relativity. Poincare ...


The memoir class helps with this. For example look at A Few Notes on Book Design (texdoc memdesign) where the subsubsections under each chapter in the ToC are set as a single paragraph. This document used the memoir class using the memoir macro \setupparasubsecs. You can use this, as well as many other memoir facilities, as a basis for configuring your compressed ToC.