Finding Quantum Many-Body Ground States with Artificial Neural Network
Jiaxin Wu Wenjuan Zhang


APS/123-QED





wu.2339@osu.edu
 

Department of Physics, the Ohio State University, Columbus, Ohio 43210, USA. 





 

 
 













             


Solving ground states of quantum many-body systems has been a long-standing problem in condensed matter physics.
Here, we propose a new unsupervised machine learning algorithm to find the ground state of a general quantum many-body system utilizing the benefits of artificial neural network. Without assuming the specific forms of the eigenvectors, this algorithm can find the eigenvectors in an unbiased way with well controlled accuracy. As examples, we apply this algorithm to 1D Ising and Heisenberg models, where the results match very well with exact diagonalization. 













                              
Finding Quantum Many-Body Ground States 
 with Artificial Neural Network
    Wenjuan Zhang
    December 30, 2023
========================================================================







§ INTRODUCTION

Machine learning (ML) has become a popular topic in physics, since its ingenuity and flexibility unprecedentedly allow computers to learn automatically about the underlying physics from the input data. Previous efforts have been carried out in designing various machine learning algorithms to study different physics problems, such as using Boltzmann machine to model thermodynamic observables <cit.>, and using artificial neural network to study two-body scattering with short-range potentials <cit.>. In addition, in order to identify quantum phase transitions, <cit.> utilize principal component analysis and variational autoencoder, meanwhile <cit.> proposed a method using convolutional neural networks.

In condensed matter physics, one of the main hurdles is to find the eigenstates of interacting systems with reasonable system sizes. In the presence of interactions, the dimension of the Hilbert space grows exponentially with the system size, which prevents us from solving the Hamiltonian exactly except for small systems with exact diagonalization (ED). To solve this problem, many numerical methods have been put forward, such as quantum Monte Carlo (QMC) <cit.>, density matrix renormalization group (DMRG) <cit.>, and so on. Everyone of them has its own advantages and constraints. For example, QMC uses stochastic sampling based on a probability that is related to the partition function of the system. It is a powerful algorithm to simulate thermodynamic properties of many-body systems, and the many-body ground states can be deduced from finite-size scaling. However, QMC suffers from the notorious “sign problem” rendering it unfit for some fermionic models. DMRG, on the other hand, is able to obtain accurate results for general large 1D or quasi-1D systems by keeping the most relevant components in local reduced density matrices, yet it performs poorly for higher dimensional systems. Variants of DMRG, Projected Entangled Pair States (PEPS) and multi-scale entanglement renormalization ansatz (MERA), have been proposed as solutions for the dimensional limitation.  However DMRG and its variants use power law methods to diagonalize large matricies, redering the algorithm inefficient beyond a model dependent cut off. 

With new tools provided by machine learning, we want to ask whether there exist new algorithms in finding the eigenstates of a general Hamiltonian. Recently, Carleo and Troyer <cit.> proposed to use restricted Boltzmann machine to find a variational ground state and its time evolution for a given Hamiltonian. In this paper, we address the problem by exploring an alternative unsupervised machine learning method with artificial neural network. Our goal is to find the ground-state eigenvectors of a general Hamiltonian without any assumptions of the form the eigenvectors. 

The structure of this paper is organized as the following. We describe our machine learning algorithm in Section <ref>. To illustrate how well this method works, we apply it to find the ground states of 1D Ising model and Heisenberg model, and compare the spin-spin correlators and ground-state energy with exact diagonalization in Section <ref>. In the end, We conclude that using this method one is able to find the ground states accurately, and discuss how this method can potentially be applied to large systems beyond ED. 




§  NEURAL NETWORK STRUCTURE




 §.§ Traditional Deep Learning Structure




Let us start by introducing the structure of a deep learning artificial NN. Traditionally, A deep learning NN is constructed by an input layer, multiple hidden layers, and a output layer (See Fig. <ref>(a).). The input layer X_0 usually contains information of the input data, such as a vector describing every pixel of a picture. A hidden layer X_j  (j = 1,2,3,⋯ ,L-1) is a vector with arbitrary dimension, where every element is connected with every other element from the previous and next layer. The X_j's are connected through parameters W_j's and B_j's:

    X_j+1 = f(W_j+1 X_j +B_j+1),

where W_j is a matrix and B_j is a vector. f is a non-linear function called activation function which introduces non-linearity in the model. The notation here means that the activation function is acting on every element of the vector (W_j+1 X_j +B_j+1). The role of f is important, because it is likely that X_L and X_0 cannot be related by linear operations. Without the non-linearity from the activation function, a multi-layer NN structure has no difference from having only the input and output layers. The common choices of f are sigmoid, tanh, etc. Within the same layer, the elements are independent of each other. An output layer X_L can be a number or a vector containing output information from the NN. The task of a NN is to map the input X_0 to an output X_L where X_L is as close to the desired output Y as possible. 

