\documentclass[preprint]{acmart}
\usepackage{listings}
\usepackage{booktabs} % For formal tables
\usepackage{favest}
\usepackage[ruled]{algorithm2e} % For algorithms
\usepackage{multirow}
\usepackage[textfont=scriptsize,labelfont=scriptsize]{subcaption}
\lstset{frame=tb,
  aboveskip=3mm,
  belowskip=3mm,
  showstringspaces=false,
  columns=flexible,
  basicstyle={\small\ttfamily},
  numbers=none,
  numberstyle=\tiny\color{gray},
  keywordstyle=\color{blue},
  commentstyle=\color{dkgreen},
  stringstyle=\color{mauve},
  breaklines=true,
  breakatwhitespace=true,
  tabsize=3,
  backgroundcolor = \color{lightgray!10}
}
% inline lstinline style
\makeatletter
\lstdefinestyle{mystyle}{
  basicstyle=%
    \ttfamily
    \color{blue}%
    \lst@ifdisplaystyle\scriptsize\fi
}
\renewcommand{\algorithmcfname}{ALGORITHM}
\SetAlFnt{\small}
\SetAlCapFnt{\small}
\SetAlCapNameFnt{\small}
\SetAlCapHSkip{0pt}
\IncMargin{-\parindent}

\allowdisplaybreaks

% Metadata Information
\acmJournal{TOMS}
%\acmVolume{9}
%\acmNumber{4}
%\acmArticle{39}
%\acmYear{2010}
%\acmMonth{3}
%\acmArticleSeq{11}

