\graphicspath{ {img/Sarnoff/} }
\chapter{An MDP Framework for Centralized Dynamic Spectrum Leasing}\label{Sarnoff_chap}
\section{Introduction}
In the next two chapters we propose two automated spectrum trading mechanisms, suitable for different scenarios. The one described in this chapter is appropiate for situations of low spectrum usage by PUs. In such scenario, the spectrum owner may be willing to obtain some benefit from its unused resource by selling it to SUs. Nevertheless, it still has to meet the demands of the PUs (to some extent), assuring that the blocking probability for the PUs remains under a desired threshold. We show how to compute a policy that balances those two objectives by means of an MDP and a constrained-MDP formulations.

\subsection{Motivation}
In situations of low spectrum usage, a licensed operator may decide to sell spectrum opportunities to SUs in the \textit{secondary spectrum market} to obtain extra-revenue from its resources. A regulator may encourage this behavior, for example, by setting a fee proportional to the amount of spectrum held. \cite{AdvisorsonScience}.

The operator does not know the future demands from its users in advance (apart from a statistical characterization). What would happen if, at any given moment, all of its spectrum is in use and a new PU arrives to the system? As the licensed operator, it could reclaim the spectrum it leased to SUs if needed, but the process is not inmediate and the incurred delay could result in, for example, a PU missed call. We refer to the probability of such event as the \emph{blocking probability}. In addition, reclaiming its spectrum may not be a convenient solution for the operator (\textit{e.g.} because it may require a compensation to the SU).

Therefore, a licensed operator should carefully balance the revenue obtained from allowing the SUs to access its spectrum, with the blocking probability of the PUs. In order to do this in real-time, a protocol is required to support negotiations on access price, channel holding time, \textit{etc}., between the spectrum owner and the SUs. In this work, we consider a centralized bid-auction model, in which SUs bid for the spectrum of a single spectrum owner. We consider a continuous bid process, in which each incoming SU makes its bid upon arrival. Because of the real-time constraint, the operator only knows one bid at a time, and has to make its decision for each incoming SU, before knowing future bids.
We explore the use of MDP and CMDP formulations to balance benefit and grade of service for PUs. The main advantages of this approach is that it assures operating at global optimum and reduces the computational effort at SUs.

\subsection{Related Work}\label{sec:Application}

Centralized dynamic spectrum trading has been addressed in previous works. In the proposal by Yu \textit{et. al.} \cite{ref:Yu2007}, the spectrum broker controls the access of SUs based on a threshold rule computed by means of an MDP formulation with the objective of minimizing the blocking probability of secondary users. In order to cope with the non-stationarity of traffic conditions, the authors propose a finite horizon MDP instead of an infinite horizon one. The drawback is that the policy cannot be computed off-line, imposing a high computational overhead on the system.
Tang \textit{et. al.} study in \cite{ref:Kay_Tang2009} several admission control schemes at a centralized spectrum manager. The objective is to meet the traffic demands of SUs, increasing spectrum utilization efficiency while assuring a grade of service in terms of blocking probability to primary users. Among the schemes analyzed, the best performing one is based on a constrained Markov decision process (CMDP).

When the problem is distributed, dynamic game theory is used instead of MDP.
In \cite{ref:Niyato2009_Dyn}, spectrum trading from PUs to SUs is modeled as a non-cooperative dynamic game, using a Markov chain to describe groups of SUs buying opportunities from PUs. Given its distributed implementation, the main goal of this approach is finding the system's equilibrium. The objective in \cite{ref:Zhou2008} and \cite{ref:Jia2009_Rev} is maximizing the profit of PUs, with especial interest in assuring bidding truthfulness. Wang \textit{et. al.} present in \cite{ref:Wang2010_Spec} a bandwidth auction mechanism between an PU and multiple SUs, where the objective is to maximize the SU's payoff and reach Nash equilibrium in a competitive and distributed manner, while the PU sets a minimum remaining bandwidth for its own use as a constraint.

\subsection{Our Contribution}

This chapter addresses the design of centralized DSA MAC protocols for real-time dynamic spectrum auction. We explore the possibilities of a formal design based on a Markov decision process (MDP) formulation and propose, in Section \ref{Sarnoff_sec_model}, a design framework to balance the grade-of-service (given by the blocking probability for PUs) and the expected economic revenue provided by the SUs' accepted bids. This trade-off can be managed in two ways. One consists of computing a single objective value given by a combination of the blocking probability and the expected revenue. The weights assigned to each objective determine the point in the Pareto front where the obtained policy lies. The other approach, which is presented in Section \ref{sec:Constrained MDP}, consists of solving for one of the objectives and setting constraints on the remaining ones.
This strategy results in a constrained MDP formulation (CMDP) and the policies obtained are not necessarily deterministic.

\section{System Model}\label{Sarnoff_sec_model}

The model includes a spectrum bidding procedure in which SUs send their bid offers, within a finite countable set of prices (for mathematical tractability), for the use of a channel. Each bid offer consists of the price that the SU is willing to pay for each minute of channel holding time. Taking into account the trade-off between the blocking probability of PUs and the expected benefit obtained from spectrum rental, SUs can be accepted or rejected. Accepted SUs are given access to the band and they are charged for it the price they selected. PUs are always accepted if the there are available channels.
%As explained in the Sarnoff_sec_intro, public administrations assign the spectrum bands to wireless operators by a license scheme. Generally, operators gain spectrum licenses by bidding for them in public auction processes. We refer to this spectrum assignment framework as \textit{primary market}. The increasing demand of spectrum and the existence of spectrum holes have revealed the inefficiency of this mechanism. One practical and economically feasible way to solve this inefficiency is to allow spectrum owners to sell their spectrum opportunities in a \textit{secondary market}. In contrast to the primary market, the secondary operates in real-time.
%SUs, that may be operators without a spectrum license, submit their bids for spectrum opportunities to the spectrum owner, who determines the winner or winners by giving them access to the band and charging them the bidding price.

Incoming traffic is characterized by a classic Poisson model. PUs arrive with a rate of $\lambda_{L}$ arrivals per unit of time. The arrival rate for SUs is denoted by $\lambda_{U}$. The licensed spectrum managed by the central controller is assumed to be divided into channels (or bands) with equal bandwidth. Each user occupies a single channel. The average holding times for PUs and SUs are given by $1/\mu_{L}$ and $1/\mu_{U}$ respectively, where $\mu_{L}$ and $\mu_{U}$ denote the departure rate for each class. Because a Poisson traffic model is considered, both the inter-arrival time and the channel holding times are exponentially distributed random variables for both user classes. The model can be easily extended including more user classes, the probability that a user occupies two or more channels, and so on. Essentially the procedure is the same, but the Markov chain would comprise more states as more features are considered in the model. In this model, the state of the Markov chain is determined by the number of channels $k$ occupied by PUs, and the number of channels $s$ occupied by SUs. Because spectrum is a limited resource, there is a finite number $N$ of channels. Figure \ref{fig:Diagram2} depicts a diagram of the model and its parameters. Note that we can map all the possible combinations of $\left(k,s\right)$ for $0\leq k \leq N$, $0\leq s \leq N$ and $k+s \leq N$ into a single integer $i$ such that
\begin{equation}\label{states}
	  0 \leq i \leq \displaystyle\frac{N\left(N+1\right)}{2}+N+1.
\end{equation}
The number in the right hand side of previous equation is the total number of states that we will denote by $N_{T}$.

The bidding prices are classified into a finite set of values: $\mathbb{B}=\left\{b_{1},b_{2},\ldots b_{m}\right\}$ given in money charged per unit of time. Each price has a probability $p_{i}$ of being offered by an incoming user. Obviously $\sum^{m}_{i=1}p_{i}=1$. Figure \ref{fig:Diagram2} illustrates this model.