In order to accomplish the task, one needs to have a well defined cost function, which guides the direction of the learning process. It usually quantifies the difference between X_L and Y. As one of the simplest examples, the cost function could be defined as

    C = 1/2|Y-X_L|^2.

In this case, if X_L is the same as Y, the cost function C=0. The more X_L deviates from Y, the larger C is. Now the goal is to minimize C by updating the parameters in the NN. Because the optimization depends on the knowledge of the desired outputs, which requires one to label the data beforehand, this is a typical supervised machine learning method. The initial parameters W_j's are usually chosen randomly and the B_j's are left to be zero vectors. One can optimize the output by repeatedly updating the parameters in the direction where C decays the fastest. To be more precise, 

    W_j := W_j - η∂ C/∂ W_j, B_j := B_j - η∂ C/∂ B_j,

where the partial derivative of C is operated with respect to every matrix or vector element, and the sign “:=” denotes updating the left-hand side with the value on the right-hand side. η is a positive number called the learning rate, and it determines how fast C descends in every update. As an example shown in Fig. <ref>(b), when ∂ C/∂ W_j<0 at point W_j', the new value of W_j is updated forward. While ∂ C/∂ W_j>0 at point W_j”, W_j is updated backward. In this way, the parameters are always updated in the direction of minimizing C the fastest.

For a given algorithm, one has the freedom to tune the number of layers N, the number of nodes in every hidden layers, the learning rate η. These are called hyper parameters. Changing these parameters can affect the performance of the algorithm. Therefore, one usually needs to have some trial runs to optimize the choice of hyper parameters.  





 §.§ Modified Neural Network to Find Eigenvectors 

Based on the deep learning structure, we propose a modified machine learning algorithm to find the ground state of a general Hamiltonian. Here, the input layer X_0 is a vector indicating the initial guess of the eigenvector given Hamiltonian H. Without prior knowledge of the eigenvetors, one can choose X_0 as a random vector. Noticed that the eigenvector for a general Hamiltonian is complex, X_0 is a complex vector, which can be decomposed as  

    X_0 = X_0^R + i X_0^I,

where superscript R and I mean the real and imaginary part respectively. To simplify the calculation, we propagate the real and imaginary part of X through the NN separately, i.e. 

    X_j+1^R = f(W_j+1^R X_j^R + B_j+1^R),  X_j+1^I = f(W_j+1^I X_j^I + B_j+1^I).

Here, all W^R/I_j's and B^R/I_j's are real, and we choose the activation function to be tanh. To test whether the output vector X_N is an eigenvector of H, we first normalize X_N such that X_N^†· X_N = 1. Then we calculate

    H· X_N = E X̃_N,

where X̃_N is also properly normalized, and E is a scalar. When X_N is an eigenvector, X̃_N=X_N and E is the eigenenergy. To quantify how close X_N is to be an eigenvector, we define the cost function as 

    C ≡ 1- |X̃_N^†· X_N|^2.

When X_N is close to be an eigenvector, C→ 0; whereas when X_N is far from being an eigenvector, C → 1. The goal of the learning process is to minimize C as close to zero as possible, which can be done with gradient descent (See appendix.<ref>.) according to Eq.(<ref>). 

Noticed that for the activation function f(x)=tanh(x), its derivative is the largest when x=0, which means the machine learns the most effectively when W_j+1^R/I X_j^R/I + B_j+1^R/I→ 0 for all j's. To speed up the learning process, we initialize all elements of W_j's with normal distributed random numbers multiplying by a small number (usually 10^-2∼10^-4), and zero all B_j's. For large systems, initializing W_j's with small matrix elements can greatly improve the learning speed and the accuracy of the output vectors.

The minimization process stops when C < ϵ_c, where ϵ_c is the threshold for the cost function. It is a small positive number with ϵ_c<1. The smaller ϵ_c is, the more accurate the output eigenstates are, and usually the more layers are required in the NN.

The cost function in Eq.(<ref>) has many minimums, and each of them corresponds to an eigenvector of H. However, the eigenvectors with an eigenenergy further away from 0 are more likely to be found. The reason is the following. Supposed that the {Ψ_m} is the set of orthonormal eigenvectors for H with eigenvalues {ℰ_m}, one can then write X_N as a superposition where X_N=∑_m A_m Ψ_m. In every iteration, we compute Eq.(<ref>), which could be written as H·∑_m Ψ_m =E ∑_m ℰ_m/EΨ_m = E X̃_N. Under many iteration, the eigen vector correspond to the largest ℰ_j is going to be more important than the other vectors by some powers of ℰ_j. This idea is similar to the power iteration method. In physics, we are usually most interested in the few lowest energy states. To increase the probability that the output states are one of them, one can shift the energy levels down by subtracting H with a constant such that the highest energy states have eigenenergy close to 0. Therefore, after shifting the energy levels, the form of the cost function in Eq.(<ref>) determines that one will most likely finds the few eigenstates with the lowest eigenenergy. Since the definition of C doesn't require prior knowledge of the correct eigenvectors, this is an unsupervised machine learning algorithm. 





 §.§ Gain Function for Convergence to Ground States