%\acmBadgeR[http://ctuning.org/ae/ppopp2016.html]{ae-logo}
%\acmBadgeL[http://ctuning.org/ae/ppopp2016.html]{ae-logo}


% Copyright
%\setcopyright{acmcopyright}
%\setcopyright{acmlicensed}
%\setcopyright{rightsretained}
%\setcopyright{usgov}
%\setcopyright{usgovmixed} %%%
%\setcopyright{cagov}
%\setcopyright{cagovmixed}
\setcopyright{none}
\settopmatter{printacmref=false} % Removes citation information below abstract
\renewcommand\footnotetextcopyrightpermission[1]{} % removes footnote with conference info
\pagestyle{plain} % remove running headers
% remove first page left-footer
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\ps@firstpagestyle}{Manuscript submitted to ACM}{}{\typeout{First patch succeeded}}{\typeout{first patch failed}}
\makeatother


\newcommand{\hlctexttt}[1]{\texttt{\colorbox{cyan!10}{#1}}}
\newcommand{\hlgtexttt}[1]{\texttt{\colorbox{lightgray!15}{#1}}}

\newcommand{\favest}{\hlgtexttt{FaVeST}\,}
\newcommand{\code}[1]{\hlgtexttt{#1}\,}


%\usepackage{xpatch}
%\makeatletter
%\xpatchcmd{\ps@firstpagestyle}{Manuscript submitted to ACM}{}{\typeout{First patch succeeded}}{\typeout{first patch failed}}
%\xpatchcmd{\ps@standardpagestyle}{Manuscript submitted to ACM}{}{\typeout{Second patch succeeded}}{\typeout{Second patch failed}}    \@ACM@manuscriptfalse% Also in titlepage
%\makeatother

% DOI
\acmDOI{0000001.0000001}

% Paper history
%\received{February 2007}
%\received{March 2009}
%\received[accepted]{June 2009}


% Document starts
\begin{document}
% Title portion
\title{User Manual for \favest}
%\titlenote{\today}

\author{Quoc T. Le Gia}
\affiliation{%
 \institution{The University of New South Wales}
 \city{Sydney}
 \state{NSW}
 \country{Australia}}
\email{qlegia@unsw.edu.au}
\author{Ming Li*}
\affiliation{%
  \institution{Zhejiang Normal University}
  \city{Jinhua}
 \state{Zhejiang}
 \country{China;}
 \institution{La Trobe University}
  \city{Melbourne}
  \state{VIC}
  \country{Australia}
}
\email{mingli@zjnu.edu.cn}
\author{Yu Guang Wang*}
%\authornote{corresponding author}
\orcid{0000-0002-7450-0273}
\affiliation{%
 \institution{The University of New South Wales}
 \city{Sydney}
 \state{NSW}
 \country{Australia}}
\email{yuguang.wang@unsw.edu.au}
\thanks{*~ Corresponding authors}
%
%\begin{abstract}
%Vector spherical harmonics on the unit sphere of $\mathbb{R}^3$ have wide applications in geophysics, quantum mechanics and astrophysics. In the representation of a tangent vector field, one needs to evaluate the expansion and the Fourier coefficients of vector spherical harmonics. In this paper, we develop fast algorithms (FaVeST) for vector spherical harmonic transforms on these evaluations. The forward FaVeST evaluates the Fourier coefficients and has computational cost proportional to $N\log \sqrt{N}$ for $N$ number of evaluation points. The adjoint FaVeST  which evaluates a linear combination of vector spherical harmonics with degree up to $\sqrt{M}$ for $M$ evaluation points has cost proportional to $M\log\sqrt{M}$. Numerical examples of simulated tangent fields illustrate the accuracy and efficiency of FaVeST.
%\end{abstract}


%
% The code below should be generated by the tool at
% http://dl.acm.org/ccs.cfm
% Please copy and paste the code instead of the example below.

%\ccsdesc[500]{Mathematics of computing~Mathematical analysis}
%\ccsdesc[300]{Mathematics of computing~Numerical analysis}
%\ccsdesc[100]{Mathematics of computing~Computations of transforms}

%
% End generated code
%


%\keywords{Vector spherical harmonics, tangent vector fields, FFT}

% DO NOT use this command unless you want to change
% the default behavior
% \authorsaddresses{Authors' addresses: G.~Zhou, Computer Science
%   Department, College of William and Mary, 104 Jameson Rd,
%   Williamsburg, PA 23185, US, \path{gzhou@wm.edu}; V.~B\'eranger,
%   Inria Paris-Rocquencourt, Rocquencourt, France; A.~Patel, Rajiv
%   Gandhi University, Rono-Hills, Doimukh, Arunachal Pradesh, India;
%   H.~Chan, Tsinghua University, 30 Shuangqing Rd, Haidian Qu, Beijing
%   Shi, China; T.~Yan, Eaton Innovation Center, Prague, Czech Republic;
%   T.~He, C.~Huang, J.~A.~Stankovic University of Virginia, School of
%   Engineering Charlottesville, VA 22903, USA; T. F. Abdelzaher,
%   (Current address) NASA Ames Research Center, Moffett Field,
%   California 94035.}

\maketitle

% The default list of authors is too long for headers.
%\renewcommand{\shortauthors}{Q.~T. Le Gia et al.}

%\input{favest_body}
\section{INSTALLATION}
Users do not need to compile \favest package by yourself. You only need to uncompress \favest archive and change to the newly created directory in your Matlab working environment. 

\section{Functions}\label{sec:related_works}
\favest archive contains three folders: \code{src}, \code{drivers}, \code{nfft-3.5.2-matlab-openmp}, detailed as follows:

(1)\code{src} folder contains the two main functions for \favest:
\begin{itemize}
  \item \code{FaVeST$\_$fwd.m}: forward FFTs computing Fourier coefficients associated with a quadrature rule (e.g., \textbf{Algorithm 1} in the paper) with inputs:
  \begin{itemize}
  \item $T$: tangent field samples;
  \item $L$: degree for vector spherical harmonic;
 \item $X,w$: quadrature rule used for evaluating FFT.
  \end{itemize}
            
  \item \code{FaVeST$\_$adj.m}: adjoint FFTs for vector spherical harmonic expansion with given inputs (e.g., \textbf{Algorithm 2} in the paper):
  \begin{itemize}
   \item  $alm$: Fourier coefficients for divergent-free part;
   \item $blm$: Fourier coefficients of curl-free part;
   \item $X$: evaluation points on the sphere.
  \end{itemize}
\end{itemize}


(2)\code{drivers} folder contains example programs illustrating the use of your code plus those used to generate the results provided in our paper:
\begin{itemize}
  \item \code{utils}: the folder contains some basic tools/resources/auxiliary functions used for implementing our main functions, including:
  \begin{itemize}
  \item \code{SD}: it contains six examples of [\code{symmetric spherical design points}]({\color{blue}\url{https://web.maths.unsw.edu.au/~rsw/Sphere/EffSphDes/ss.html}}) used in our numerical experiments;
  \item \code{tangent$\_$field}: the folder that contains several functions for generating three vector fields and their visualization used in our paper. These functions come from Ref. \cite{FuWr2009};
 \item \code{m$\_$map}: [\code{mapping package}]({\color{blue}\url{https://www.eoas.ubc.ca/~rich/map.html#ack}}) for Matlab. We have used some functions of this package for visualization of tangent fields;
 \item \code{QpS2.m}: the function is used for computing the weights and quadrature nodes (for a given degree and a specific type of quadrature rule) in either Cartesian coordinates or spherical coordinates;
  
 \item \code{Fig2a,2b,2c.m, Fig3a,3b,3c.m, Table1.m, Table2$\_$Fig4.m}: these routines are used to reproduce the numerical results of the corresponding figures and tables of the paper;
   \item \code{Demo.m}: A quick demonstration for using \code{FaVeST$\_$fwd.m} and \code{FaVeST$\_$adj.m} on a simple tangent field.
  \end{itemize}
\end{itemize}



(3) \code{nfft-3.5.2-matlab-openmp} folder contains the pre-compiled Matlab interfaces of NFFT 3.5.2 with AVX2 and OpenMP support, downloaded from \code{NFFT library}(Download page: {\color{blue}\url{https://www-user.tu-chemnitz.de/~potts/nfft/}}), see Ref. \cite{KeKuPo2009}. As noted in the official documentation of NFFT, compiled binaries of the NFFT library and Matlab and Julia interfaces are already offered on the Download page, which means that users can use  \code{nfft-3.5.2-matlab-openmp} archive directly without any specific installation requirements or further instructions for configuration. Users can refer to NFFT official page for more details.
\section{Demo}\label{sec:vsh}
Users can run \code{Demo.m} to reproduce the figures in Fig.2 (a) in Matlab environment, e.g.,
\begin{lstlisting}
>> Demo
\end{lstlisting}
Then, you can obtain three figures and the following records in Matlab command window:
\begin{lstlisting}
Tangent Field A, Quadrature: GL, L: 30
== Absolute Error: 3.3226e-11,  Relative Error: 4.3282e-12
\end{lstlisting}

All the simulation results can be reproduced by running the corresponding \code{M-scripts} in \code{drivers} folder as described above.




% Appendix
%\clearpage
%\begin{acks}
%%Some of the results in this paper have been derived using the HEALPix \cite{Gorski_etal2005} package.
%The authors thank E. J. Fuselier and G. B. Wright for providing their MATLAB program which generates simulated tangent fields. The authors also thank P. Broadbridge and A. Olenko for their helpful comments. M. Li acknowledges support from the Australian Research Council under Discovery Project DP160101366. Q. T. Le Gia and Y. G. Wang acknowledge support from the Australian Research Council under Discovery Project DP180100506.
%\end{acks}
% Bibliography
%\clearpage
%\bibliographystyle{ACM-Reference-Format}
\bibliographystyle{abbrv}
\bibliography{favest}


\end{document}