\begin{figure}[!t]
\centering
\includegraphics[scale=0.9]{diagram2.eps}
\caption[]{Diagram of the auction-based access model. SUs can offer up to $m$ different bid prices. Each  price is assigned a probability. The access policy decides upon each bid according to the price offered and the system's state.}
\label{fig:Diagram2}
\end{figure}

%This model is a continuous-time Markov chain. In this case,
The objective of the MDP is to obtain the maximum economic profit with the minimum impact on PUs. In the framework of MDPs we have to define the actions and the costs of these actions.
%According to the objective, the expected cost is obtained as a linear combination of the blocking probability of the primary users and the income benefit from SUs. By adjusting the weighting factors we can compute a Pareto front for both elements.
 Let $g(i,u)$ denote the instantaneous cost of taking action $u$ at state $i$. The control $u$ at each stage determines the admitted and rejected bidding prices. Logically, the control should be defined as a threshold, \textit{i.e.} when $u = i$ only bids equal or above $p_{i}$ are admitted. For notation convenience, the control $u = m+1$ indicates that no bid is accepted. The per-stage reward function $g(i,u)$ is given by the linear combination of the the blocking probability per unit of time, $g_{L}(i,u)$, and the expected benefit at stage $i$ when decision $u$ is made, $g_{U}(i,u)$. Therefore $g(i,u)$ =  $\alpha g_{L}(i,u)$ + $\beta g_{U}(i,u)$ where the scalars $\alpha$ and $\beta$ are weighting factors. Note that $\beta < 0$ since the objective is to minimize $g(i,u)$. By adjusting $\alpha$ and $\beta$ we can compute a Pareto front for both objectives.

The function $g_{L}(i,u)$, is given by the probability that the system cannot provide a channel to an incoming PU:
\begin{equation} \label{gLpriority}
	  g_{L}(i,u) =
	  \begin{cases}
		1,& \text{ if }i \equiv (k,s) \text{ and } k+s = N\\
		0,& \text{ otherwise} \\
 \end{cases}
\end{equation}
where the symbol ``$\equiv$'' denotes equivalence, \textit{i.e.} $i$ corresponds to a state $(k,s)$ such that $k+s = N$.

To determine $g_{L}(i,u)$, let $B_{i}$ denote the expected income when an SU whose bidding price is $b_{i}$ is accepted. Since the average channel holding time for PUs is $1/\mu_{U}$, then $B_{i} = b_{i}/\mu_{U}$.
Given a control $u$, $P\left(r | u\right)$ denotes the conditional probability that the bidding price of the next accepted SU is $b_{r}$, and is given by
\begin{equation}
	  P\left(r |u\right) =
	  \begin{cases}
		\displaystyle\frac{p_{r}}{\sum^{m}_{j = u}p_{j}}, & \text{ if }r \geq u\\
		0, & \text{ otherwise } \\
 \end{cases}
\end{equation}
Let us define $\tilde{g}_{U}(i,u,j)$ as the average benefit associated to the transition from state $i$ to state $j$. Its expression is
\begin{equation}
	  \tilde{g}_{U}(i,u,j) =
	  \begin{cases}
		p_{U}\sum^{m}_{r = 1}B_{r}P\left(r | u\right), & \text{ if }j = i+1\\
		0, & \text{ otherwise} \\
 \end{cases}
\end{equation}
where $p_{U} = \lambda_{U}/(\lambda_{U}+\lambda_{L})$ denotes the probability that the next arrival corresponds to an SU.
Therefore, the per-stage benefit $g_{U}(i,u)$ is given by
\begin{equation}\label{gUauction}
\begin{array}{lcl}
g_{U}(i,u) & = & \sum^{N_{T}}_{j = 1}\tilde{g}_{U}(i,u,j)p_{ij}(u)\\
					& = & p_{i,i+1}(u)p_{U}\sum^{N_{T}}_{j = 1}B_{r}P\left(r |u\right).
	\end{array}
\end{equation}

%The problem can be solved by solving equation (\ref{BellmanEq}) with the cost functions and transition probabilities corresponding to this model.
The objective is to find a policy minimizing the expected value of the combined cost, given by
\begin{equation}	 \lim_{K\rightarrow\infty}\frac{1}{E\left\{t_{K}\right\}}
E\left\{\int^{t_{K}}_{0}g\left(x(t),u(t)\right)\right\}
\end{equation}
where $t_{K}$ is the completion time of the $K$-th transition. The problem can be solved by formulating its auxiliary discrete-time average cost problem. Let $\gamma$ be a scalar greater than the transition rate out of any state of the chain, \textit{i.e.} $\gamma > v_{i}(u)$ for every $i$.
%, where $v_{i}(u)$ is the transition rate out of state $i$
We can compute the transition probabilities $\tilde{p}_{ij}(u)$ for the auxiliary discrete-time problem from the probabilities $p_{ij}(u)$ of the original problem as
\begin{equation}
	  \tilde{p}_{ij}(u) =
	  \begin{cases}
		\frac{v_{i}(u)}{\gamma}p_{ij}(u) &, \text{ if }i \neq j\\
		1- \frac{v_{i}(u)}{\gamma}&, \text{ if }i = j \\
 \end{cases}
\end{equation}

%We can formulate the auxiliary discrete-time average cost problem for the model described.
%The equation providing the optimum average cost $\lambda$ is
We can now formulate Bellman's equation (see \cite{ref:Bertsekas2012}) to obtain the optimum average cost $\lambda$
%It is known (see \cite{ref:Bertsekas2012}) that if the scalar $\lambda$ and the vector $\tilde{h}$ satisfy
\begin{equation}\label{BellmanEqAuction}
\tilde{h}\left(i\right) = \min_{u\in \left\{0,1\right\}}\biggl[\alpha g_{L}(i,u) + \beta g_{U}(i,u)v_{i}(u) -
 \lambda + \displaystyle\sum_{j=1}^{N_{T}}\tilde{p}_{ij}\bigl(u\bigr)\tilde{h}\left(j\right)\biggr]
\end{equation}
for $i =1,\ldots,n$. Multiplying $g_{U}(i,u)$ by $v_{i}(u)$ yields benefit per unit of time.
%then $\lambda$ and the vector $h$ with components $h(i) = \gamma\tilde{h}(i)$ solve the original problem.
It can be anticipated that the structure of this problem, essentially a connection admission control problem, requires a threshold type solution in which upcoming SUs of each class will only be admitted into the system if the number of occupied channels is below certain threshold. There will be one threshold per bidding price. By properly adjusting the weighting factors $\alpha$ and $\beta$ we can compute a Pareto front allowing us to determine the maximum possible benefit for a given blocking objective for the PUs.

\section{Constrained MDP}\label{sec:Constrained MDP}
%So far, the approach to merge several objectives consisted on combining them into a single objective by means of a weighted sum and solving the problem as a conventional MDP. However,
When several objectives concur in an MDP problem, another feasible approach is to optimize one of them subject to constraints on the other objectives. This strategy results in a CMDP formulation of the problem. Solving MDPs by iterative methods such as policy or value iteration allows us to find deterministic policies, \textit{i.e.} policies that associate each system's state $i \in S$ to a single control $u$.
% \in U(i)$, where $U(i)$ is a subset of $U$ containing the controls allowed in state $i$.
However, these policies do not, in general, solve CMDP problems. Instead, the solution of a CMDP is a randomized policy, \textit{i.e.} it associates each state to a probability distribution defined over the elements in $U(i)$.

There are mainly two approaches to solve CMDPs, linear programming (LP) and Lagrangian relaxation of the Bellman's equation. This proposal follows the former one. Each feasible LP formulation relies on the use of the \textit{dual} variables $\phi\left(i,u\right)$, defined as the stationary probability that the system is in state $i$ and chooses action $u$ under a given randomized stationary policy. The problem addressed in this chapter results, under every stationary policy, in a truncated birth-death process, since PUs are always accepted. In consequence, every resulting Markov chain is \textit{irreducible}, in other words, it is recurrent and there are not transient states. Moreover, the state and action spaces are finite.
Under these circumstances, as shown in \cite{ref:Puterman2005}, every feasible solution of the LP problem corresponds to some randomized stationary policy. Therefore, if the constrained problem is feasible, then there exists an optimal randomized stationary policy.
%Under these circumstances, several results \cite{ref:Puterman2005} guarantee that every feasible solution of the LP problem corresponds to some randomized stationary policy resulting in the probabilities  and, what is even more important, if the constrained problem is feasible, then there exists an optimal randomized stationary policy.

The LP approach consists of expressing the objective and the constraints in terms of $\phi\left(i,u\right)$. Once the problem is discretized, the average cost is defined as
\begin{equation}\label{objective}
\lambda = \lim_{K\rightarrow\infty}\frac{1}{K}
E\left\{\sum^{K}_{k=0}g_{U}\left(x_{k},u_{k}\right)\right\}
\end{equation}
where $k$ denotes the decision epoch of the process.
The constraints are defined similarly to the main objective: each constraint imposes a bound on an average cost related to a different per-stage cost. In our case, it is given by
\begin{equation}\label{constraint}
c = \lim_{K\rightarrow\infty}\frac{1}{K}
E\left\{\sum^{K}_{k=0}g_{L}\left(x_{k},u_{k}\right)\right\} \leq \beta
\end{equation}
where $g_{L}\left(x(t),u(t)\right)$ is the real-valued function providing the per-stage cost associated to the constraint $\beta$. Therefore the average reward MDP with a single constraint is defined as the following minimization problem:
\begin{equation}
\min_{\mu} \lambda \text{ subject to } c \leq \beta
\end{equation}
Given the characteristics of the problem (finite state and action spaces and recurrent Markov chain under every policy), the limits in (\ref{objective}) and (\ref{constraint}) exist and are equal to
\begin{equation}
\lambda = \displaystyle\sum_{i\in S}\displaystyle\sum_{u\in U(i)}g_{U}\left(i,u\right)\phi\left(i,u\right)
\end{equation}
and
\begin{equation}
c = \displaystyle\sum_{i\in S}\displaystyle\sum_{u\in U(i)}g_{L}\left(i,u\right)\phi\left(i,u\right)
\end{equation}
respectively. In addition, the following conditions must be hold by the \textit{dual} variables:
\begin{equation}
\displaystyle\sum_{u\in U(j)}\phi\left(j,u\right) = \displaystyle\sum_{i\in S}\displaystyle\sum_{u\in U(i)}p_{ij}\left(u\right)\phi\left(i,u\right)
\end{equation}
for all $j \in S$, which is closely related to the balance equations of the Markov chain and
\begin{equation}
\displaystyle\sum_{i\in S}\displaystyle\sum_{u\in U(i)}\phi\left(i,u\right) = 1,
\end{equation}
which, together with $\phi\left(j,u\right) \geq 1$ for $i \in S$ and $u \in U(i)$ correspond to the definition of $\phi\left(i,u\right)$ as a limiting average state action frequency. In consequence, the LP for the CMDP has the following formulation:
\begin{equation}\label{CompleteCMDP}
\begin{array}{ll}
\underset{\phi}\min & \displaystyle\sum_{i\in S}\displaystyle\sum_{u\in U(i)}g_{U}\left(i,u\right)\phi\left(i,u\right) \\
\text{s.t.} & \displaystyle\sum_{i\in S}\displaystyle\sum_{u\in U(i)}g_{L}\left(i,u\right)\phi\left(i,u\right) \leq \beta\\
& \displaystyle\sum_{u\in U(j)}\phi\left(j,u\right) - \displaystyle\sum_{i\in S}\displaystyle\sum_{u\in U(i)}p_{ij}\left(u\right)\phi\left(i,u\right) = 0 \\
& \displaystyle\sum_{i\in S}\displaystyle\sum_{u\in U(i)}\phi\left(i,u\right) = 1\\
& \phi\left(j,u\right) \geq 1
\end{array}
\end{equation}
Assuming that the problem is feasible and $\phi^{*}$ is the optimal solution of the LP problem above, the stationary randomized optimal policy $\mu^{*}$ is generated by
\begin{equation}
q_{\mu^{*}\left(i\right)}\left(u\right)=\displaystyle\frac{\phi^{*}\left(i,u\right)}{\sum_{u' \in U(i)}\phi^{*}\left(i,u'\right)}
\end{equation}
for cases where the sum in the denominator is nonzero. Otherwise, the state is transitory and the control is irrelevant. Note that $q_{\mu^{*}\left(i\right)}\left(u\right)$ denotes the probability of choosing action $u$ at state $i$ under policy $\mu^{*}$.

\section{Numerical Results}\label{Sarnoff_sec_numerical}
We will consider three scenarios characterized by the asymmetry between the traffic intensity of PUs and SUs. In every scenario, the average holding time is equal for every user, independently of their type. Therefore the service rate $\mu_{L}$ =$\mu_{U}$ = 5. Assuming that the time unit is an hour, this results in an average holding time of 12 minutes per connection. The total traffic ($\lambda$ = $\lambda_{L}$ + $\lambda_{U}$) is 40 calls/h, which yields a total incoming traffic of 8 Erlangs. In a wireless cell covering 2.5 km$^{2}$ of urban area (cell radius equal to 400 m), with 2000 people per km$^{2}$ and a 10\% aggregate market penetration (PUs and SUs), the number of covered users is around 500, and the resulting traffic intensity is 0.016 Erlangs per user. The number of available channels is set to $N=10$, in order to evaluate the system in a relatively congested situation. With the assumed traffic intensity we can estimate the blocking probability of the system for the aggregate traffic by means of the well-known Erlang's B formula (see \cite{ref:Klei}):
\begin{equation}
E\left(n,\rho\right)=\displaystyle\frac{\frac{\rho^{n}}{n!}}{\sum_{j=0}^{j=n}\frac{\rho^{j}}{j!}}
\end{equation}
where $n$ is the number of channels and $\rho$ denotes the utilization factor. In our case $\rho$=$\lambda/\mu_{L}$ = $\lambda/\mu_{U}$. According to this formula, if the system accepted every incoming user, the total blocking probability would be $E\left(10,8\right)$=0.12. As we will see, this probability is an upper bound for the blocking probability of the PUs and a lower bound for the SUs.

The three scenarios are summarized in Table \ref{tab:table1}.

\begin{table}[h]
\centering
\begin{tabular}{lccc} \hline
 \textbf{Parameter} & \textbf{scenario 1} & \textbf{scenario 2} & \textbf{scenario 3}\\\hline
$\lambda_{L}$ (calls/h) & 30 & 20 & 10\\
$\lambda_{U}$ (calls/h) & 10 & 20 & 30\\
$\mu_{L}$=$\mu_{U}$ (calls/h) & 5 & 5 & 5\\
$N$ & 10 & 10 & 10\\\hline
\end{tabular}
\caption{Parameters setting for the three scenarios of the priority based access problem.}\label{tab:table1}
\centering
\end{table}

Additionally we define three classes of SUs, characterized by the price that they offer per minute of channel occupation. The bid offers per class are: class 1: 0.01 \$/m, class 2: 0.02 \$/m and class 3: 0.03 \$/m. We define the probability of an SU incoming call being of each class. The SU class probability distribution is: class 1 probability: 0.5, class 2 probability: 0.3 and class 3 probability: 0.2. We summarize SU class definition in Table \ref{tab:table2}.

\begin{table}[h]
\centering
\begin{tabular}{lccc} \hline
 \textbf{SU class} & \textbf{class 1} & \textbf{class 2} & \textbf{class 3}\\\hline
offered price (\$/m) & 0.01 & 0.02 & 0.03\\
probability & 0.5 & 0.3 & 0.2\\\hline
\end{tabular}
\caption{Classification of SUs in terms of their bid offers and their corresponding probabilities.}\label{tab:table2}
\centering
\end{table}
Note that both the offered prices and their probability distributions are static, \textit{i.e.} they do not change over time and are independent of the system occupation. It is not unrealistic taking into account typical tariff policies of wireless operators. In this environment the class structure and the probability distribution may be seen as types of contracts for SUs and market penetration of each type of contract respectively. However, for a more dynamical auction process, where bidders are able to change their bid offers adaptively, the model should be revised. One possibility would be to define one probability distribution for each state. More detailed modeling strategies would increase the complexity of the MDP solving algorithm or even make them intractable. This is a classic problem of MDPs, known as the \textit{curse of dimensionality} and is typically addressed by means of the heuristic approach of approximate dynamic programming.

\begin{figure}
\centering
\includegraphics[scale=0.5]{MDPauction3010.eps}
\includegraphics[scale=0.5]{MDPauction2020.eps} \\
\includegraphics[scale=0.5]{MDPauction1030.eps}
\caption{Pareto fronts obtained for the auction-based access} \label{fig:MDPauction}
\end{figure}
% \begin{figure}[h]
% \centering
% \subfloat[scenario 1]{
% \includegraphics[scale=0.5]{MDPauction3010.eps}
% %\centerline{\psfig{figure=MDPauction3010.eps,width=3cm} }
% \label{fig:subfig1auction}
% }
% \subfloat[scenario 2]{
% \includegraphics[scale=0.5]{MDPauction2020.eps}
% %\centerline{\psfig{figure=MDPauction2020.eps,width=3cm} }
% \label{fig:subfig2auction}
% } \\
% \subfloat[scenario 3]{
% \includegraphics[scale=0.5]{MDPauction1030.eps}
% %\centerline{\psfig{figure=MDPauction1030.eps,width=3cm} }
% \label{fig:subfig3auction}
% }
% \caption[]{Pareto fronts obtained for the auction-based access}\label{fig:MDPauction}
% \end{figure}

Figure \ref{fig:MDPauction} shows the Pareto fronts for the auction-based system in the three scenarios. It can be observed that, for the same traffic intensity (the three scenarios receive 40 calls per unit of time) when the traffic share of the SUs is higher, the income obtained from SUs increases at the time that the blocking probability of the PUs diminishes. It is interesting to check that, especially in scenarios 2 and 3, a very small increment of PU blocking probability can multiply the benefit obtained from spectrum leasing by a factor of 2 or 3. On the other hand, these figures also indicate that once the income surpasses certain threshold, Pareto-optimal policies can only produce small increments of the income by dramatically rising PU blocking probability.

\begin{figure}[h]
\centering
\includegraphics[scale=0.5]{Policy3010.eps}
\includegraphics[scale=0.5]{Policy2020.eps}\\
\includegraphics[scale=0.5]{Policy1030.eps}
\caption[]{Graphical representation of policies attaining 0.04 PU blocking probability for the auction-based access}\label{fig:Policies}
\end{figure}

%A graphical representation of three policies of the first scenario can be observed in Fig. \ref{fig:Policies}.
Fig. \ref{fig:Policies} shows the policies attaining a blocking probability for PUs of 0.04 for each scenario.
%The polices correspond to blocking probabilities for the PUs of 0.01, 0.02 and 0.03.
The height of the bars corresponds to the lowest accepted class (prices) at each state. States where bars' height is $0$ correspond to states where all SUs are rejected, independently of their bids. As expected, Pareto-optimal policies are threshold type. As the traffic intensity of PUs reduces respect to that of the SUs, there are more states where SUs are admitted in the system, and lower prices are accepted, \textit{i.e.} the thresholds move toward smaller numbers. Interestingly, it is the total amount of occupied channels, and not the type of users occupying them, what determines the thresholds.
%This fact suggests that the analytical model can be simplified by notably reducing the size of state space. This would increase the feasibility of the procedure in higher dimensional problems, thus allowing the generalization of the model to \textit{e.g.} variable distributions of the bid offers.

%In order to illustrate how policies change on the Pareto front, let us consider three different points of the Pareto front for scenario 2. These points correspond to the following blocking probabilities for PU: 0.01, 0.02 and 0.03.

\section{Conclusions}\label{Sarnoff_sec_conclusions}
In this chapter we propose an MDP framework for real-time auction-based spectrum leasing. The SUs are classified according to the price they are willing to pay for the use of the spectrum. The main issue of the problem addressed is that two contrary objectives coexist: to reduce blocking probability for PUs and to increase the income received from spectrum leasing. For these type of problems there does not exist an \textit{optimal} policy, but a set of \textit{Pareto optimal} policies.

We have shown how to compute policies at the Pareto front by weighting the objectives in an MDP problem or by reformulating the problem as a constrained MDP.
Numerical solutions of the proposed equations show the influence of the traffic share on system's performance and on the structure of Pareto-optimal policies.


\section{Coercive Subtyping}
We now discuss a possible solution to the problems encountered when defining the sample $ex3_wrong$. We give a predicate that expresses the relation of coercive subtyping:
\begin{lstlisting}
class Coercible a b where
  coerce :: a -> b
\end{lstlisting}

We give the usual instances of this predicate, since the relation it represents is both reflexive and transitive:
\begin{lstlisting}
instance Coercible a a where
  coerce a = a

instance (Coercible a b, Coercible b c) => Coercible a c where
  coerce a = coerce (coerce a)
\end{lstlisting}

\section{Coercive Subtyping for References}
We wish to instance the coercion predicate to references. References are:
\begin{itemize}
\item covariant in the referenced type
\item contravariant in the state type
\end{itemize}
This happens because a reference to some $a$ can be used whenever a reference to an $a$ such that $a \le a'$ is expected, and also (as seen in the third example above), a reference that works on a state $s'$ can be used whenever a state $s$ such that $s \le s'$ is available. Of course, the fact that references express not only reading values and states but also writing will make this operation relatively tricky.

At the moment we will only focus on expressing the coercion relation for the state of the reference; the coercion relation for the value of the reference will be discussed together with inheritance.

The kind of operation that we wish to perform when coercing a reference to work on a larger memory is summarized in Figure \ref{fig:ref_coerce}. Whenever we wish to perform some operation on a reference to the smaller memory, we will:
\begin{itemize}
\item take only the first part of the (larger) input memory
\item perform the operation on the obtained smaller memory through the original reference we have coerced
\item replace the first part of the (larger) input memory with the (smaller) modified memory
\end{itemize}

\begin{figure}[h]
\centerline{\psfig{file=heap_upcasting.png,height=5cm}} \caption{Coercing references.\label{fig:ref_coerce}}
\end{figure}

We instance the coercion predicate for references to perform a single step of coercion, that is for the case when we have a reference to a memory $tl$ and we want to use it where we expect a memory $Cons\ h\ tl$:
\begin{lstlisting}
class HList tl => Coercible (Ref tl a) (Ref (Cons h tl) a) where
  coerce ref =
    Ref (ST(\(Cons h tl) ->
      let (tl$'$,res) = get ref tl
      in (h $'$Cons$'$ tl$'$, res))
        (\v -> ST(\(Cons h tl) ->
          let (tl$'$,()) = set ref tl v
          in (h $'$Cons$'$ tl$'$, ())))
  where get (Reference (ST g) _) = g
    set (Reference _ s) = \st -> \v ->
      let (ST s$'$) = s v
      in s$'$ st
\end{lstlisting}

Now we can finally rewrite the example above to make use of our new coercion operator:
\begin{lstlisting}
ex3 :: ST Nil Unit
ex3 = do+ i <- new 10 :: Ref (New Nil Int) Int
          s <- new "Hello" :: Ref (New (New Nil Int) String) String
          (coerce i) *= (+2)
          s *= (++" World")
          return ())
\end{lstlisting}

Before Giuseppe's PhD/Monads/ObjectiveMonad/MonadicObjects/trunk/tex v2/5.subtyping.tex


\chapter{Luttinger Liquid}

\begin{figure}
	\centering
	\includegraphics[width=0.4\linewidth]{pics/LL-linearize.png}
	\caption{Linearized Model.}
	\label{fig:bs-linearize}
\end{figure}

In this section, we discuss the one-dimensional interacting Fermi system, described by the Hamiltonian
\begin{equation}
	H = -\frac{1}{2}\sum_{i} (c_i^\dagger c_{i+1} + c_{i+1}^\dagger c_i) + \mu\sum_i c_i^\dagger c_i + \sum_{i,j,k,l} u_{ijkl} c_i^\dagger c_j^\dagger c_k c_l.
\end{equation}
The dispersion for the free theory is
\begin{equation}
	\varepsilon(k) = -\cos k, \quad
	v_F = \partial_k \varepsilon(k)|_{k=k_F} = \sin k_F.
\end{equation}
Near the Fermi surface with momentum $k_F$, the spectrum can be approximately linearized (as shown in Fig.~\ref{fig:bs-linearize}), with the left and right moving fermion modes:
\begin{equation}
	\varepsilon_{R/L}(k) = \begin{cases}
		v_F (k - k_F) & r=R \\
		-v_F (k + k_F) & r=L
	\end{cases}.
\end{equation}
The fermi momentum is (assume $N_L=N_R$)
\begin{equation}
	k_F = \frac{\pi N}{2L}.
\end{equation}
The state while all fermion modes filled below the Fermi surface and all modes empty above the Fermi surface is defined as the vacuum state $|0\rangle_0$.

\section{Field Theory for Luttinger Liquid}

In this section, we gives a field theoretical analysis of the interacting fermion system in 1D.
For the notational simplicity, we shift the momentum so that
\begin{equation}
	k \rightarrow k' = \begin{cases}
		k - k_F & r=R \\
		-k - k_F & r=L
	\end{cases}.
\end{equation}
The dispersion is then $\varepsilon_r(k) = v_F k$.
In this way, two Fermi points are brought to the origin, the left and right moving branches have the same dispersion.
The integral over momentum shell for both species of fermion can then be denoted by
\begin{equation}
	\int^\Lambda \frac{dK}{2\pi} \equiv \int_{-\Lambda}^\Lambda \frac{dk_L}{2\pi} + \int_{-\Lambda}^\Lambda \frac{dk_R}{2\pi}.
\end{equation}

\subsection{Effective Field Theory}

The effective field theory for the free field is
\begin{equation}
	Z_0 = \prod_{r=L/R}\int D\left[\bar\psi_r(k,\omega),\psi_r(k,\omega)\right] e^{-S_0},
\end{equation}
where the free field action is
\begin{equation}
	S_0 = \sum_{r=L/R} \int^\Lambda_{-\Lambda} \frac{dk}{2\pi} \int^\infty_{-\infty} \frac{d\omega}{2\pi}
	\bar\psi_r(k,\omega)[-i\omega + v_F k]\psi_r(k,\omega),
\end{equation}
which gives the free field propagator:
\begin{equation}
	G_r(k,\omega) = -\langle \psi_r(k,\omega)\bar\psi_r(k,\omega)\rangle
	= \frac{1}{i\omega - v_F k}.
\end{equation}
We then consider the rescaling of the cut-off $\Lambda \rightarrow \Lambda/s$.
To make the free action scale invariant, we define the rescaled variables:
\begin{equation}
	k' = sk, \quad \omega' = s\omega, \quad
	\psi'_r(k',\omega') = s^{-3/2}\psi_r(k,\omega).
\end{equation}
Then we consider the perturbation from quadratic and quartic terms:
\begin{equation}
\begin{aligned}
	\delta S_2 &= \sum_{r=L/R} \int^\Lambda_{-\Lambda}\frac{dk}{2\pi}\int^\infty_{-\infty} \frac{d\omega}{2\pi}
	\mu(k,\omega) \bar\psi_r(k,\omega) \psi_r(k,\omega), \\
	\delta S_4 &= \frac{1}{2!2!} \int^\Lambda_{K,\omega}
	u(4,3,2,1)\bar\psi(4)\bar\psi(3)\psi(2)\psi(1),
\end{aligned}
\end{equation}
where we have suppressed the momentum labels:
\begin{equation}
	\psi(i) = \psi_{r_i}(k_i,\omega_i), \quad
	u(4,3,2,1) = u(K_4,\omega_4;K_3,\omega_3;K_2,\omega_2;K_1,\omega_1),
\end{equation}
and the integral is defined as:\footnote{The symbol $\bar\delta$ enforces momentum conservation mod $2\pi$, as is appropriate to any lattice problem. A process where lattice momentum is violated in multiples of $2\pi$ is called an \textit{umklapp process}.}
\begin{equation}
\begin{aligned}
	\int_{K \omega}^{\Lambda}
	=& \ \int^\Lambda \frac{d K_1 \cdots d K_4}{(2 \pi)^{4}} \int_{-\infty}^{\infty} \frac{d \omega_{1} \cdots d \omega_{4}}{(2 \pi)^{4}} \times 2 \pi \delta\left(\omega_{1}+\omega_{2}-\omega_{3}-\omega_{4}\right) \\
	&\ \times 2 \pi \bar{\delta}(K_1+K_2-K_3-K_4).
\end{aligned}
\end{equation}
Since this action separates into slow and fast pieces, the effect of mode elimination is simply to reduce $\Lambda$ to $\Lambda/s$ in the integral above. Rescaling moments and fields, we find that
\begin{equation}
	\mu'(k',\omega') = s\cdot\mu\left(\frac{k'}{s}, \frac{\omega}{s}\right).
\end{equation}
Expand $\mu$ in series:
\begin{equation}
	\mu(k, \omega)=\mu_{00}+\mu_{10} k+\mu_{01} i \omega+\cdots+\mu_{n m} k^{n}(i \omega)^{m}+\cdots,
\end{equation}
and compare both sides. The constant piece is a relevant perturbation.
This relevant flow reflects the readjustment of the Fermi sea to a change in chemical potential.
The correct way to deal with this term is to include it in the free-field action by filling the Fermi sea to a point that takes $\mu_{00}$ into account.
The next two terms are marginal and modify terms that are already present in the action.

We now turn on the quartic interaction, the dimensional analysis gives the transformation of $u$:
\begin{equation}
	u'_{i_4,i_3,i_2,i_1}(k'_i,\omega'_i) = u_{i_4,i_3,i_2,i_1}\left(\frac{k'_i}{s},\frac{\omega'_i}{s}\right).
\end{equation}
If we expand $u$ in a Taylor series in its arguments and compare coefficients, we find that the constant term u0 is marginal and the higher coefficients are irrelevant.
Thus, $u$ depends only on its discrete labels and we can limit the problem to just a few coupling constants instead of the coupling function we started with.
Furthermore, all reduce to just one coupling constant:
\begin{equation}
	u_0 = u_{LRLR} = u_{RLRL} = -u_{RLLR} = -u_{LRRL} \equiv u.
\end{equation}
Other couplings corresponding to the ($LL \rightarrow RR$) process are wiped out by the Pauli principle since they have no momentum dependence and cannot have the desired antisymmetry.

\subsection{RG at One-loop Level}

Consider the infinitesimal rescale $s=e^{dt}$.
The one-loop contribution to the quadratic term is\footnote{We include an infinitesimal $e^{i\omega\eta}$ to ensure convergence as we do the integral over $\omega$ by closing the upper half-plane.}
\begin{equation}
	\mu^{(2)}_{LL} = \includegraphics[align=c, width=0.125\linewidth]{pics/LL-1.png}
	= -u \int_{d\Lambda} \frac{dk}{2\pi}\int^\infty_{-\infty}\frac{d\omega}{2\pi}\frac{e^{i\omega \eta}}{i\omega - v_F k},
\end{equation}
where the integral on the momentum shell is
\begin{equation}
	\int_{d\Lambda}\frac{dk}{2\pi} = \int_{-\Lambda}^{-\Lambda(1-dt)} \frac{dk}{2\pi} + \int_{\Lambda(1-dt)}^{\Lambda} \frac{dk}{2\pi}.
\end{equation}
The result gives:
\begin{equation*}
	\mu^{(2)}_{LL}
	= -\frac{u\Lambda}{2 \pi}dt
\end{equation*}
By the symmetry $L \leftrightarrow R$, we know $\mu^{(2)}_{LL}=\mu^{(2)}_{RR}=\mu^{(2)}$, so the RG flow is
\begin{equation}
	\frac{d}{dt}\left[s\cdot\left(\mu+\mu^{(2)}\right)\right] = \mu - \frac{u\Lambda}{2\pi}.
\end{equation}
The one-loop correction to the quartic term ($u_{LRRL}=-u$) have two contributions.
One is called ZS' (zero sound) channel:\footnote{There is actually another zero sound channel ZS, but which has no contribution to the vertex because the diagram contains the vertex of the ($LL \rightarrow RR$) process, which has no relevant contribution the the vertex.}
\begin{equation}
\begin{aligned}
	u^{(2)}_{\mathrm{ZS'}}
	&= \includegraphics[align=c, width=0.2\linewidth]{pics/LL-2.png} \\
	&= -u^2 \int^\infty_{-\infty}\int_{\Lambda/s<|k|<\Lambda} \frac{d\omega dk}{(2\pi)^2} \frac{e^{i\omega\eta}}{(i\omega+v_F k)(i\omega-v_F k)} \\
	&= u^2\int_{\Lambda/s<|k|<\Lambda} \frac{dk}{2\pi} \frac{1}{2|k|} \\
	&= \frac{u^2}{2\pi}\frac{d\Lambda}{\Lambda}.
\end{aligned}
\end{equation}
The sign is obtained from contracting the Fermion field monomial:
\begin{equation*}
	\wick{
        \c1 {\bar\psi}_L \bar\psi_R \psi_L \c2 \psi_R
        \bar\psi_L \c2 {\bar\psi}_R \c1 {\psi}_L \psi_R
	} = -G_L G_R \bar\psi_R \psi_L \bar\psi_L \psi_R
	= -G_L G_R \bar\psi_L \bar\psi_R \psi_L \psi_R.
\end{equation*}
The other is called the BCS channel:\footnote{The $1/2$ factor comes from the symmetry factor of the diagram.}
\begin{equation}
	u^{(2)}_{\mathrm{BCS}}
	= \includegraphics[align=c, width=0.15\linewidth]{pics/LL-3.png}
	= -\frac{u^2}{2} \sum_{r=L/R}\int^\infty_{-\infty}\int_{d\Lambda} \frac{d\omega dk_i}{(2\pi)^2} \frac{e^{i\omega\eta}}{(i\omega-v_F k)(-i\omega-v_F k)}.
\end{equation}
The sign is obtained from the contraction:
\begin{equation*}
	\wick{
        \bar\psi_L \bar\psi_R \c1 \psi_L \c2 \psi_R
        \c1 {\bar\psi}_L \c2 {\bar\psi}_R \psi_L \psi_R
	} = -G_L G_R \bar\psi_L \bar\psi_R \psi_L \psi_R.
\end{equation*}
Note that we will obtained a factor of 2 since in this channel, the intermedia propagator can be left mover or right mover.
We see that two contributions cancel out:
\begin{equation}
	u^{(2)}_{\mathrm{ZS'}} + u^{(2)}_{\mathrm{BCS}} = 0.
\end{equation}
Together, the RG flow to the one-loop level is
\begin{equation}
	\frac{d\mu}{dt} = \mu - \frac{u\Lambda}{2\pi}, \quad
	\frac{du}{dt} = 0.
\end{equation}
The fixed point solution to the RG flow is:
\begin{equation}
	\mu^* = \frac{u^*\Lambda}{2\pi},
\end{equation}
where the fixed-point value of $u^*$ is arbitrary.
The vanishing beta function predict that at least for small interaction, the system does not immediately develop a CDW order.
However, as the vertex function is marginal in the RG analysis, the fix points become a fixed line.
When the coupling $u$ is nonzero, the analysis for the Gaussian fix point becomes untrustworthy.
Actually when $u$ is getting sufficiently large, the umklapp process becomes relevant and the system flows to CDW phase.
A more systematic analysis requires the bosonization techniques.

\section{Bosonization}

\subsection{Bosonic Hilbert Space}

In this section, we map the 1D interacting fermion system to a bosonic one.
The low energy excitations are particle-hole modes:
\begin{equation}
	\rho_{k}^\dagger = \sum_{q} c_{q+k}^\dagger c_{q}, \quad
	\rho_{k} = \sum_{q} c_{q}^\dagger c_{q+k} = \rho_{-k}^\dagger.
\end{equation}

To simplify the discussion, here we consider only a single branch of Fermion, as depicted in Fig.~\ref{fig:bs-hilbert}. The generalization to multiple branches is trivial since the dispersion is the same.

\begin{figure}
	\centering
	\includegraphics[width=0.25\linewidth]{pics/LL-hilbert.png}
	\caption{The vacuum state $|0\rangle_0$ of a single fermion branch.}
	\label{fig:bs-hilbert}
\end{figure}

\subsubsection*{Commutation Relation}
The commutation relation between $\rho_k$ and $\rho_{k'}^\dagger$ is:\footnote{We use the identity $[AB,C] = A[B,C] + [A,C]B$ and $[A,BC]=\{A,B\}C - B\{A,C\}$.}
\begin{equation}
\begin{aligned}
	\left[\rho_{k}, \rho_{k'}^\dagger \right]
	&= \sum_{q_1, q_2} \left[c_{q_1}^\dagger c_{q_1+k}, c_{q_2+k'}^\dagger c_{q_2}\right] \\
	&= \sum_{q_1, q_2} \left\{c_{q_1}^\dagger \left[c_{q_1+k}, c_{q_2+k'}^\dagger c_{q_2}\right] +\left[c_{q_1}^\dagger, c_{q_2+k'}^\dagger c_{q_2}\right] c_{q_1+k}\right\} \\
	&= \sum_{q_1, q_2} \left\{ \delta_{q_1+k,q_2+k'} c_{q_1}^\dagger c_{q_2} -
		\delta_{q_1,q_2} c_{q_2+k'}^\dagger c_{q_1+k} \right\} \\
	&= \sum_{q}\left[c^\dagger_{q+k'-k} c_{q}-c^\dagger_{q+k'} c_{q+k}\right].
\end{aligned}
\end{equation}
For $k \ne k'$, it is clear that $[\rho_{k},\rho_{k'}^\dagger]=0$.
However, when $k = k'$, we should be careful about the subtraction, since it evolve two infinities of which the subtraction is ill-defined.

Here we deal with the infinity with the lattice regularization, i.e., we think of the linearized theory as the low-energy approximation of a lattice mode, where the dispersion form a single energy band.
The left/right movers are actually in a single band but with positive/negative momentum.
Consider for example the density operator for the right mover, the commutator of the right moving density operator is then
\begin{equation}
	\left[\rho_{k,r}, \rho_{k,r}^\dagger \right] = \sum_{0<q<\pi} [n_{q,r}-n_{k+q,r}].
\end{equation}

\begin{figure}
	\centering
	\includegraphics[width=0.5\linewidth]{pics/LL-k-shift}
	\caption{Shift of the right-moving modes.}
	\label{fig:bs-k-shift}
\end{figure}

Consider for example the case where $r=R,k>0$, as shown in Fig.~\ref{fig:bs-k-shift}.
The subtraction result in a sum of low-lying right-mover number operator minus a sum of high-energy left-mover number operator, which behaves like a constant in the low energy regime.
The above analysis gives the commutation relation:
\begin{equation}
	\left[\rho_{k,r}, \rho_{kr}^\dagger \right] \simeq \frac{qL}{2\pi} \equiv n_q.
\end{equation}

Another way to deal with the infinity is by the normal-order expression:
\begin{equation}
	O = {:\mathrel{O}:} + \langle 0|O|0\rangle.
\end{equation}
For $k\ne k'$, since $\langle 0|c_k^\dagger c_k|0\rangle=0$, the normal ordering does not affect the result, while for the $k=k'$ case, the normal ordering takes care of the infinity of the particle number operator:
\begin{equation}
\begin{aligned}
	\sum_q [n_{q} - n_{q+k}]
	&= \sum_q \left[{:\mathrel{n_{q}}:} - {:\mathrel{n_{q+k}}:}
		+ \langle0|n_{q}|0\rangle -\langle0|n_{q+k}|0\rangle \right] \\
	&= \sum_q [\langle0|n_{q}|0\rangle -\langle0|n_{q+k}|0\rangle].
\end{aligned}
\end{equation}
The final result gives the same result as the above discussions.

\subsubsection*{Particle-hole Excitation}
We denote the ground state with $N$ fermions as $|N\rangle_0$, which satisfies:
\begin{equation}
	\rho_{p>0}|N\rangle_0 = \rho^\dagger_{p<0}|N\rangle_0 = 0.
\end{equation}
We can thus define a set of canonical bosonic modes:
\begin{equation}
	b_p^\dagger = i\frac{\rho^\dagger_p}{\sqrt{n_p}}, \quad
	b_p = -i\frac{\rho_p}{\sqrt{n_p}}, \quad [b_q,b_{q'}^\dagger] = \delta_{qq'}.
\end{equation}
We will assume $p>0$, and the $\pm i$ factor is a convention chosen for the future convenience.

Now we discuss the construction of the Hilbert space using the bosonic modes.
The $N$-particle sector is spanned by the states generated by applying $b_q^\dagger$'s to the ground state $|N\rangle_0$.
A general $N$-particle state has the form:
\begin{equation}
	|N\rangle = f(\{b_q^\dagger\})|N\rangle_0.
\end{equation}
Note that the bosonic mode $b_q$ does not change the particle number:\footnote{The particle number operator is defined by the normal order expression $\hat{N} = \sum_k {:\mathrel{c_{k}^\dagger c_{k}}:}$.}
\begin{equation}
	\left[\hat N, b_q \right] = \left[\hat N, b_q^\dagger \right] = 0.
\end{equation}
In order to construct the full Fock space, we also need to include a particle-number-changing operator, the \textit{Klein factor} $\hat F$, that shifts the total number of fermion by one, and commutes with bosonic operator $b_q$:
\begin{equation}
	\left[\hat F, b_q \right] = \left[\hat F, b_q^\dagger \right] = 0, \quad
	\left[\hat F, \hat N \right] = \hat F, \quad
	\left[\hat F^\dagger, \hat N \right] = -\hat F^\dagger.
\end{equation}
For system with different fermion species (labeled by $\eta$), the set of operator
\begin{equation*}
	\{b_{q,\eta}, b_{q,\eta}^\dagger, \hat F_\eta, \hat N_\eta\}
\end{equation*}
form a complete operator basis for the Hilbert space within the low-energy regime.
However, note that the Klein factor also takes care of the fermionic statistics.
That is, for the state denoted as
\begin{equation}
	|\{N_i\}\rangle = |N_1,N_2,\cdots,N_m\rangle
\end{equation}
The Klein factor $\hat F_\eta$ acting on the state will contribute an additional factor
\begin{equation}
	\hat F_\eta|\{N_i\}\rangle = \exp\left(i\pi\sum_{j=1}^{\eta-1}N_j\right)|N_1,\cdots,N_\eta-1,\cdots,N_m\rangle.
\end{equation}

\subsection{Bosonization of Fermion Field}
Now we try to express the fermion operator
\begin{equation}
	\psi(x) = \frac{1}{\sqrt{L}} \sum_p e^{ipx} c_{p}
\end{equation}
by the bosonic operator set.
First we consider the commutation relation between the fermion field operator and bosonic mode:
\begin{equation}\label{eq:bs-comm-1}
\begin{aligned}
	\left[b_q,\psi(x)\right] &= \frac{1}{\sqrt L}\frac{i}{\sqrt{n_q}}\sum_{k}\sum_{p} e^{ipx} [c^\dagger_{k}c_{k+q,r'},c_{p}] \\
	&= -\frac{1}{\sqrt L} \frac{i}{\sqrt{n_q}} \sum_{p} e^{ipx} c_{p+q}
	= -i\frac{1}{\sqrt{n_q}} e^{-iqx} \psi(x).
\end{aligned}
\end{equation}
Similarly,
\begin{equation}\label{eq:bs-comm-2}
	\left[b_q^\dagger,\psi(x)\right] = i\frac{e^{iqx}}{\sqrt{n_q}} \psi(x).
\end{equation}
For future convenience, we define a c-number factor:
\begin{equation}
	\alpha_q(x) \equiv \frac{1}{\sqrt{n_q}} e^{iqx},\quad
	[b_q^\dagger,\psi(x)] = i\alpha_q(x) \psi(x),\quad
	[b_q,\psi(x)] = -i \alpha^*_q(x) \psi(x).
\end{equation}
Since $b_q|N\rangle_0 = 0$, the commutation relation (\ref{eq:bs-comm-1}) leads to
\begin{equation}
	\left[b_{q}, \psi(x)\right]|N\rangle_{0}
	=b_{q} \psi(x)|N\rangle_{0}
	= -i\alpha_q^*(x) \psi(x)|N\rangle_{0}.
\end{equation}
Thus, $\psi(x)|N\rangle_0$ is an eigenstate of $b_q$, i.e., a coherent state:
\begin{equation}
	\psi(x)|N\rangle_0
	= \Lambda(x) \hat F \exp\left[-i\sum_{q>0} \alpha_q^*(x) b_q^\dagger\right]|N\rangle_0
\end{equation}
where $\Lambda(x)$ is a c-number, which can be determined by
\begin{equation*}
	{}_{0}\langle N-1|\psi(x)| N\rangle_{0}=\Lambda(x)\ {}_{0}\langle N|\exp \left[-i\sum_{q>0} \alpha^*_q(x) b_{q}^{\dagger}\right]| N\rangle_{0} = \Lambda(x).
\end{equation*}
The left-hand side can be computed directly, the result is\footnote{Note that the Fermi point locates at $k_F=\frac{2\pi N}{L}$.}
\begin{equation}
	\Lambda(x) = \frac{1}{\sqrt L}\sum_k e^{ikx}\ {}_{0}\langle N-1| c_{k,r}|N\rangle_0
	= \frac{1}{\sqrt L} e^{i\frac{2\pi N}{L}},
\end{equation}
In this way, we get
\begin{equation}
	\psi(x)|N\rangle_{0} = \frac{\hat F}{\sqrt{L}} e^{i \frac{2 \pi \hat{N} x}{L}} \exp \left[-i\sum_{q>0} \alpha^*_q(x) b_{q}^{\dagger}\right]|N\rangle_{0}
\end{equation}
The commutation relation (\ref{eq:bs-comm-2}) also leads to:\footnote{We denote $\alpha_q(x) \equiv e^{iqx}/\sqrt{n_q}$ to simplify the notation.}
\begin{equation*}
\begin{aligned}
	\psi(x) b_{q}^{\dagger}
	&=\left[b_{q}^{\dagger}-i\alpha_{q}(x)\right] \psi(x) \\
	\Rightarrow \psi(x)\left(b_{q}^{\dagger}\right)^{n}
	&=\left[b_{q}^{\dagger}-i\alpha_{q}(x)\right]^{n} \psi(x) \\
	\Rightarrow \psi(x) f\left[\left\{b_{q}^{\dagger}\right\}\right]
	&=f\left[\left\{b_{q}^{\dagger}-i\alpha_{q}(x)\right\}\right] \psi(x).
\end{aligned}
\end{equation*}
Then, for a generic $N$-particle state:
\begin{equation}\label{eq:bs-temp1}
\begin{aligned}
	\psi(x)|N\rangle
	&=f\left[\left\{b_{q}^{\dagger}-i\alpha_{q}(x)\right\}\right] \psi(x)|N\rangle_{0} \\
	&=f\left[\left\{b_{q}^{\dagger}-i\alpha_{q}(x)\right\}\right] \frac{\hat{F}}{\sqrt{L}} e^{i \frac{2 \pi \hat{N} x}{L}} \exp \left[-i\sum_{q>0} \alpha^*_{q}(x) b_{q}^{\dagger}\right]|N\rangle_{0} \\
	&=\frac{\hat{F}}{\sqrt{L}} e^{i \frac{2 \pi \hat{N} x}{L}} \exp \left[-i\sum_{q>0} \alpha^*_{q}(x) b_{q}^{\dagger}\right] f\left[\left\{b_{q}^{\dagger}-\alpha_{q}(x)\right\}\right]|N\rangle_{0}.
\end{aligned}
\end{equation}
Using the BCH formula
\begin{equation}
	e^A B e^{-A} = e^{[A,\cdot]} B = B + [A,B] + \frac{1}{2!}[A,[A,B]]+\cdots,
\end{equation}
we have the identity:
\begin{equation*}
\begin{aligned}
	\exp \left[-i\sum_{q>0} \alpha_{q}(x) b_{q}\right] b_{q}^{\dagger} \exp \left[i\sum_{q>0} \alpha_{q}(x) b_{q}\right] &=b_{q}^{\dagger}-i\alpha_{q}(x) \\
	\Rightarrow \exp \left[-i\sum_{q>0} \alpha_{q}(x) b_{q}\right] f\left[b_{q}^{\dagger}\right] \exp \left[i\sum_{q>0} \alpha_{q}(x) b_{q}\right] &=f\left[\left\{b_{q}^{\dagger}-i\alpha_{q}(x)\right\}\right].
\end{aligned}
\end{equation*}
Eq.~(\ref{eq:bs-temp1}) can be further simplified to:
\begin{equation*}
\begin{aligned}
	\psi(x)|N\rangle
	=&\ \frac{\hat{F}}{\sqrt{L}} e^{i \frac{2 \pi \hat{N} x}{L}} e^{-i\sum_{q>0} \alpha^*_{q}(x) b_{q}^{\dagger}} e^{-i\sum_{q>0} \alpha_{q}(x) b_{q}} f\left[b_{q}^{\dagger}\right] e^{i\sum_{q>0} \alpha_{q}(x) b_{q}} |N\rangle_{0} \\
	=&\ \frac{\hat{F}}{\sqrt{L}} e^{i \frac{2 \pi \hat{N} x}{L}} \exp \left[-i\sum_{q>0} \alpha^*_{q}(x) b_{q}^{\dagger}\right] \exp \left[-i\sum_{q>0} \alpha_{q}(x) b_{q}\right]|N\rangle.
\end{aligned}
\end{equation*}
We thus express the Fermi field operator in bosonic operator:
\begin{equation}\label{eq:bs-fermi-field-1}
	\psi(x) = \frac{\hat{F}}{\sqrt{L}} e^{i \frac{2 \pi \hat{N} x}{L}} e^{-i\sqrt{2\pi}\varphi^\dagger(x)} e^{-i\sqrt{2\pi}\varphi(x)},
\end{equation}
where we have introduced a bosonic field:\footnote{The ``converging factor'' $e^{-a q / 2}$ is important in defining a proper bosonic theory in 1D. These equations should always be viewed as having $e^{-a q / 2}$ to ensure convergence at intermediate steps, but final results should be written taking $a \rightarrow 0^{+}$.}
\begin{equation}
	\varphi(x) = \frac{1}{\sqrt{2\pi}}\sum_{q>0} e^{-a q/2} a_{q}(x) b_{q}.
\end{equation}

\subsubsection*{Introduction of Bosonic Field}
Now we introducing the bosonic field:
\begin{equation}
	\phi(x) \equiv \varphi(x)+\varphi^{\dagger}(x)
	= \frac{1}{\sqrt{2\pi}} \sum_{q>0} \frac{e^{-a q/2}}{\sqrt{n_q}} \left[e^{i q x} b_{q}+e^{-i q x} b_{q}^{\dagger}\right].
\end{equation}
We can expressed the fermion field as:\footnote{We use the identity $e^A e^B = e^{A+B}e^{\frac{1}{2}[A,B]}$ if both $A$ and $B$ commutes with $[A,B]$.}
\begin{equation*}
	\psi(x) = \frac{\hat{F}}{\sqrt{L}} e^{i\frac{2\pi \hat N x}{L}} e^{-i\sqrt{2\pi}\phi(x)}
	e^{\pi[\varphi(x),\varphi^\dagger(x)]}.
\end{equation*}
The commutation relation between $\varphi$ and $\varphi^\dagger$ is
\begin{equation*}
	\left[\varphi(x),\varphi^\dagger(y)\right]
	= \frac{1}{L} \sum_q \frac{e^{iq(x-y+ia)}}{q}
	= -\frac{1}{2\pi}\ln\left\{ 1-\exp\left[\frac{2\pi i}{L}(x-y+ia)\right]\right\}.
\end{equation*}
Set $x=y$, take limit $a\rightarrow 0^+$,
\begin{equation*}
	\exp\left\{\pi[\varphi(x),\varphi^\dagger(x)] \right\} = \lim_{a\rightarrow0^+} \left[1-\exp\left(-\frac{2\pi a}{L}\right)\right]^{-\frac{1}{2}}
	\rightarrow \sqrt{\frac{L}{2\pi a}}.
\end{equation*}
so we have
\begin{equation}\label{eq:bs-fermi-field}
	\psi(x) = \frac{\hat{F}}{\sqrt{2\pi a}}e^{i\frac{2\pi\hat N x}{L}}e^{-i\sqrt{2\pi}\phi(x)}.
\end{equation}
The divergent factor $1/\sqrt{2\pi a}$ appears because Eq.~(\ref{eq:bs-fermi-field}) is not normal-ordered.
We can check the result by normal-ordering the bilinear term $\psi^\dagger(x+a)\psi(x)$.
Insert Eq.~(\ref{eq:bs-fermi-field}) into the expression, we have:
\begin{equation}
	\psi^\dagger(x+a)\psi(x)
	\simeq \frac{e^{-i\frac{2\pi\hat N a}{L}}}{2\pi a}
	e^{i\sqrt{2\pi}\partial_x\phi(x)  a}
	e^{\pi[\phi(x+ a),\phi(x)]}.
\end{equation}
The commutation relation is:
\begin{equation}
\begin{aligned}
	\left[\phi(x),\phi(y)\right]
	&= -\frac{1}{2\pi}\ln \left\{\frac{1-\exp \left[\frac{2 \pi i}{L}(x-y+i  a)\right]}{1-\exp \left[-\frac{2 \pi i}{L}(x-y-i  a)\right]}\right\} \\
	&\stackrel{ a \rightarrow 0}{\longrightarrow}
		\frac{i}{2} \operatorname{sgn}(x-y)-\frac{i}{L}(x-y).
\end{aligned}
\end{equation}
To the lowest order of $a/L$:
\begin{equation}
	\psi^\dagger(x+a)\psi(x) \simeq \frac{i}{2\pi a} + \frac{\hat N+1}{L} - \frac{1}{\sqrt{2\pi}}\partial_x\phi(x).
\end{equation}
The normal ordering will delaminate all constant, including the divergent one:
\begin{equation}
	{:\mathrel{\psi^\dagger(x+a)\psi(x)}:}
	= \frac{\hat N}{L} - \frac{1}{\sqrt{2\pi}}\partial_x\phi(x).
\end{equation}
We will show in the following the above equation agrees with the bosonization of fermion bilinear $\psi^\dagger(x)\psi(x)$ term:
\begin{equation}
\begin{aligned}
	{:\mathrel{\psi^\dagger(x)\psi(x)}:}
	&= \frac{1}{L}\sum_{q} {:\mathrel{c_{q}^\dagger c_{q}}:} + \frac{1}{L}\sum_{q>0}[e^{-iqx}\rho^\dagger_{q}+e^{iqx}\rho_{q}] \\
	&= \frac{\hat N_r}{L} - \frac{1}{2\pi} \sum_{q>0} \frac{iq}{\sqrt{n_q}} \left[e^{iqx}b_{q} - e^{-iqx}b^\dagger_{q}\right].
\end{aligned}
\end{equation}
We then get:
\begin{equation}
	{:\mathrel{\psi^\dagger(x)\psi(x)}:}
	= \frac{\hat N}{L} - \frac{1}{\sqrt{2\pi}} \partial_x \phi(x).
\end{equation}

\subsubsection*{Effective Dirac Theory}
Now we consider the case where both the right-moving and left-moving fermion branches are involved.
Note that in the previous convention, the direction of momentum for left-mover is inverted, i.e., $\psi_L(k) = \tilde\psi(-k)$ for $k \sim -k_F$.
When take the Fourier transformation back to the coordinate space,
\begin{equation}
	\int_{-k_F-\Lambda}^{-k_F+\Lambda} \frac{dk}{2\pi} \tilde\psi(k) = \psi_L(-x),
\end{equation}
which would lead to $\psi(x) = \psi_R(x)+\psi_L(-x)$.
To avoid such notational mess, we change the direction of the left-mover by defining $\psi_{\pm} = \psi_{R/L}(\pm x)$.
All the relations we have yet discussed are preserved, sometimes up to a change of coordinate: $x \rightarrow -x$, this amounts to
\begin{equation}
	\psi_{\pm}(x) = \frac{1}{\sqrt{2\pi a}}e^{\pm i\frac{2\pi\hat N_{\pm} x}{L}}e^{-i\sqrt{2\pi}\phi_{\pm}(x)}.
\end{equation}
Note that from now on, we will constantly omit the Klein factor since for the calculation of correlation function, the Klein factors will alway cancel out finally.

Furthermore, we can shift the momentum $\pm k_F$ to the origin so that the free theory becomes a Dirac theory, with $N_{\pm}=0$.
The field expansion is now
\begin{equation}
\begin{aligned}
	\psi(x) &= e^{-ik_Fx} \int_{-\Lambda}^\Lambda \frac{dk}{2\pi} e^{ikx} \psi(-k_F+k)
	+ e^{ik_Fx} \int_{-\Lambda}^\Lambda \frac{dk}{2\pi} e^{ikx} \psi(k_F+k) \\
	&= e^{+ik_F x}\psi_+(x) + e^{-ik_F x}\psi_-(x).
\end{aligned}
\end{equation}

To better work with two fermion branches, we define a new set of bosonic fields:
\begin{equation}
	\phi(x) \equiv \frac{\phi_-(x) + \phi_+(x)}{\sqrt 2}, \quad
	\theta(x) \equiv \frac{\phi_-(x) - \phi_+(x)}{\sqrt 2}.
\end{equation}
Note that we can define a new set of canonical variables from these fields.
First consider the commutation relation
\begin{equation}
	[\phi(x),\theta(y)] \stackrel{ a \rightarrow 0}{\longrightarrow}
		-\frac{i}{2} \operatorname{sgn}(x-y) + \frac{i}{L}(x-y)
\end{equation}
Define a new variable $\Pi(x) \equiv \partial_x\theta(x)$, the canonical commutation relation is:
\begin{equation}
	[\phi(x), \Pi(y)] = i \delta(x-y) - \frac{i}{L} \stackrel{L \rightarrow \infty}{\longrightarrow} i\delta(x-y).
\end{equation}
Note that the fermion fields can also be written as
\begin{equation}
	\psi_{\pm}(x) = \frac{1}{\sqrt{2\pi a}} \exp\left[-i\sqrt{\pi} \phi(x) \pm i\sqrt{\pi} \int^x_{-\infty} dy\ \Pi(y) \right].
\end{equation}

\subsection{Bosonization Dictionary}
\subsubsection{Bosonic Hamiltonian}
Now we go back to the Hamiltonian with linear dispersion (for single fermion branch):
\begin{equation}
	H_0 = v_F \sum_{k,r} k\ {:\mathrel{c_{k,r}^\dagger c_{k,r}}:}
	= v_F \int dx\ {:\mathrel{\psi^\dagger(x)(-i\partial_x)\psi(x)}:}.
\end{equation}
Since $b_q^\dagger$ raise the energy of any eigenstate of $H_0$ by $q$ unit, we have the commutation relation:
\begin{equation}
	\left[H_0,b_{q,r}^\dagger\right] = q b_{q,r}^\dagger.
\end{equation}
The Hamiltonian satisfies such relation can only be the bosonic bilinear:
\begin{equation}
	H_0 = v_F \sum_{r}\sum_{q>0} q b_{q,r}^\dagger b_{q,r} + \frac{\pi v_F}{L} \sum_r \hat{N}_r(\hat{N}_r+1).
\end{equation}
The constant part comes from the fact that
\begin{equation}
	H_0|N\rangle_0 = \frac{2\pi v_F}{L} \frac{\sum_r\hat{N}_r(\hat{N}_r+1)}{2}|N\rangle_0, \quad
	b_{q,r}^\dagger b_{q,r} |N\rangle_0 = 0.
\end{equation}
Also, the bosonic operator can also be expressed as
\begin{equation}
	H_0 = \frac{v_F}{2} \int dx\ {:\mathrel{\left[\Pi^2 + (\partial_x \phi)^2\right]}:} + \frac{\pi v_F}{L}\sum_r \hat{N}_r(\hat{N}_r+1).
\end{equation}
Now consider the density-density interaction:
\begin{equation}
	\mathcal V_{\mathrm{int}} = u \int dx\ {:\mathrel{\psi^\dagger(x)\psi(x)}:}^2
\end{equation}
The fermion density operator is
\begin{equation}
\begin{aligned}
	\psi^\dagger(x)\psi(x) =&\ \psi_-^\dagger(x)\psi_-(x) + \psi_+^\dagger(x)\psi_+(x) + \\
	&\ e^{-2ik_F x} \psi_+^\dagger(x)\psi_-(x)+e^{2ik_F x}\psi_-^\dagger(x)\psi_+(x).
\end{aligned}
\end{equation}
The oscillation term is irrelevant unless the system is half-filled.
For the system away from half-filling, the bosonized interaction is also free:
\begin{equation}
	\mathcal V_\mathrm{int} = \frac{u}{2\pi}\sum_r \int dx\ (\partial_x\phi_r)^2.
\end{equation}

The half-filling case is more subtle.
In order to be more precise, we consider the lattice Hamiltonian where the interaction is
\begin{equation}
	H_I = u \sum_j \left(n_j-\frac{1}{2}\right) \left(n_{j+1}-\frac{1}{2} \right).
\end{equation}
The bosonization procedure gives:
\begin{equation}
\begin{aligned}
	H_I =& \ u \int dx \left[: \psi_+^{\dagger}(x) \psi_+(x)+\psi_-^{\dagger}(x) \psi_-:+(-1)^{j}\left(\psi_+^{\dagger}(x) \psi_-(x)+\psi_-^{\dagger}(x) \psi_+(x)\right)\right] \\
	&\ \times\left[: \psi_+^{\dagger}(x) \psi_+(x)+\psi_-^{\dagger}(x) \psi_-(x):-(-1)^{j}\left(\psi_+^{\dagger}(x) \psi_-(x)+\psi_-^{\dagger}(x) \psi_+(x)\right)\right] \\
	=&\ u\int dx \left[\left(\frac{1}{\sqrt{\pi}} \partial_{x} \phi\right)^{2}-\left(\psi_+^{\dagger} \psi_- + \psi_-^{\dagger} \psi_+\right)^{2} \right]
		+\left\{(-1)^j\ \text{oscillations} \right\}.
\end{aligned}
\end{equation}
The oscillations can be omitted, and the second term is (we omit the Klein factors since they eventually cancel out)
\begin{equation}
	\psi_+^\dagger \psi_- + h.c.
	= \frac{1}{2\pi a} e^{i\sqrt{4\pi}\phi(x)} + h.c.
	= \frac{1}{\pi a}\cos\left[\sqrt{4\pi}\phi(x)\right].
\end{equation}
When square it, we should take note of the fact the microscopically, the square is actually
\begin{equation*}
	\frac{1}{\pi^2 a^2} \cos\left[\sqrt{4\pi}\phi(x)\right]\cos\left[\sqrt{4\pi}\phi(x+a)\right].
\end{equation*}
Using the identity
\begin{equation}
	\cos\alpha \cos\beta = \frac{\cos(\alpha+\beta)+\cos(\alpha-\beta)}{2},
\end{equation}
The square is (also note that any constant can be neglected since the final expression is normal-ordered)
\begin{equation}
	\frac{1}{2\pi^2 a^2}\left[\cos\left(\sqrt{16\pi}\phi\right)+\cos\left(\sqrt{4\pi}\partial_x\phi \right)\right]
	\simeq \frac{\cos\left[\sqrt{16\pi}\phi(x)\right]}{2\pi^2 a^2} - \frac{[\partial_x\phi(x)]^2}{\pi}.
\end{equation}
The interaction is then mapped to
\begin{equation}
	H_I = u\int dx \left\{\frac{2}{\pi}(\partial_x\phi)^2 - \frac{\cos\left[\sqrt{16\pi}\phi(x)\right]}{2\pi^2 a^2}\right\}.
\end{equation}

\subsubsection{Green's Function}
Now we calculate the free fermion field Green's function (Matsubara):
\begin{equation}
\begin{aligned}
	-G_\pm(x,\tau) &= \langle T \psi_r(x,\tau)\psi_r(0)\rangle \\
	&= \frac{1}{2\pi a} \left\langle T e^{-i\sqrt{2\pi}\phi_r(x,\tau)} e^{i\sqrt{2\pi}\phi_r(0)} \right\rangle \\
	&= \frac{1}{2\pi a} \left\langle T e^{-i\sqrt{2\pi}[\phi_r(x,\tau)-\phi_r(0)]}\right\rangle e^{-i2\pi[\phi_r(x,\tau),\phi_r(0)]} \\
	&= \frac{1}{2\pi a} e^{2\pi\langle T \phi_r(x,\tau)\phi_r(0) - \phi_r(0)\phi_r(0)\rangle},
\end{aligned}
\end{equation}
where we have used the fact that for bosonic linear terms $B$,
\begin{equation}
\begin{aligned}
	\langle e^{i\lambda B}\rangle
	&= \sum_{n=0}^{\infty} \frac{(i\lambda B)^n}{n!}
		= \sum_{n=0}^{\infty} \frac{(-\lambda^2)^n}{(2n)!} \langle B^{2n}\rangle \\
	&= \sum_{n=0}^{\infty} \frac{(-\lambda^2)^n}{(2n)!} \frac{(2n)!}{2^n n!}\langle B^{2}\rangle^n
	= e^{-\frac{1}{2}\lambda^2 \langle B^2\rangle}.
\end{aligned}
\end{equation}
The bosonic correlation is then computed as (assume $\tau>0$)
\begin{equation}
\begin{aligned}
	\langle \phi_\pm(x,\tau) \phi_\pm(0)\rangle
	&= \frac{1}{L}\sum_{q>0} \frac{e^{-aq}}{q} e^{\pm iqx - q\tau)} \\
	&= -\frac{1}{2\pi} \ln\left[1-e^{-\frac{2\pi}{L}(a \mp ix + \tau)}\right] \\
	&= \frac{1}{2\pi} \ln \frac{L/2\pi}{a \mp ix + \tau}.
\end{aligned}
\end{equation}
Furthermore,
\begin{equation}
	\langle T\phi_\pm(x,\tau) \phi_\pm(0) - \phi_\pm(0)\phi_\pm(0)\rangle
	= \frac{1}{2\pi} \ln \frac{a}{a \mp ix + \tau}.
\end{equation}
And thus the fermion correlation is
\begin{equation}
	-G_\pm(x,\tau) = \frac{1}{2\pi} \frac{1}{a \mp i x + \tau}.
\end{equation}

\subsubsection{Summery of the Results}
Here we summerize the bosonization identity we have got so far:
\begin{eqnarray}
	\phi_\pm(x) &=& \frac{1}{\sqrt{2\pi}} \sum_{q>0} \frac{e^{-a q/2}}{\sqrt{n_q}} \left[e^{\pm i q x} b_{q}+e^{\mp i q x} b_{q}^{\dagger}\right] \\
	\psi_{\pm}(x) &\sim & \frac{1}{\sqrt{2\pi a}} e^{\pm i \frac{2\pi\hat N_{\pm} x}{L}} \exp\left[-i\sqrt{2\pi}\phi_{\pm}(x)\right] \\
	\psi_{\pm}(x) &\sim & \frac{1}{\sqrt{2\pi a}} \exp\left[-i\sqrt{\pi} \phi(x) \pm i\sqrt{\pi} \int^x_{-\infty} dy\ \Pi(y) \right] \\
	\left[\phi_\pm(x), \phi_\pm(y)\right] &=& \pm\frac{i}{2} \operatorname{sgn}(x-y) \mp \frac{i}{L}(x-y) \\
	\left[\phi(x),\theta(y)\right] &=& -\frac{i}{2} \operatorname{sgn}(x-y) + \frac{i}{L}(x-y) \\
	\left[\phi(x), \Pi(y)\right] &=& i \delta(x-y) - \frac{i}{L} \\
	-i\psi^\dagger(x)\partial_x\psi(x) &=& \frac{v_F}{2} \left[\Pi^2 + (\partial_x \phi)^2\right] \\
	\psi^\dagger_\pm(x)\psi_\pm(x) &=& \frac{\hat N_\pm}{L} - \frac{\partial_x \phi_\pm}{\sqrt{2\pi}} \\
	\psi_{\pm}^\dagger(x)\psi_{\mp}(x)  &=& \frac{1}{2\pi a} e^{\pm i\sqrt{4\pi}\phi(x)}
\end{eqnarray}

\section{Sine-Gordon Model}

\subsection{Effective Theory for Half-filling}
In this section we consider the 1D half-filling interacting system.
Base on the bosonization dictionary we constructed, the bosonic Hamiltonian is
\begin{equation}
	H = \int \frac{dx}{K} \left\{ \frac{1}{2}\left[K \Pi^2 + \frac{1}{K}(\partial_x\phi)^2 \right] + \frac{y}{2\pi^2 a^2} \cos\left[\sqrt{16\pi}\phi\right] \right\},
\end{equation}
where
\begin{equation}
	K = \frac{1}{\sqrt{1+4u/\pi}}, \quad
	y = \frac{u}{\sqrt{1+4u/\pi}}.
\end{equation}
We can shift the variables as:
\begin{equation}
	\Pi \rightarrow \frac{\Pi}{\sqrt K}, \quad
	\phi \rightarrow \sqrt K \phi,
\end{equation}
(note that the canonical commutation relation is preserved in this way) and the Hamiltonian becomes
\begin{equation}
	H = \int \frac{dx}{K} \left\{ \frac{1}{2}\left[\Pi^2 + (\partial_x\phi)^2 \right] + \frac{y}{2\pi^2 a^2} \cos\left[\sqrt{16\pi K}\phi\right] \right\}.
\end{equation}
Omit the constant factor, and the Euclidean Lagrangian is
\begin{equation}
	\mathcal L = \frac{1}{2}(\nabla \phi)^2 + \frac{y}{2\pi^2 a^2} \cos\left[\sqrt{16\pi K}\phi\right]
	\equiv \frac{1}{2}(\nabla \phi)^2 + \frac{y}{2\pi^2 a^2} \cos\left[\beta\phi\right].
\end{equation}

\subsection{RG Analysis}
When write $\phi$ as the sum of slow and fast modes, the partition function is
\begin{equation}
	Z = \int D\phi_s e^{-\frac{1}{2}\int d^2x (\nabla\phi_s)^2}
	\left\langle\exp\left\{-\frac{y}{2\pi^2 a^2} \int d^2 x \cos\left[\beta(\phi_s+\phi_f)\right] \right\}\right\rangle_f
\end{equation}
Under the rescaling $x \rightarrow x' = e^{dt} x$, $\phi(x) \rightarrow \phi'(x') = \phi(x')$, the free field action is invariant.
The effective action can be perturbatively evaluated as
\begin{equation}
	S_{\mathrm{eff}} = S_0 + \langle S_1\rangle_f - \frac{1}{2}(\langle S_1^2\rangle_f - \langle S_1\rangle_f^2) + \text{higher orders}.
\end{equation}
To the first order,
\begin{equation}
\begin{aligned}
	\langle S_1\rangle &= \frac{y}{2\pi^2 a^2} \int d^2 x \left\langle\cos\left[\beta(\phi_s+\phi_f)\right] \right\rangle_f \\
	&= -\frac{y}{2\pi^2 a^2} \int d^2 x \cos(\beta\phi_s)\langle\cos(\beta\phi_f)\rangle_f,
\end{aligned}
\end{equation}
where we have use the identity
\begin{equation}
	\cos\left[\beta(\phi_s)\right]
	= \cos(\beta\phi_s)\cos(\beta\phi_f)-\sin(\beta\phi_s)\sin(\beta\phi_f)
\end{equation}
and note the fact that $\sin(\beta\phi_f)$ term will not contribute when integrated over the fast field.
Also, note of the fact that
\begin{equation}
	\langle e^{i\beta\phi}\rangle = e^{-\frac{1}{2}\beta^2 \langle\phi^2\rangle}.
\end{equation}
We then compute the expectation
\begin{equation}
\begin{aligned}
	\left\langle \cos(\beta\phi)\right\rangle_f
	&= \left\langle \frac{e^{i\beta\phi} + e^{-i\beta\phi}}{2}\right\rangle_f
	= e^{-\frac{1}{2}\beta^2\langle\phi^2\rangle} \\
	&= \exp\left[-\frac{\beta^2}{2}\int^\Lambda_{\Lambda(1-dt)}\frac{k dk}{2\pi} \frac{1}{k^2} \right] \\
	&= 1-\frac{\beta^2}{4\pi\Lambda}dt.
\end{aligned}
\end{equation}
In this way, the rescaling is
\begin{equation}
	y \rightarrow e^{2dt}\left(1-\frac{\beta^2}{4\pi\Lambda}dt\right) y.
\end{equation}
In the cut-off unit where $\Lambda$ is set to $1$, the beta function is
\begin{equation}
	\frac{dy}{dt} = (2-4K) y = 4\left[\frac{1}{2}-\left(1-\frac{4u}{\pi}\right)^{-\frac{1}{2}}\right]y.
\end{equation}
Setting $x\equiv 2-4K$, the first order RG equation is
\begin{equation}
	\frac{dy}{dt} = xy.
\end{equation}

Now consider the second-order expansion
\begin{equation}
\begin{aligned}
	\delta S^{(2)}
	=&\ \frac{y^2}{4\pi^4 a^4} \int d^2 x_1 d^2 x_2 \left\{ \left\langle \cos\left[\beta\phi_s(x_1)+\beta\phi_f(x_1)\right] \cos\left[\beta\phi_s(x_2)+\beta\phi_f(x_2)\right] \right\rangle_f \right. \\
	&\ \left. -\left\langle \cos\left[\beta\phi_s(x_1)+\beta\phi_f(x_1)\right]\right\rangle_f \left\langle \cos\left[\beta\phi_s(x_2)+\beta\phi_f(x_2)\right]\right\rangle_f \right\}
\end{aligned}
\end{equation}
The first term is
\begin{equation}
\begin{aligned}
	&\  \cos\left[\beta\phi_s(x_1)+\beta\phi_f(x_1)\right]
		\cos\left[\beta\phi_s(x_2)+\beta\phi_f(x_2)\right] \\
	=&\ \frac{1}{2}\cos\left[\beta\phi(x_1)+\beta\phi(x_2)\right] +
	  \frac{1}{2}\cos\left[\beta\phi(x_1)-\beta\phi(x_2)\right] \\
	=&\ \frac{1}{2}\cos\left[\beta\phi_s(x_1)+\beta\phi_s(x_2)\right] \cos\left[\beta\phi_f(x_1)+\beta\phi_f(x_2)\right] + \\
	&\ \frac{1}{2}\cos\left[\beta\phi_s(x_1)-\beta\phi_s(x_2)\right] \cos\left[\beta\phi_f(x_1)-\beta\phi_f(x_2)\right] + \text{sin terms}.
\end{aligned}
\end{equation}
Similarly, we neglect all $\sin(\beta\phi_f)$ terms.
The averaging gives:
\begin{equation}
\begin{aligned}
	&\  \left\langle\cos\left[\beta\phi_s(x_1)+\beta\phi_f(x_1)\right]
		\cos\left[\beta\phi_s(x_2)+\beta\phi_f(x_2)\right]\right\rangle_f \\
	=&\ \frac{1}{2} e^{-\frac{\beta^2}{2}\langle[\phi_f(x_1)+\phi_f(x_2)]^2\rangle} \cos[\beta\phi_s(x_1)+\beta\phi_s(x_2)] + \\
	&\  \frac{1}{2} e^{-\frac{\beta^2}{2}\langle[\phi_f(x_1)-\phi_f(x_2)]^2\rangle} \cos[\beta\phi_s(x_1)-\beta\phi_s(x_2)].
\end{aligned}
\end{equation}
For the second term,
\begin{equation}
\begin{aligned}
	&\ \left\langle \cos\left[\beta\phi_s(x_1)+\beta\phi_f(x_1)\right]\right\rangle_f \left\langle \cos\left[\beta\phi_s(x_2)+\beta\phi_f(x_2)\right]\right\rangle_f \\
	=&\ \cos[\beta\phi_s(x_1)]\cos[\beta\phi_s(x_2)] e^{-\frac{\beta^2}{2}\langle\phi_f^2(x_1)+\phi_f^2(x_2)\rangle} \\
	=&\ \frac{1}{2}e^{-\beta_f^2 \langle \phi^2\rangle} \left\{ \cos[\beta\phi_s(x_1)+\beta\phi_s(x_2)] + \cos[\beta\phi_s(x_1)-\beta\phi_s(x_2)] \right\}
\end{aligned}
\end{equation}
The subtraction is
\begin{equation}
\begin{aligned}
	& e^{-\beta^2\langle\phi_f^2\rangle} \left\{
		\left(e^{-\beta^2 \langle\phi_f(x_1)\phi_f(x_2)\rangle}-1 \right)\cos\left[\beta\phi_s(x_1) +\beta\phi_f(x_2)\right] \right. \\
	& + \left. \left(e^{\beta^2 \langle\phi_f(x_1)\phi_f(x_2)\rangle}-1 \right)\cos\left[\beta\phi_s(x_1) -\beta\phi_f(x_2)\right] \right\}
\end{aligned}
\end{equation}
Consider the bosonic correlation
\begin{equation}
	\mathcal G(\bm x) \equiv \langle \phi_f(x) \phi_f(0)\rangle_f = F(\bm x) dt + O(dt^2).
\end{equation}
A straightforward calculation with the hard cut-off yields $F(\bm x)$ a Bessel function with long oscillating tail.
However, it can be shown that implementing a smooth cut-off will make $F(\bm x)$ short ranged.
For this reason, we can switch to the center-of-mass coordinate:
\begin{equation}
	\bm R = \frac{\bm x_1 + \bm x_2}{2}, \quad \bm r = \bm x_1 - \bm x_2.
\end{equation}
In this way, the term $\cos\left[\beta\phi_s(x_1) +\beta\phi_f(x_2)\right]$ is approximated by a $\cos\left[2\beta\phi_s(x)\right]$ term, which is oscillating at double frequency, and thus is regarded as irrelevant.

The remaining term can be simplified by the approximation:
\begin{equation}
	\cos\left[\beta\phi_s(x_1) -\beta\phi_f(x_2)\right]
	\sim 1-\frac{\beta^2}{2} [\bm r \cdot \nabla\phi_s(\bm R)]^2
\end{equation}
The constant term only contributes to the the infinity of free energy.
The non-trivial contribution is:
\begin{equation}
\begin{aligned}
	&\ \int d^2 R \int d^2 r \left(e^{\beta^2 \langle\phi_f(x_1)\phi_f(x_2)\rangle}-1 \right)\cos\left[\beta\phi_s(x_1) -\beta\phi_f(x_2)\right] \\
	\simeq &\ -\frac{\beta^4}{2} \int d^2 R \int d^2r F(\bm r) [\bm r \cdot \nabla\phi_s(\bm R)]^2
\end{aligned}
\end{equation}
Note that
\begin{equation}
	\int d^2r\ r_i r_j = \delta_{ij} \int r dr d\theta\ r^2 \cos^2(\theta) = \pi \delta_{ij} \int dr\ r^3,
\end{equation}
and the above expression can be formulated as:
\begin{equation}
\begin{aligned}
	&\ \int d^2 R \int d^2 r \left(e^{\beta^2 \langle\phi_f(x_1)\phi_f(x_2)\rangle}-1 \right)\cos\left[\beta\phi_s(x_1) -\beta\phi_f(x_2)\right] \\
	\simeq &\ -\frac{\pi \beta^4}{2} \left[\int_0^\infty dr\ r^3 F(r)\right] \int d^2 R [\nabla\phi_s(\bm R)]^2 \\
	\equiv &\ -\pi \beta^4 A \times \frac{1}{2}\int d^2 R [\nabla\phi(\bm R)]^2
\end{aligned}
\end{equation}
We see the second order perturbation renormalize the free field, as it change normalization of the field:
\begin{equation}
	\phi \rightarrow \phi' = Z^{\frac{1}{2}} \phi, \quad
	Z^{\frac{1}{2}} = 1 +\frac{1}{2} \pi \beta^4 A \left( \frac{y}{2\pi^2 a^2} \right)^2.
\end{equation}
To preserve the form of the $\cos\beta\phi$ term, we have to shift
\begin{equation}
	d\beta = Z^{-\frac{1}{2}}\beta - \beta = -\frac{\beta^5 A}{8 \pi^3 a^4} y^2 dt
\end{equation}
The RG equation to the second order is then
\begin{equation}
	\frac{dx}{dt} = \frac{d}{dt}\left(2-\frac{\beta^2}{4\pi}\right)
	= \frac{\beta^6 A}{16\pi^4 a^4} y^2.
\end{equation}
The $\beta = \sqrt{4\pi(2-x)}$ is dependent on $x$.
While near the fixed point $x=y=0$, $\beta \simeq \sqrt{8\pi}$, the RG equation is then
\begin{equation}
\begin{aligned}
	\frac{dy}{dt} &= xy, \\
	\frac{dx}{dt} &= \frac{32 A}{\pi a^4} y^2.
\end{aligned}
\end{equation}
Setting $c^2 = 32A/\pi a^4$, we note that the differential relation implies
\begin{equation}
	d(x^2- c^2 y^2) = 0,
\end{equation}
i.e., the flow is along the hyperbolas, with marginal line described by $x = \pm cy$.
The RG-flow is shown in Fig.~\ref{fig:FL-RG-flow}.

\begin{figure}
	\centering
	\includegraphics[width=0.5\linewidth]{pics/LL-RG-flow}
	\caption{KT RG-flow.}
	\label{fig:FL-RG-flow}
\end{figure}

We see that there are three regimes of the RG flow: in the weak interacting regime, the field theory flows to the Tomonaga-Luttinger (TL) line; for strong interaction, depending on the sign of $y$, the systems develop two charge-density-wave (CDW) order, namely the Neel-CDW and Peierls-CDW.

\subsection{Phase Diagram}

\subsubsection{Tomonaga-Luttinger Liquid}
When $K<\frac{1}{2}$, the interacting cosine term become irrelevant.
In this case, the system is in a liquid state, called the \textit{Tomonaga-Luttinger liquid}.
The system on the TL line is described by the non-interacting Hamiltonian:
\begin{equation}
	H = \int \frac{dx}{K} \frac{1}{2}\left[K \Pi^2 + \frac{1}{K}(\partial_x\phi)^2 \right],
\end{equation}
As discussed, we can define a new set of variables to map the Hamiltonian to that of the original bosonic model:
\begin{equation}
\begin{aligned}
	\phi' &= \frac{\phi'_-+\phi'_+}{\sqrt 2} = \frac{\phi}{\sqrt{K}} = \frac{\phi_-+\phi_+}{\sqrt{2K}} \\
	\theta' &= \frac{\phi'_--\phi'_+}{\sqrt 2} = \sqrt{K} \theta = \sqrt{\frac{K}{2}}(\phi_--\phi_+).
\end{aligned}
\end{equation}
The fermion mode is
\begin{equation}
\begin{aligned}
	\psi_{\pm}(x) &= \frac{1}{\sqrt{2\pi a}} \exp\left[-i\sqrt{2\pi} \phi'_{\pm}(x) \right] \\
	&= \frac{1}{\sqrt{2\pi a}} \exp\left\{-i\sqrt{2\pi} \left[K_\pm \phi_+(x)+ K_\mp \phi_-(x) \right]\right\},
\end{aligned}
\end{equation}
where
\begin{equation}
	K_\pm \equiv \frac{K^{\frac{1}{2}} \pm K^{-\frac{1}{2}}}{2}.
\end{equation}
The Greens function is (assume $\tau>0$):
\begin{equation}
	-G_{\pm}(x,\tau)
	= \frac{1}{2\pi a} e^{2\pi \langle \phi'_\pm(x,\tau)\phi'_\pm(0) - \phi'_\pm(0)\phi'_\pm(0) \rangle}
\end{equation}
The bosonic correlation is
\begin{equation}
\begin{aligned}
	\langle \phi'_\pm(x,\tau)\phi'_\pm(0) \rangle
	&= K_\pm^2 \langle \phi_+(x,\tau)\phi_+(0)\rangle + K_\mp^2 \langle\phi_-(x,\tau)\phi_-(0)\rangle \\
	&= \frac{K_\pm^2}{2\pi}\ln \frac{L/2\pi}{a-ix+\tau} + \frac{K_\mp^2}{2\pi}\ln \frac{L/2\pi}{a+ix +\tau}
\end{aligned}
\end{equation}
So that
\begin{equation}
\begin{aligned}
	-G_{\pm}(x,\tau)
	&= \frac{1}{2\pi a} \left[\frac{a}{a + \tau - ix}\right]^{K_\pm^2} \left[\frac{a}{a + \tau + i x}\right]^{K_\mp^2} \\
	&= \frac{1}{2\pi} \frac{1}{a + \tau \mp ix} \left[\frac{a^2}{a^2+x^2+\tau^2}\right]^{K_-^2}
\end{aligned}
\end{equation}
Note that when $K=0$, $K_-=0$, and the theory agrees with the free fermion prediction:
\begin{equation}
	-G(x, 0^+) = \frac{1}{2\pi} \frac{1}{a-ix}
	= \int \frac{dk}{2\pi} e^{ikx-ak} \theta(k)
\end{equation}
However, when $K_- \ne 0$, the additional factor will smear the pole to a brach cut.
To see this, note that from the dimensional analysis, the Green's function is of anomalous dimension $-K_-^2$.
In the momentum space, this means that the Green's function scales as
\begin{equation}
	G(k,\omega) \sim (k,\omega)^{K_-^2}.
\end{equation}
This implies that the density
\begin{equation}
	n(k) = n_0 + c k^{K_-^2}.
\end{equation}

\subsubsection{Charge Density Wave Order}
We first consider the case where $y>0$ is sufficiently large.
Consider
\begin{equation}
	\cos\left[\sqrt{16\pi}\phi(x)\right] = \frac{1}{2} - \sin^2\left[\sqrt{4\pi}\phi(x)\right].
\end{equation}
The energy is minimized if
\begin{equation}
	\sin\left[\sqrt{4\pi}\phi(x)\right] = \pm 1.
\end{equation}
Note that in our bosonization dictionary,
\begin{equation}
	\psi_{\pm}^\dagger(x)\psi_{\mp}(x) = \frac{1}{2\pi a} e^{\pm i\sqrt{4\pi}\phi(x)},
\end{equation}
so that
\begin{equation}
	\frac{i}{\pi a} \sin\left[\sqrt{4\pi}\phi(x)\right] = \psi_{+}^\dagger(x)\psi_{-}(x)-\psi_{-}^\dagger(x)\psi_{+}(x).
\end{equation}
We know for the Neel-CDW phase, the order parameter is
\begin{equation}
	i\left\langle \psi_{+}^\dagger(x)\psi_{-}(x)-\psi_{-}^\dagger(x)\psi_{+}(x) \right\rangle.
\end{equation}

On the other hand, for $y<0$, consider
\begin{equation}
	\cos\left[\sqrt{16\pi}\phi(x)\right] = -\frac{1}{2} + \cos^2\left[\sqrt{4\pi}\phi(x)\right].
\end{equation}
The energy is minimized if
\begin{equation}
	\cos\left[\sqrt{4\pi}\phi(x)\right] = \pm 1.
\end{equation}

\subsection{One-dimensional Hubbard Model}
Now we consider the fermion with spin.
The Hubbard model has a non-interacting part,
\begin{equation}
	H_{0}=-\frac{1}{2} \sum_{s, n}\left[\psi_{s}^{\dagger}(n) \psi_{s}(n+1)+\text { h.c. }\right]+\mu \sum_{s, n} \psi_{s}^{\dagger}(n) \psi_{s}(n),
\end{equation}
where $s=\uparrow, \downarrow$ are two possible spin orientations. We do not assume $k_F = \frac{\pi}{2}$ at this point, and use a general chemical potential $\mu$.
Following the usual route, we get two copies of the spinless model:
\begin{equation}
	H_{0}=\sum_{s} \int \frac{d k}{2 \pi} (\mu-\cos k) \psi_{s}^{\dagger}(k) \psi_{s}(k),
\end{equation}
and the continuum version:
\begin{equation}
\begin{aligned}
	H_0 &= v_F \sum_{s} \int d x \left[
		\psi_{s+}^{\dagger}(x)\left(-i \partial_{x}\right) \psi_{s+}(x) +
		\psi_{s-}^{\dagger}(x)\left( i \partial_{x}\right) \psi_{s-}(x)
	\right] \\
	&= \frac{v_F}{2} \sum_s \int d x \left[\Pi_{s}^{2}+\left(\partial_x \phi_{s}\right)^{2}\right].
\end{aligned}
\end{equation}
Let us now turn on the Hubbard interaction,
\begin{equation}
	H_{\mathrm{int}}=U \sum_{n} \psi_{\uparrow}^{\dagger}(n) \psi_{\uparrow}(n) \psi_{\downarrow}^{\dagger}(n) \psi_{\downarrow}(n),
\end{equation}
where $\psi_{\uparrow}, \psi_{\downarrow}$ stand for the original non-relativistic fermion.
The Hubbard interaction is just the extreme short-range version of the screened Coulomb potential between fermions.
Due to the Pauli principle, only opposite-spin electrons can occupy the same site.

Let us now express this interaction in terms of the Dirac fields:
\begin{equation}
	\psi_{\uparrow}^{\dagger}  \psi_{\uparrow} \psi_{\downarrow}^{\dagger} \psi_{\downarrow}
	= \left[\psi_{\uparrow+}^{\dagger} \psi_{\uparrow+}+\psi_{\uparrow-}^{\dagger} \psi_{\uparrow-}+
	\left(\psi_{\uparrow+}^{\dagger} \psi_{\uparrow-} e^{-2 i K_{\mathrm{F}} n}+\text{h.c.}\right)\right]
	\times(\uparrow \rightarrow \downarrow).
\end{equation}
If we expand out the products and keep only the parts with no rapidly oscillating factors, we will, for generic $k_F$, get the following terms:
\begin{equation}
	H_{\mathrm{int}} = U\left(j_{0 \uparrow} j_{0 \downarrow}\right) + U\sum_n \left(\psi_{\uparrow+}^{\dagger}(n) \psi_{\uparrow-}(n) \psi_{\downarrow-}^{\dagger}(n) \psi_{\downarrow+}(n)+\text{h.c.}\right),
\end{equation}
where
\begin{equation}
	U\left(j_{0 \uparrow} j_{0 \downarrow}\right)
	= \sum_n \left(\psi_{\uparrow+}^{\dagger} \psi_{\uparrow+}+\psi_{\uparrow-}^{\dagger} \psi_{\uparrow-}\right)\left(\psi_{\downarrow+}^{\dagger} \psi_{\downarrow+}+\psi_{\downarrow-}^{\dagger} \psi_{\downarrow-}\right)
\end{equation}
If we now bosonize these terms as per the dictionary, we get, in the continuum,
\begin{equation}
	H_{\mathrm{int}} = U\left[\frac{\partial_x \phi_{\uparrow} \partial_x \phi_{\downarrow}}{\pi}+\frac{1}{2\pi^{2} \alpha^{2}} \cos \sqrt{4 \pi}\left(\phi_{\uparrow}-\phi_{\downarrow}\right)\right]
\end{equation}
We can now separate the theory into two parts by introducing charge and spin fields $\phi_{c}$ and $\phi_{s}$:
\begin{equation}
	\phi_{c/s}=\frac{\phi_{\uparrow} \pm \phi_{\downarrow}}{\sqrt{2}}.
\end{equation}
The parametrization bring the first term in the interaction to a free theory:
\begin{equation}
\begin{aligned}
	\partial_x \phi_{\uparrow} \partial_x \phi_{\downarrow}
	&= \frac{1}{2} \partial_x (\phi_{c}+\phi_s) \partial_x (\phi_c-\phi_s) \\
	&= \frac{1}{2} \left[(\partial_x \phi_c)^2 + (\partial_x \phi_s)^2\right].
\end{aligned}
\end{equation}
The Hamiltonian then become decoupled:
\begin{equation}
	H =H_{c}+H_{s},
\end{equation}
where the charge and spin part of the Hamiltonian are:
\begin{equation}
\begin{aligned}
	H_{c} &=\int \frac{dx}{2 K_c}\left[K_{c} \Pi_{c}^{2}+\frac{1}{K_{c}}\left(\partial \phi_{c}\right)^{2}\right], \\
	H_{s} &=\int \frac{dx}{2 K_s} \left[K_{s} \Pi_{s}^{2}+\frac{1}{K_{s}}\left(\partial \phi_{s}\right)^{2}+\frac{U}{2 \pi^{2} \alpha^{2}} \cos \sqrt{8 \pi} \phi_{s}\right],
\end{aligned}
\end{equation}
where
\begin{equation}
	K_{c / s} =\frac{1}{\sqrt{1 \pm \frac{U}{\pi}}}.
\end{equation}
The fact that $K_{s} \neq K_{c}$ means that charge and spin move at different velocities.
This \textit{spin-charge separation} cannot be understood in terms of interacting electrons whose charge and spin would be irrevocably bound.
This is more evidence of the demise of the quasiparticle, adiabatically connected to the primordial fermion.


% \documentclass{article}

% \usepackage{listings}
% \usepackage{color}

\section*{Appendix B}
\subsection*{Source Code of Dragon Hunting Algorithm}

\lstset{ % General setup for the package
	language=Python,
	basicstyle=\small\sffamily,
	numbers=left,
 	numberstyle=\tiny,
	frame=tb,
	tabsize=4,
	columns=fixed,
	showstringspaces=false,
	showtabs=false,
	keepspaces,
	commentstyle=\color{red},
	keywordstyle=\color{blue},
  breaklines=true,
  postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space},
}

% \begin{document}
\begin{lstlisting}
	# Name: Dragon Hunting Algorithm
	# Author: Team 1911426 at MCM contest
	# Time: 2019.1.28

	# ### Important ###
	# Units for functions parameters and global variables standard:
	# kg for weight, calories for energy, km for area,  days for time

	import numpy as np

	# ##### Begin Global variables #####
	# Species names
	SPECIES_NAME = [
			['Cattle', 'Sheep', 'Hare'],
			['D', 'E', 'F'],
			['G', 'H', 'J'],
	]
	# MASS of species in kg
	MASS = [
			[753, 87.5, 3.94625],
			[0, 0, 0],
			[0, 0, 0]
	]
	# DENSITY of species in /km^2
	DENSITY = [
			[3.4130, 9.4514, 0],
			[0, 0, 0],
			[0, 0, 0]
	]
	# ENERGY of species per MASS in calorie/kg
	ENERGY_PER_MASS = [
			[1250000, 1180000, 1020000],
			[0, 0, 0],
			[0, 0, 0]
	]
	# Heat capacity of the meat of the species in calories/(kg * Celsius)
	HEAT_CAPACITY = [
			[351.33843212, 358.50860421, 389.5793499],
			[0, 0, 0],
			[0, 0, 0]
	]

	# The side length of the square area
	SIDE_LENGTH = 10.0
	# The area of the square area
	AREA = SIDE_LENGTH ** 2

	# Times of hunting
	HUNTIMG_TIMES = 0

	# Number of species
	NUM_OF_SPECIES_PER_SPECIES = np.array(AREA * np.array(DENSITY), dtype=int)
	NUM_OF_SPECIES = np.sum(NUM_OF_SPECIES_PER_SPECIES)

	# Species used in our
	COW = SPECIES_NAME[0][0]
	SHEEP = SPECIES_NAME[0][1]
	# # Comment it out if you want to add more species
	# HARE = SPECIES_NAME[0][2]

	# Time period of dragon hunting
	DAYS = 2

	# The dragon's initial position in the area
	DRAGON_POS = np.array([
			[0],
			[0]
	])
	# Not reachable area's position
	NOT_REACHABLE = np.inf

	# Net energy percentage
	NET_ENERGY_PERCENTAGE = 0.57
	# eta, see the paper
	ETA = 0.7
	# ##### End Global variables #####

	# ##### Begin Helper functions #####
	def get_mu_and_weight_at(age):
			"""
			Get mu and weight at `age` using calculated S curve function.
			"""
			mu_m = 2523.8311119211758
			lam = 19.76261573148329
			v = - 1/3
			A = 281.6 * 1000

			from sympy import symbols, exp

			t = symbols('t')

			temp1 = (mu_m / A) * ((1+v) ** (1 + 1/v)) * (lam - t)
			temp2 = exp(temp1)
			temp3 = v * exp(1 + v) * temp2
			temp4 = A * (1 + temp3)**(-1/v)

			y = temp4
			y_derivative = y.diff(t)

			return (y_derivative.subs(t, age), y.subs(t, age))

	def find_nearest(array, value):
			"""
			Find the nearest element to `value`, return its index in `array`.
			"""
			array = np.asarray(array)
			new_array = array - value
			norm_array = np.empty(len(new_array[0]))
			for i in range(len(new_array[0])):
					norm_array[i] = new_array[0][i] ** 2 + new_array[1][i] ** 2
			idx = norm_array.argmin()
			return idx

	def get_basic_metabolish_energy(weight):
			"""
			Calculate E_m.
			"""
			m_d = weight
			V_E = 2.25
			period = DAYS * 24
			V_O2 = m_d * V_E * period
			density_o2 = 1.429
			m_O2 = V_O2 * density_o2
			M_O2 = 32
			n_O2 = m_O2 / M_O2
			n_glucuse = n_O2 / 6
			energy = 277485.66 * n_glucuse
			return energy
	def get_growth_energy(mu):
			"""
			Calculate E_g.
			"""
			period = DAYS * 24
			dmd = mu / 365 / 24 * period
			rho_m = 1.12
			rho_b = 1.23
			r_b = 4
			r_m = 5
			coefficient_1 = rho_m + rho_b * (r_b ** 2) / (r_m ** 2)
			coefficient_2 = (r_b ** 2) / (r_b ** 2 + r_m ** 2)
			dS = dmd / coefficient_1 / coefficient_2

			E_p = 17130 * 1000 / 4.184
			E_b = 0.1 * E_p
			coefficient_3 = rho_m * (r_m ** 2) / (r_b ** 2 + r_m ** 2) * E_p
			coefficient_4 = rho_b * coefficient_2 * E_b
			E_g = (coefficient_3 + coefficient_4) * dS
			return E_g
	def get_fly_energy(weight, distance):
			"""
			Calculate E_f.
			"""
			m_d = weight
			# v_d is in m/s
			v_d = 5.70 * (m_d ** 0.16)
			# convert to m
			L_d = distance * 1000
			# convert to hours
			temp_time = L_d / v_d / 60 / 60
			E_v = 300 / 4.184
			E_f = m_d * E_v * temp_time
			return E_f
	def get_fire_energy(weight, x, y):
			"""
			Calculate E_b.
			"""
			c_p = HEAT_CAPACITY[x][y]
			m_p = MASS[x][y]
			constant = 5
			delta_T = 80 - 25
			return c_p * m_p * constant * delta_T

	def get_reproduction_res(index, now, period):
			"""
			Index: 0-cattle,1-sheep,2-hare
			period: in days
			"""
			per_day_animal = np.array([0.5, 4, 6]) / 365

			return int(now + now * per_day_animal[index] * period)

	def get_pos(idx):
			accr = np.cumsum(NUM_OF_SPECIES_PER_SPECIES)
			# Calculate species class from index in `total` (all the species)
			index1 = 0
			for i in range(len(accr)):
					if idx < accr[i]:
							index1 = i
							break
			x = index1 // 3
			y = index1 % 3
			return (x, y)
	# ##### End Helper functions #####

	def hunting_at_age(age):
			"""
			Main entraince of Dragon hunting algorithm.
			"""
			global HUNTIMG_TIMES
			print(f'############### Hunting times: {HUNTIMG_TIMES} at age {age} ###############')
			HUNTIMG_TIMES += 1

			(mu, weight) = get_mu_and_weight_at(age)

			# Regenerate animals
			global NUM_OF_SPECIES_PER_SPECIES
			cow = np.random.rand(2, NUM_OF_SPECIES_PER_SPECIES[0][0]) * SIDE_LENGTH
			sheep = np.random.rand(2, NUM_OF_SPECIES_PER_SPECIES[0][1]) * SIDE_LENGTH
			# # Comment it out if you want to add more species
			# hare = np.random.rand(2, NUM_OF_SPECIES_PER_SPECIES[0][2]) * SIDE_LENGTH

			# Recovery dragon hunting animals
			total = np.append(cow, sheep, axis=1)
			# # Comment it out if you want to add more species
			# total = np.append(
			#     np.append(cow, sheep, axis=1),
			#     hare,
			#     axis=1
			# )

			# Generate dragon
			dragon_pos = DRAGON_POS

			energy_got = 0
			base_consumption = get_basic_metabolish_energy(weight)
			print('Base consumption:', base_consumption)
			growth_consumption = get_growth_energy(mu)
			print('Growth consumption:', growth_consumption)
			hurt_consumption = 0.1 * base_consumption
			print('Hurt consumption:', hurt_consumption)
			fly_consumption = 0
			fire_cos = 0
			energy_consumed = base_consumption + growth_consumption + hurt_consumption

			# Begin iteration
			iter_times = 0
			hunted_number = 0
			hunted_each = np.array([
					[0, 0, 0],
					[0, 0, 0],
					[0, 0, 0]
			])
			global NUM_OF_SPECIES
			while hunted_number < NUM_OF_SPECIES:
					iter_times += 1
					print('=======================')
					print(f'Iteration: {iter_times}')

					idx = find_nearest(total, dragon_pos)
					(x, y) = get_pos(idx)

					# ######### Begin hunting ##########
					hunted_number += 1
					hunted_each[x][y] += 1

					energy_got += ENERGY_PER_MASS[x][y] * MASS[x][y]

					temp_fire_energy = get_fire_energy(weight, x, y)
					fire_cos += temp_fire_energy
					energy_consumed += temp_fire_energy
					temp_fly_energy = get_fly_energy(
							weight, np.linalg.norm(dragon_pos-np.array([total[:,idx]]).T))
					fly_consumption += temp_fly_energy
					energy_consumed += temp_fly_energy

					print('Delta Energy this round: ',
								ENERGY_PER_MASS[x][y] * MASS[x][y] - temp_fire_energy - temp_fly_energy)

					print(f'Nearest point {SPECIES_NAME[x][y]} at ({total[0][idx]}, {total[1][idx]}) hunted')
					dragon_pos = np.array([total[:, idx]]).T
					total[0][idx] = total[1][idx] = NOT_REACHABLE
					# ######### End hunting ##########

					if energy_got * NET_ENERGY_PERCENTAGE * ETA >= energy_consumed:
							print('Success got all energy')
							print('Animals before:\n', NUM_OF_SPECIES_PER_SPECIES)
							print('Animals hunted:\n', hunted_each)
							NUM_OF_SPECIES_PER_SPECIES -= hunted_each
							print('Animals left:\n', NUM_OF_SPECIES_PER_SPECIES)
							# Breeding Animals
							for i in range(3):
									NUM_OF_SPECIES_PER_SPECIES[0][i] = get_reproduction_res(i, NUM_OF_SPECIES_PER_SPECIES[0][i], DAYS)
							print('Animals after reproduction:\n', NUM_OF_SPECIES_PER_SPECIES)
							NUM_OF_SPECIES = np.sum(NUM_OF_SPECIES_PER_SPECIES)

					else:
							print('energy_got * NET_ENERGY_PERCENTAGE * ETA', energy_got * NET_ENERGY_PERCENTAGE * ETA)
							print('energy_consumed:', energy_consumed)
							print('Still need these calories of energy:', energy_consumed - energy_got * NET_ENERGY_PERCENTAGE * ETA)
							print('Energy got:', energy_got)
							print('Fire energy need:', temp_fire_energy)
							print('Fly energy need:', temp_fly_energy)

			print(hunted_each)
			print('################################################################')
			return hunted_each

	if __name__ == "__main__":
			hunting_at_age(100)
\end{lstlisting}

% \end{document}


\clearpage
\subsection{Assignment Statement (with Arrays)} % (fold)
\label{sub:assignment_statement_with_arrays_}

The assignment statement allows you to store a value in a variable. This can now be extended to allow you to store a value in an element of an array. To achieve this you indicate the array you want to store the value in, as well as the index at which the value is to be stored.

\begin{figure}[h]
   \centering
   \includegraphics[width=\textwidth]{./topics/arrays/diagrams/AssignmentWithArray}
   \caption{Arrays allow you to store multiple values in a variable}
   \label{fig:assignment-with-arrays}
\end{figure}

\mynote{
\begin{itemize}
  \item The assignment statement is an \textbf{action}, storing a value in a variable or array.
  \item When working with arrays you specify the array, and index at which to store the value.
  \item This stores a value into an element of an array.
  \item The two snippets below indicate how this is coded in C and Pascal. In each case \texttt{data} is the name of the array variable, and 1 is the index of the second element. The code in the snippet stores a 255 in the second element of the array.
\end{itemize}
}

\csection{In C you can achieve this using: \csnipet{data[1] =  127.5 * 2;}. }

\passection{In Pascal you can achieve this using: \passnipet{data[1] :=  127.5 * 2;}.}

\clearpage
\subsubsection{Assigning all elements of an array} % (fold)
\label{ssub:assigning_all_elements_of_an_array}

Many languages also allow you to copy the entire contents of an array into another array. In these cases each of the elements of one array are copied into the elements of the destination array (left hand side of the assignment).

\begin{figure}[h]
   \centering
   \includegraphics[width=\textwidth]{./topics/arrays/diagrams/AssignmentWithArray2}
 \caption{All of the elements of an array can be copied across in the assignment statement}
 \label{fig:assignment-with-arrays2}
\end{figure}

\mynote{
\begin{itemize}
  \item The size of the two arrays should match.
  \item The value from each of the elements of the array on the right hand side will be copied into the matching element in the array on the left hand side.
\end{itemize}
}

\csection{This \textbf{cannot} be done in C with an assignment statement, rather it is achieved using the \texttt{memcopy} function. The code for this is as follows, with \texttt{sz} being the number of elements to copy. \csnipet{memcpy(data, source, size_of(double) * sz)}}

\passection{In Pascal you can achieve this using: \passnipet{data := other;}.}

% subsubsection assigning_all_elements_of_an_array (end)

% subsection assignment_statement_with_arrays_ (end)