The cost function introduced in Section <ref> is good when one is interested to see a few eigenstates with relatively low energy. However, in a lot of cases, we are only interested in the ground state. If H has large dimensions with some low excited states, it could take quite some trials until one finds the ground state. With the cost function in Eq.(<ref>), one way to find it is to project out every output eigenstate in H before running the next trail, and compare all the eigenvalues from these different eigenstates to determine which one corresponds to the ground state. But this projection method requires every output eigenstate to be extremely accurate, otherwise the Hamiltonian will get mixed up. In this subsection, we introduce the gain function, as opposed to the cost function, to help find the ground state more directly.

The gain function is defined as

    G ≡ |X_N^†· (H X_N)|^2 = |E X_N^†·X̃_N|^2.

After properly shifting the energy levels, G is maximized only when X_N is the ground state eigenvector. One can then use gradient ascent (See Appendix.<ref> for more details.) 

    W_j := W_j + η∂ G/∂ W_j, B_j := B_j + η∂ G/∂ B_j,

to iteratively maximize G. In other words, the gradient ascent process refines X_N to be the ground state eigenvector. 

The typical behaviors of G and C in the process of gradient ascent is shown in Fig. <ref>. While maximizing the gain function G, the cost function C is able to jump out of the minimums of some excited states and reach the ground state minimum. 

Unlike the cost function having a universal minimum value, the maximum value for the gain function is model dependent, which equals to the ground state energy square. Without prior knowledge, it is sometimes difficult to guess it accurately. In this case, we stop the optimization process when G increase slowly and C is small. To be more precise, we keep the gain function value from the last optimization step and call it G'. The process stops when 0<G-G'/|G'|<ϵ_g and C<ϵ_c, where 0<ϵ_g<1 is a small number acting as a threshold for the gain function increasing rate. The cost function is now used as a “quality control”. It prevents the optimization process from stopping at regions where G is passing by saddle points but the output vector is not an eigenvector. In general, using the gain function can significantly reduce the number of steps needed for the learning process with the same cost function threshold ϵ_c. Moreover, for the same NN structure, using the gain function usually increases the accuracy of the output eigenvectors, i.e. smaller ϵ_c becomes achievable.

However, based on the stopping condition described above, there are still chances where the optimization stops before the ground state is found, namely when an excited state eigenvector also correspond to a local minimum or saddle point in G. This is a legitimate concern, and one should either compare several outputs with different initial condition, or judge based on estimate of the ground state energy, to decide whether the output vector is the ground state.
As shown in Fig. <ref>, however, the probability of getting a ground state eigenvector is rather high when using the gain function in the optimization process.



§ NUMERICAL RESULTS



To validate the ML algorithm, we apply it to find the ground states of the 1D Ising model with staggered field and anti-ferromagnetic Heisenberg models, where the two Hamiltonian are given by

    H_Ising =   ∑_j[S_j^z S_j+1^z + h∑_j (-1)^jS_j^z] -L-1/4,
    
        H_AFH =   ∑_j(S^x_j S^x_j+1+S^y_j S^y_j+1+S^z_j S^z_j+1)-L/4,

respectively. S_j^α = 1/2σ_j^α is the spin-1/2 operator of the jth site with σ_j^α's being the Pauli matrices, and L is the total number of sites in each system. In both cases, we use periodic boundary condition and shift the energy levels by adding a constant. For the Ising model, we also add a small staggered field (h=0.1 in our case) to split the ground state degeneracy for more straight forward comparison between the exact ground state and the output ground state. In principle, the machine learning algorithm works even if there is degeneracy, where the output ground state should be in one of the superposition of the degenerate ground states. However, the ground states found with different initial conditions are not necessarily orthogonal to each other. One way to find all the ground states is to project out the ground states from the previous calculation in the Hamiltonian before running the algorithm. However, this procedure requires every ground state is obtained with very high accuracy, otherwise the Hamiltonian will be mixed up. To avoid this complicated situation in our demonstration, we choose models without ground state degeneracy. 




In Fig. <ref>, we compare the neural network's ability of finding the ground states using the cost function versus the gain function. Under many trials of random initial condition, let N_g be the number of ground states found, and N_tot be the total number of eigenstates found. We define the acceptance rate of ground states as N_g/N_tot. When the systems are relatively small, both methods give rather high acceptance rate. As the system size grows, the dimension of the Hilbert space grows exponentially, and it becomes less likely to find the ground states by minimizing the cost function. However, the gain function remains relatively effective as a guidance to find the ground states. Noticed that the acceptance rate also depend on the hyper parameters, so this figure only provide a qualitative ratio.



Next, we show the ground-state spin-spin correlations and energy calculated from maximizing the gain function versus ED in Fig. <ref> and Fig. <ref>. Plotted values for ML are the mean value of 100 output ground states with different random initial condition, and the error bars indicate the standard deviations in this ensemble. Fig. <ref> and Fig. <ref> show that the results from the ML algorithm match the ones from ED quite well. 




§ CONCLUSION

In conclusion, we introduce a new machine learning algorithm to find the ground state eigenvector of a general Hamiltonian based on artificial neural network. This method does not have any constraints on the form of the Hamiltonian, nor does it require any prior knowledge of the target ground state. Moreover, the results are obtained with a controllable error rate. Therefore, the outputs are unbiased and can be made very accurate. Compare to ED, this algorithm does not involve solving any multivariable equations, but only matrix multiplications. As a result, one potential direction of applying it to large systems is to store the large matrices in hard drives and read in a few at a time for the matrix multiplication. Besides, the dimension of the matrices in the hidden layer can likely be reduced especially in the presence of symmetries in the Hamiltonian. In our discussion, we fix the dimension of the matrices in the hidden layers in order to reduce the number of hyper parameters, but there is no clear reason that this has to be the case. Reducing the dimension of these matrices can not only reduce the cost of memory, but also improve the speed of the algorithm. The minimum dimension may even reveal information about the “order parameter” of the Hamiltonian. Future work is needed to further explore these two possibilities.


We thank Tin-Lun Ho, Niravkumar Patel, James Rowland and Wayne Zheng for illuminating discussion. JW further acknowledges support from MURI Grant FP054294-D, the NASA Grant on Fundamental physics 1541824, and the OSU MRSEC Seed Grant. WZ acknowledges support from the National Science Foundation Grant No. DMR-1629382.




§ GRADIENT DESCENT OF COST FUNCTION

To update the parameters W_j's and B_j's, one needs to find the partial derivatives ∂ C/∂ W_j and ∂ C/∂ B_j. A simple way to do it is to first calculate the partial derivatives with respect to the last layer

    ∂ C/∂ B_N=∂ C/∂ X_N∂ X_N/∂ B_N=∂ C/∂ X_N∂ f(Z_N)/∂ Z_N,

where f is the activation function, and Z_j = W_j X_j-1+B_j. In our calculation, we choose f(z)=tanh(z). Notice that for tanh(z), its derivative is the steepest at z=0, which means that the machine learns the fastest when the value of Z_j's are small. So when one initialize the parameters W_j's, it is beneficial to choose small random numbers, and let B_j's to be zero. Using the above result, one can calculate the partial derivative of the second to last layer and so on. For the jth layer,

    ∂ C/∂ B_j = (∂ C/∂ X_N∂ X_N/∂ X_N-1⋯∂ X_j+1/∂ X_j) ∂ f(Z_j)/∂ Z_j.

Once ∂ C/∂ B_j is known, ∂ C/∂ W_j = ∂ C/∂ B_jX_j-1. Repeatedly, one can update the parameters from the last layer to the first layer, and finish one updating process. This procedure is called back propagation.

With the definition of cost function C in Eq.(<ref>),

    ∂ C/∂ X^R_N=-2 Re(X̃_N 𝒫), ∂ C/∂ X^I_N=-2 Im(X̃_N 𝒫),

where 𝒫 is a scalar defined as 𝒫≡X̃_N^†· X_N. In our algorithm, the real and imaginary parts are updated separately, i.e.

    ∂ C/∂ B^R_N = ∂ C/∂ X^R_N∂ X^R_N/∂ B^R_N=-2 Re(X̃_N 𝒫)^2(Z^R_N)
    ∂ C/∂ B^I_N = ∂ C/∂ X^I_N∂ X^I_N/∂ B^I_N=-2 Im(X̃_N 𝒫)^2(Z^I_N).

where Z^R/I_j = W^R/I_j X^R/I_j-1+B^R/I_j, and  is obtained from the fact that we use tanh as the activation function. For j∈[1,N), we calculate ∂ C/∂ B^R/I_j based on the chain rule in Eq.(<ref>), except that the real and imaginary parts are separate, i.e.

    ∂ C/∂ B^R_j =    (∂ C/∂ X^R_N∂ X^R_N/∂ X^R_N-1⋯∂ X^R_j+1/∂ X^R_j) ∂ f(Z^R_j)/∂ Z^R_j,
    ∂ C/∂ B^I_j =    (∂ C/∂ X^I_N∂ X^I_N/∂ X^I_N-1⋯∂ X^I_j+1/∂ X^I_j) ∂ f(Z^I_j)/∂ Z^I_j.



As for W_j's, we have

    ∂ C/∂ W^R_j =  ∂ C/∂ B^R_j (X_j-1^R)^T,  ∂ C/∂ W^I_j =  ∂ C/∂ B^I_j (X_j-1^I)^T.

To minimize C to zero, we update the parameters W_j's and B_j's using gradient descent based on Eq.(<ref>) until C is smaller than a threshold ϵ_c, where ϵ_c <<1.






§ GRADIENT ASCENT OF GAIN FUNCTION

Similarly to gradient descent, we need to calculate the partial derivatives of ∂ G/∂ W_j and ∂ G/∂ B_j for each update for G's gradient ascent. We continue to use the idea of back propagation described in Appendix.<ref>.

For the gain function defined in Eq.(<ref>),

    ∂ G/∂ X^R_N =    4Re(H X_N) (X_N^† H X_N),
    ∂ G/∂ X^I_N =    4Im(H X_N) (X_N^† H X_N).

therefore,

    ∂ G/∂ B^R_N = ∂ G/∂ X^R_N∂ X^R_N/∂ B^R_N=   4Re(H X_N) (X_N^† H X_N)^2(Z^R_N),
    ∂ G/∂ B^I_N = ∂ G/∂ X^I_N∂ X^I_N/∂ B^I_N=   4Im(H X_N) (X_N^† H X_N)^2(Z^I_N)

For 1≤ j<N, ∂ G/∂ B_j can be obtained through chain rule similar to Eq.(<ref>) while separating the real and imaginary parts. For W_j's,

    ∂ G/∂ W^R_j =  ∂ G/∂ B^R_j (X_j-1^R)^T,  ∂ G/∂ W^I_j =  ∂ G/∂ B^I_j (X_j-1^I)^T.


Since we want to maximize G, we need to update the parameters in a opposite direction compared to C, i.e. following Eq.(<ref>) with a positive learning rate η. Furthermore, the upper bound of G depends on the Hamiltonian H, so that we cannot define a general threshold at which the gradient ascent stops. Alternatively, we calculate the gain function from the current step G_c and from the last step G_l, and the gradient ascent stops when the gain function almost stop increasing at consecutive steps while the cost function is under the threshold, i.e. (G_c - G_l)/G_l < ϵ_g with (G_c - G_l)>0 and C<ϵ_c. Here, ϵ_g is the threshold for the increased ratio of the gain function and ϵ_g << 1.




§ FIRST-LEVEL HEADING:
 THE LINE
BREAK WAS FORCED VIA \\


This sample document demonstrates proper use of REV 4.2 (and
) in mansucripts prepared for submission to APS
journals. Further information can be found in the REV 4.2
documentation included in the distribution or available at
<http://journals.aps.org/revtex/>.

When commands are referred to in this example file, they are always
shown with their required arguments, using normal  format. In
this format, , , etc. stand for required
author-supplied arguments to commands. For example, in
 the  stands for the title text of the
author's section heading, and in  the 
stands for the title text of the paper.

Line breaks in section headings at all levels can be introduced using
\\. A blank input line tells  that the
paragraph has ended. Note that top-level section headings are
automatically uppercased. If a specific letter or word should appear in
lowercase instead, you must escape it using  as
in the word “via” above.



 §.§ Second-level heading: Formatting


This file may be formatted in either the  or
 style.  format mimics final journal output. 
Either format may be used for submission purposes.  sized paper should
be used when submitting to APS journals.



  §.§.§ Wide text (A level-3 head)

The  environment will make the text the width of the
full page, as on page eq:wideeq. (Note the use the
 command to refer to the page number.) 


  
Note (Fourth-level head is run in)
The width-changing commands only take effect in two-column formatting. 
There is no effect if text is in a single column.



 §.§ Citations and References

A citation in text uses the command  or
 and refers to an entry in the bibliography. 
An entry in the bibliography is a reference to another document.



  §.§.§ Citations

Because REV uses the  package of Patrick Daly, 
the entire repertoire of commands in that package are available for your document;
see the  documentation for further details. Please note that
REV requires version 8.31a or later of .



  
Syntax
The argument of  may be a single key, 
or may consist of a comma-separated list of keys.
The citation key may contain 
letters, numbers, the dash (-) character, or the period (.) character. 
New with natbib 8.3 is an extension to the syntax that allows for 
a star (*) form and two optional arguments on the citation key itself.
The syntax of the  command is thus (informally stated)
1em
  key , or

  optarg+key , or

  optarg+key  optarg+key…,
where optarg+key signifies 
1em
key, or

key, or

prekey, or

prepostkey, or even

prepostkey.
where pre and post is whatever text you wish to place 
at the beginning and end, respectively, of the bibliographic reference
(see Ref. [witten2001] and the two under Ref. [feyn54]).
(Keep in mind that no automatic space or punctuation is applied.)
It is highly recommended that you put the entire pre or post portion 
within its own set of braces, for example: 
   textkey.
The extra set of braces will keep  out of trouble if your text contains the comma (,) character.


The star (*) modifier to the key signifies that the reference is to be 
merged with the previous reference into a single bibliographic entry, 
a common idiom in APS and AIP articles (see below, Ref. [epr]). 
When references are merged in this way, they are separated by a semicolon instead of 
the period (full stop) that would otherwise appear.



  
Eliding repeated information
When a reference is merged, some of its fields may be elided: for example, 
when the author matches that of the previous reference, it is omitted. 
If both author and journal match, both are omitted.
If the journal matches, but the author does not, the journal is replaced by ibid.,
as exemplified by Ref. [epr]. 
These rules embody common editorial practice in APS and AIP journals and will only
be in effect if the markup features of the APS and AIP Bib styles is employed.



  
The options of the cite command itself
Please note that optional arguments to the key change the reference in the bibliography, 
not the citation in the body of the document. 
For the latter, use the optional arguments of the  command itself:
 pre-citepost-citekey-list.



  §.§.§ Example citations

By default, citations are numerical<cit.>.
Author-year citations are used when the journal is RMP. 
To give a textual citation, use : 
Refs. [][, and references therein]witten2001,Bire82. 
By default, the  package automatically sorts your citations into numerical order and “compresses” runs of three or more consecutive numerical citations.
REV provides the ability to automatically change the punctuation when switching between journal styles that provide citations in square brackets and those that use a superscript style instead. This is done through the  option. For instance, the journal style  automatically invokes this option because Physical 
Review B uses superscript-style citations. The effect is to move the punctuation, which normally comes after a citation in square brackets, to its proper position before the superscript. 
To illustrate, we cite several together 
<cit.>, 
and once again in different order (Refs. <cit.>). 
Note that the citations were both compressed and sorted. Futhermore, running this sample file under the  option will move the punctuation to the correct place.

When the  class option is used, the  command
displays the reference's number as a superscript rather than in
square brackets. Note that the location of the 
command should be adjusted for the reference style: the superscript
references in  style must appear after punctuation;
otherwise the reference must appear before any punctuation. This
sample was written for the regular (non-) citation style.
The command  in the  style also
displays the reference on the baseline.



  §.§.§ References

A reference in the bibliography is specified by a  command
with the same argument as the  command.
 commands may be crafted by hand or, preferably,
generated by Bib. 
REV 4.2 includes Bib style files
,  appropriate for
Physical Review and Reviews of Modern Physics,
respectively.



  §.§.§ Example references

This sample file employs the  command, 
which formats the  file
and specifies which bibliographic databases are to be used by Bib 
(one of these should be by arXiv convention ).
Running Bib (via ) 
after the first pass of  produces the file
 which contains the automatically formatted
 commands (including extra markup information via
 and  commands). 
If not using Bib, you will have to create the  environment 
and its  commands by hand.

Numerous examples of the use of the APS bibliographic entry types appear in the bibliography of this sample document.
You can refer to the  file, 
and compare its information to the formatted bibliography itself.



 §.§ Footnotes

Footnotes, produced using the  command, 
usually integrated into the bibliography alongside the other entries.
Numerical citation styles do this
[Automatically placing footnotes into the bibliography requires using BibTeX to compile the bibliography.];
author-year citation styles place the footnote at the bottom of the text column.
Note: due to the method used to place footnotes in the bibliography, 
you must re-run Bib every time you change any of your document's footnotes. 



§ MATH AND EQUATIONS

Inline math may be typeset using the  delimiters. Bold math
symbols may be achieved using the  package and the
 command it supplies. For instance, a bold α can
be typeset as  giving α. Fraktur and
Blackboard (or open face or double struck) characters should be
typeset using the  and  commands
respectively. Both are supplied by the  package. For
example,  gives ℝ and
 gives 𝔊

In  there are many different ways to display equations, and a
few preferred ways are noted below. Displayed math will center by
default. Use the class option  to flush equations left.

Below we have numbered single-line equations; this is the most common
type of equation in Physical Review:

    χ_+(p) [2| p|(| p|+p_z) ]^-1/2(
    [ | p|+p_z;  px+ip_y ]) ,
    
    {
     234567890abc123αβγδ1234556αβ1∑^a_b/A^2
    }
    .

Note the open one in Eq. (<ref>).

Not all numbered equations will fit within a narrow column this
way. The equation number will move down automatically if it cannot fit
on the same line with a one-line equation:

    {
     ab12345678abc123456abcdefαβγδ1234556αβ1∑^a_b/A^2
    }.


When the  command is used [cf. input for
Eq. (<ref>)], the equation can be referred to in text without
knowing the equation number that  will assign to it. Just
use , where  is the same name that used in
the  command.

Unnumbered single-line equations can be typeset
using the ,  format:

    g^+g^+ → g^+g^+g^+g^+ … ,  q^+q^+→
    q^+g^+g^+ … .





 §.§ Multiline equations


Multiline equations are obtained by using the 
environment.  Use the  command at the end of each line
to avoid assigning a number:

    M=      ig_Z^2(4E_1E_2)^1/2(l_i^2)^-1δ_σ_1,-σ_2
    (g_σ_2^e)^2χ_-σ_2(p_2)
          ×
    [ϵ_jl_iϵ_i]_σ_1χ_σ_1(p_1),


    ∑| M^viol_g | ^2   =   g^2n-4_S(Q^2) N^n-2
            (N^2-1)
          ×( ∑_i<j)
      ∑_perm1/S_121/S_12∑_τ c^f_τ .

Note: Do not use  on a line of a multiline
equation if  is also used on that line. Incorrect
cross-referencing will result. Notice the use  for
using a Roman font within a math environment.

To set a multiline equation without any equation
numbers, use the ,
 format:

    ∑| M^viol_g | ^2   =   g^2n-4_S(Q^2) N^n-2
            (N^2-1)
          ×( ∑_i<j)
     (
      ∑_perm1/S_12S_23S_n1)
     1/S_12 .


To obtain numbers not normally produced by the automatic numbering,
use the  command, where  is the desired
equation number. For example, to get an equation number of
(<ref>),

    g^+g^+ → g^+g^+g^+g^+ … ,  q^+q^+→
    q^+g^+g^+ … . 2.6'




  
A few notes on s 
 requires the  package. 
Place the  command before the , if any. 
The numbering produced by  does not affect 
the automatic numbering in REV; 
therefore, the number must be known ahead of time, 
and it must be manually adjusted if other equations are added. 
 works with both single-line and multiline equations. 
 should only be used in exceptional cases—
do not use it to number many equations in your paper. 
Please note that this feature of the  package
is not compatible with the  (6.77u) package.

Enclosing display math within
 and  will produce
a set of equations that are labeled with letters, as shown in
Eqs. (<ref>) and (<ref>) below.
You may include any number of single-line and multiline equations,
although it is probably not a good idea to follow one display math
directly after another.



    M=      ig_Z^2(4E_1E_2)^1/2(l_i^2)^-1
    (g_σ_2^e)^2χ_-σ_2(p_2)
          ×
    [ϵ_i]_σ_1χ_σ_1(p_1).


    {
     abc123456abcdefαβγδ1234556αβ1∑^a_b/A^2},


Giving a  command directly after the , 
allows you to reference all the equations in the  environment. 
For example, the equations in the preceding subequations environment were
Eqs. (<ref>).



  §.§.§ Wide equations

The equation that follows is set in a wide format, i.e., it spans the full page. 
The wide format is reserved for long equations
that cannot easily be set in a single column:


    R^(d)=
     g_σ_2^e
     (
       [Γ^Z(3,21)]_σ_1/Q_12^2-M_W^2
      +[Γ^Z(13,2)]_σ_1/Q_13^2-M_W^2)
     + x_WQ_e
     (
       [Γ^γ(3,21)]_σ_1/Q_12^2-M_W^2
      +[Γ^γ(13,2)]_σ_1/Q_13^2-M_W^2) .


This is typed to show how the output appears in wide format.
(Incidentally, since there is no blank line between the  environment above 
and the start of this paragraph, this paragraph is not indented.)



§ CROSS-REFERENCING

REV will automatically number such things as
sections, footnotes, equations, figure captions, and table captions. 
In order to reference them in text, use the
 and  commands. 
To reference a particular page, use the  command.

The  should appear 
within the section heading, 
within the footnote text, 
within the equation, or 
within the table or figure caption. 
The  command
is used in text at the point where the reference is to be displayed.  
Some examples: Section <ref> on page sec:level1,
Table <ref>,

and Fig. <ref>.




§ FLOATS: FIGURES, TABLES, VIDEOS, ETC.

Figures and tables are usually allowed to “float”, which means that their
placement is determined by , while the document is being typeset. 

Use the  environment for a figure, the  environment for a table.
In each case, use the  command within to give the text of the
figure or table caption along with the  command to provide
a key for referring to this figure or table.
The typical content of a figure is an image of some kind; 
that of a table is an alignment.



Insert an image using either the  or
 packages, which define the  command.
(The two packages differ in respect of the optional arguments 
used to specify the orientation, scaling, and translation of the image.) 
To create an alignment, use the  environment. 

The best place to locate the  or  environment
is immediately following its first reference in text; this sample document
illustrates this practice for Fig. <ref>, which
shows a figure that is small enough to fit in a single column. 

In exceptional cases, you will need to move the float earlier in the document, as was done
with Table <ref>: 's float placement algorithms need to know
about a full-page-width float earlier. 

Fig. <ref>
has content that is too wide for a single column,
so the  environment has been used.


The content of a table is typically a  environment, 
giving rows of type in aligned columns. 
Column entries separated by 's, and 
each row ends with \\. 
The required argument for the  environment
specifies how data are aligned in the columns. 
For instance, entries may be centered, left-justified, right-justified, aligned on a decimal
point. 
Extra column-spacing may be be specified as well, 
although REV 4 sets this spacing so that the columns fill the width of the
table. Horizontal rules are typeset using the 
command. The doubled (or Scotch) rules that appear at the top and
bottom of a table can be achieved enclosing the 
environment within a  environment. Rows whose
columns span multiple columns can be typeset using the
 command (for example, see the first
row of Table <ref>).

Tables <ref>, <ref>, <ref>, and <ref>

show various effects.
A table that fits in a single column employs the 
environment. 
Table <ref> is a wide table, set with the  environment. 
Long tables may need to break across pages. 
The most straightforward way to accomplish this is to specify
the  float placement on the  or
 environment. 
However, the  package  allows headers and footers to be specified for each page of the table. 
A simple example of the use of  can be found
in the file  that is included with the REV 4
distribution.

There are two methods for setting footnotes within a table (these
footnotes will be displayed directly below the table rather than at
the bottom of the page or in the bibliography). The easiest
and preferred method is just to use the 
command. This will automatically enumerate the footnotes with
lowercase roman letters. However, it is sometimes necessary to have
multiple entries in the table share the same footnote. In this case,
there is no choice but to manually create the footnotes using
 and .
 is a numeric value. Each time the same value for
 is used, the same mark is produced in the table. The
 commands are placed after the 
environment. Examine the  source and output for
Tables <ref> and <ref>
for examples.

Video <ref> 
illustrates several features new with REV4.2,
starting with the  environment, which is in the same category with
 and .

http://prst-per.aps.org/multimedia/PRSTPER/v4/i1/e010101/e010101_vid1a.mpg
    < g r a p h i c s >

   http://prst-per.aps.org/multimedia/PRSTPER/v4/i1/e010101/e010101_vid1b.mpg
    < g r a p h i c s >

 http://link.aps.org/multimedia/PRSTPER/v4/i1/e010101
 
  Students explain their initial idea about Newton's third law to a teaching assistant. 
  Clip (a): same force.
  Clip (b): move backwards.
 

The  command causes the title of the video to be a hyperlink to the
indicated URL; it may be used with any environment that takes the 
command.
The  command has the same significance as it does in the context of
the  package: the second argument is a piece of text to be 
typeset in your document; the first is its hyperlink, a URL.

Physical Review style requires that the initial citation of
figures or tables be in numerical order in text, so don't cite
Fig. <ref> until Fig. <ref> has been cited.


We wish to acknowledge the support of the author community in using
REV, offering suggestions and encouragement, testing new versions,
….






§ APPENDIXES


To start the appendixes, use the  command.
This signals that all following section commands refer to appendixes
instead of regular sections. Therefore, the  command
should be used only once—to setup the section commands to act as
appendixes. Thereafter normal section commands are used. The heading
for a section can be left empty. For example,

will produce an appendix heading that says “APPENDIX A” and

will produce an appendix heading that says “APPENDIX A: BACKGROUND”
(note that the colon is set automatically).

If there is only one appendix, then the letter “A” should not
appear. This is suppressed by using the star version of the appendix
command ( in the place of ).



§ A LITTLE MORE ON APPENDIXES


Observe that this appendix was started by using


Note the equation number in an appendix:

    E=mc^2.




 §.§ A subsection in an appendix


You can use a subsection or subsubsection in an appendix. Note the
numbering: we are now in Appendix <ref>.

Note the equation numbers in this appendix, produced with the
subequations environment:


    E   =   mc, 
    
    E   =   mc^2, 
    
    E       mc^3.


They turn out to be Eqs. (<ref>), (<ref>), and (<ref>).








*



