work belongs to the most basic notions of classical mechanics and also presents one of the cornerstones of thermodynamics . with the recent experimental progress in the fields of cold atoms@xcite , nano - mechanics , and opto - mechanics , @xcite to name just a few
, there is an urgent need of a theoretical foundation of what work means in quantum mechanics and how it can be defined in an operational way .
one reason why work does not simply fall into the category of observables like position , linear and angular momentum , and energy , comes from the fact that it is meant to characterize a process rather than an instantaneous state of a system @xcite . even in the simple case of a thermally isolated system the determination of work requires an interference of the system with a measurement device at two times . for a classical system
, the interaction between the system and the measurement device can be made arbitrarily weak and , hence , the back - action can be arbitrarily small , without implying a principle limitation of the precision of the measurement .
however , for a quantum systems , the back - action of the measurement device modifies the state of the system ; it consequently influences the outcome of a subsequent contact , therefore influencing the final value of the work @xcite .
the paper is organized as follows . in section
[ classical ] we survey various definitions of work that classically are equivalent to each other .
we review in more detail the operational definition in terms of two projective energy measurements in section [ tema ] . in section [ twoenergy ]
we discuss a gaussian energy measurement scheme which then is employed in a two gaussian energy measurement device . a recently proposed approach to determine work by a single
, necessarily generalized measurement @xcite is discussed in section[meter ] for a gaussian pointer .
a work - meter that functions in that way operates with a precision determined by a parameter combining the strength of the measurement and the covariance matrix of the gaussian initial pointer state .
implementing a high precision the result of two projective energy measurements is recovered while the use of low precision leads to broad distributions yet with a finite average .
a spin in a suddenly changing magnetic field serves as an example in section [ example ] .
section [ con ] concludes the paper .
restricting ourselves to thermally isolated systems we begin with the discussion of work in classical systems .
when a classical system stays at a phase space point @xmath0 its energy is determined by the value of a conveniently chosen hamiltonian @xmath1 @xcite which also governs the dynamics of the system .
a change of the parameter @xmath2 according to a protocol @xmath3 alters the energy and hence work will be applied to or taken from the system .
we shall adopt the inclusive definition of work @xcite according to which the work is given by the energy - difference at the end and the beginning of the force protocol , @xmath4 with @xmath5 being the phase space point that evolves from @xmath6 according to the hamiltonian dynamics , @xmath7 where @xmath8 denotes the poisson bracket .
as already mentioned , within the time - range @xmath9 $ ] the parameter @xmath10 changes according to a prescribed protocol @xmath11 . for classical systems
an equivalent definition of work is based on the fact that the energy difference can be expressed as an integral of the total time - derivative of the hamiltonian , which coincides with the respective partial derivative yielding the work as integral of the supplied power , i.e. , @xmath12 where @xmath13 denotes the time - derivative of the force parameter @xmath10 .
any adaptation of the two work definitions ( [ whhcl ] ) and ( [ wpower ] ) to quantum systems must take into account the back - actions of those measurements that have to be performed in order to determine the work .
it is this inherently quantum - mechanical requirement that renders the two classically equivalent definitions ( [ whhcl ] ) and ( [ wpower ] ) inequivalent @xcite .
based on the energy difference definition ( [ whhcl ] ) work can be determined by the _ two energy measurement approach _ @xcite which employs two projective measurements of energy at the end and the beginning of the force protocol . due to the projective nature of these measurements , two energy - eigenvalues @xmath14 and @xmath15
are obtained . from these eigenvalues
the work in a single realization of the protocol is determined as the difference @xmath16 . with this definition
the statistics of work complies with the fluctuation relations of jarzynski @xcite and crooks @xcite for systems initially staying in a canonical initial state @xcite .
a quite different picture emerges if one tries to implement the power based approach @xcite .
this , in principle , requires a continuous observation of the system in such a way that the time - evolution of the power can be inferred .
even if this monitoring is not performed by means of projective measurements but in a weaker way , a continuous observation will freeze the dynamics of the system due to the quantum zeno effect @xcite .
for relatively slowly varying protocols one might try to circumvent the zeno effect by restricting the observations to a discrete set of times with a suitably chosen strength of observation . yet the resulting statistics of work turn out to be essentially determined by the number and strength of the observations and only to a lesser extent by the force protocol .
there are hardly any relations between the statistics obtained by the two energy measurement and the power approach .
in particular , the fluctuation relations of crooks and jarzynski are only satisfied for the power approach if the hamiltonians at all different parameter values commute with each other @xcite .
this is not in contradiction with the fact that measurements during the force protocol leave these fluctuation relations unchanged as long as the work is determined by two projective measurements at the beginning and the end of the force protocol @xcite .
we finally note that in various attempts to formulate a `` quantum thermodynamics '' @xcite work is understood in a way such that its mean - value coincides with the difference of the mean - values of the energies at the end and the beginning of the force - protocol , however , without taking into account the back - action of the first onto the second measurement . in order to distinguish this notion of a work - like quantity from operational definitions that include the back - action of measurements we call it `` untouched work '' @xcite . in this sense , work is always untouched in classical mechanics .
the defining property of untouched work hence postulates that its average @xmath17 can be expressed as @xmath18 where the density matrix @xmath19 describes the initial state and @xmath20 denotes the unitary time - evolution of the system over the extension of the force protocol , following as the solution of the schrdinger equation @xmath21 where @xmath22 denotes the unit operator on the hilbert space of the system .    for later use
, we introduce the spectral resolution of the time - dependent hamiltonian @xmath23 in terms of its eigenvalues @xmath24 and corresponding projection operators @xmath25 satisfying @xmath26 , @xmath27 and @xmath28 .
the hamiltonian can then be represented as @xmath29 we will make frequent use of this representation in the sequel for the initial and final times @xmath30 , respectively .    a way to obtain the average untouched work would be to prepare two copies of an ensemble representing the initial state of the system . the first ensemble is then used to determine its average energy in the standard way by projective measurements of the initial energy .
the ensemble which is generated by this measurement need not coincide with the one prior to the measurement and is discarded after the measurement .
the force protocol is applied on the members of the second ensemble and upon its completion the energy is measured and its average calculated .
the difference of the two average energies coincides with the average of the untouched energy .
it only agrees with the average work obtained by the above mentioned two energy measurement approach if the discarded ensemble was identical with the original one .
this is the case for an initial state that is stationary with respect to the initial hamiltonian .
the given prescription though is incomplete in that it only determines an average value but does not allow to determine fluctuations in a meaningful way @xcite .
attempts to define the work as an observable in terms of the difference of the initial and final hamiltonians in the heisenberg - picture @xcite disregard the inherent process - dependence of work @xcite . also for a canonical initial state , the jarzynski and crooks relations do not hold with this definition apart from the trivial , yet untypical case of commuting hamiltonians , @xmath31=0 $ ] for all @xmath32 .    in a recent effort ,
allahverdyan @xcite suggested a characterization of untouched work as a fluctuating quantity which indeed yields ( [ varw ] ) for the average . the statistics of this hypothetical object is determined in @xcite by a pdf - like function @xmath33 the weight @xmath34 is a quasi - probability for the eigenvalues of the two hamiltonians @xmath35 and @xmath36 based on the terletsky - margenau - hill distribution which is given by @xmath37 with @xmath38 denoting the anti - commutator of two operators @xmath39 and @xmath40 .
the fact that , as a quasi - probability , the terletsky - margenau - hill distribution assumes negative values for non - commuting hamiltonians may also translate to @xmath41 which hence is not a probability density function and consequently fails to characterize a proper random variable .
the joint probability @xmath42 of observing the system at an eigenvalue @xmath15 of the hamiltonian @xmath35 by projective measurements at the beginning of the force protocol @xmath11 and the eigenvalue @xmath14 of the hamiltonian @xmath36 at its end is given by @xcite @xmath43 where the projection operators @xmath25 , at times @xmath30 , are defined by the spectral representations of the respective hamiltonians , see ( [ hspec ] ) .
it is important to note that due to the first energy measurement the initial density matrix @xmath19 is projected onto the eigenbasis of the initial hamiltonian @xmath35 . in other words ,
all non - diagonal elements of the initial density matrix in the energy eigenbasis are erased by the first measurement .
this will influence the subsequent time evolution unless the initial density matrix and hamiltonian commute with each other .
moreover , this projection excludes the use of correlations between energy eigenstates as a `` resource '' to extract work out of a system by a unitary process , as it has been recently suggested @xcite .    the probability density function ( pdf )
@xmath44 of finding the work @xmath45 by means of two projective energy measurements ( pem ) can be expressed in terms of the joint probability ( [ pmn ] ) as @xcite @xmath46    in a realization of the force - protocol for which the work @xmath45 was obtained the state @xmath47 , immediately after the second energy measurement , is proportional to a linear , positive map @xmath48 acting on the initial density matrix @xmath19 with a proportionality constant inversely proportional to the work pdf @xmath49 .
hence , the post - measurement state can be written as @xmath50 where the so - called operation @xmath48 @xcite is given by @xmath51 if the energies are measured but the work is not registered the system is found in the so - called non - selective post - measurement state @xmath52 , given by @xmath53 leading with ( [ rphir ] ) to @xmath54 this result immediately follows by a two - fold application of the lders - von - neumann rule @xcite . with the requirement of a normalized selective post - measurement state ( [ rphip ] ) , the work pdf follows from the operation acting on the initial system density matrix as @xmath55 hence , the operation @xmath48 can be considered as a complete characterization of the work measurement . it is a linear map on hilbert space operators with finite trace that preserves the positivity , i.e. , @xmath56 implies @xmath57 and is contractive , i.e. , @xmath58 for all @xmath56 .
also more general measurement strategies than the projective one are characterized by operations with these mathematical properties of being linear , positivity preserving and contractive maps on the space of linear hilbert space operators with finite trace .
coming back to projective measurements we finally want to note the crooks relation @xcite .
it connects the pdfs @xmath59 and @xmath60 for a protocol @xmath61 and the time reversed protocol @xmath62@xcite : @xmath63 this requires that the initial density matrices of the forward and the backward processes must have boltzmann weights as diagonal elements in the energy eigenbasis , i.e. @xmath64 , where @xmath65 is the degeneracy of the energy @xmath24 and @xmath66 the partition function for @xmath30 .
the free energy difference @xmath67 is defined in terms of the partition functions of the initial states of the forward and the backward processes , @xmath68 .
we note that most often , canonical density matrices are considered as initial states of the forward and backward processes .
we point out , however that for the crooks relation to hold , _ only the diagonal elements _ of these density matrices need to have the form of boltzmann factors whereas the non - diagonal elements may be arbitrary , as long the density matrix is positive .
instead of the projective energy measurements one may employ generalized measurements of energy for determining work . as demonstrated by venkatesh _
@xcite work distributions obtained by means of generalized measurements typically do not satisfy fluctuation relations .
however , for a whole class of generalized energy measurements , in particular for gaussian measurements , modified fluctuation theorems exist for which the modifications are solely determined by the properties of the measurement apparatus and hence are independent of the force protocol @xcite .
we here choose a less formal approach compared to @xcite by adapting von neumann s model @xcite to energy measurements .      in von neumann s model a measurement apparatus , here called the `` pointer '' , is coupled to the system during a short time @xmath69 . within this time
the value of the observable to be measured is transcribed onto the scale of the pointer while ideally @xmath69 is small enough that the unitary dynamics of the system is negligible @xcite .
the information transfer is formally achieved by a unitary operator @xmath70 which when acting on the state of the pointer shifts the pointer position by an amount proportional to the @xmath23 . here , @xmath71 is the momentum operator which is canonically conjugate to the position @xmath72 of the pointer where @xmath73 is the projection operator on the eigenstate @xmath74 with eigenvalue @xmath75 .
the unitary operator @xmath76 describes the time evolution of system and pointer governed within the time span @xmath69 by the interaction hamiltonian @xmath77 where @xmath78 describes the coupling strength .
the effective interaction strength @xmath79 between system and pointer therefore is given by @xmath80 .
system and pointer are supposed to be uncorrelated before the interaction has taken place .
then the total density matrix is given by the direct product @xmath81 of the system density matrix @xmath82 and the pointer density matrix @xmath83 immediately before the interaction .
the system pointer interaction is followed by a projective measurement of the pointer position @xmath75 .
the state of the system immediately after the measurement can be expressed as @xmath84 where the operation @xmath85 is composed of the interaction and the projective measurement , yielding @xmath86 here , @xmath87 denotes the trace over the hilbert space of the pointer , @xmath88 is the density matrix of the pointer in the position representation , and @xmath89 gives the probability of observing the pointer in the eigenstate @xmath74 .
it is determined by the normalization of the post - measurement state @xmath90 and therefore becomes @xmath91 we now assume that the initial state of the pointer is given by a gaussian density matrix with vanishing averages of position and momentum , i.e. , @xmath92 and @xmath93 .
the density matrix @xmath83 is then uniquely determined by the second moments @xmath94 , @xmath95 and @xmath96 .
note that the positivity of the density matrix is equivalently expressed by the inequality @xmath97 where @xmath98 denotes the anti - commutator . in position representation a gaussian density matrix
is given by @xcite @xmath99 where @xmath100 is a quadratic form in the position variables @xmath75 and @xmath101 defined as @xmath102 ^ 2 \right \}\\ & = \frac{\langle p^2 \rangle}{2 \hbar^2 } \left [ x - y \right ] ^2 + \frac{1}{2\langle x^2 \rangle } \\ & \quad\times \left [ \frac{1}{2 } ( x+y ) - i \frac{\langle \ { x , p \}\rangle}{2 \hbar } ( x - y ) \right ] ^2\ : .
\label{mu } \end{split}\ ] ] due to the vanishing average pointer position , @xmath92 , the pointer position @xmath75 presents an unbiased estimate of the system energy having the value @xmath103 .
hence , the pdf @xmath104 to find the system at energy @xmath105 is given by @xmath106 where @xmath107 is defined by @xmath108 for a state with sharp energy @xmath109 , i.e. @xmath110 one obtains from ( [ pe ] ) with @xmath111 the conditional probability @xmath112 hence , @xmath107 specifies the inaccuracy of the energy measurement .    even though the energy pdf ( [ pe ] ) agrees with the one obtained in @xcite the operation @xmath113 characterizing the measurement generally differs from the form assumed in @xcite .
the latter is defined as @xmath114 in terms of a single gaussian kraus operator @xmath115 .
one obtains this particular form from ( [ phix ] ) only if the initial pointer density matrix corresponds to a pure gaussian state in position representation , given by @xmath116 where @xmath117 in this case @xmath118 and consequently @xmath119 holds .    for a general gaussian initial state specified by ( [ sigmag ] ) and ( [ mu ] )
the operation @xmath120 becomes @xmath121 ^ 2 } \\ & \quad \times \pi_n(t ) \rho \pi_{n'}(t)\ : , \label{phig1 } \end{split}\ ] ] where @xmath122 controls the contribution of non - diagonal elements on the post - measurement state .
for comparison , the operation @xmath123 as defined above in terms of a single gaussian kraus operator @xmath124 becomes @xmath125 } \\ & \quad \times \pi_n(t ) \rho \pi_{n'}(t)\ : .
\label{phime } \end{split}\ ] ]    the subsequent action of @xmath126 followed by the unitary time evolution @xmath127 and the final operation @xmath128 results in an operation characterizing the joint occurrence of the energies @xmath105 and @xmath129 at the beginning and the end of the force protocol .
it is used in the following subsection for characterizing a work measurement composed of two gaussian energy measurements .
the occurrence of energies @xmath105 and @xmath129 by two gaussian measurements separated by the time span of the unitary time evolution under the force protocol is characterized by the composed operation @xmath130 which acts on a system density matrix @xmath82 as @xmath131 considering only the resulting work @xmath132 one introduces the according operation @xmath133 @xcite which becomes    @xmath134 } \\ & \quad \times e^{-\frac{1}{4 \sigma^2_e } \left [ w- ( w_{m , n } + w_{m',n'})/2 + i \frac{\langle \ { x , p \}\rangle}{2 \hbar } ( w_{m , n } - w_{m'n ' } ) \right ] ^2 } \pi_m(\tau ) u_\lambda \pi_n(0 ) \rho \pi_{n'}(0 ) u^\dagger_\lambda \pi_{m'}(\tau)\ : , \label{phiw2 } \end{split}\ ] ]    where @xmath135 would be a possible work value if the energies were measured projectively .
the non - selective post - measurements state @xmath136 is given by the integral of @xmath137 over @xmath45 according to ( [ rhous ] ) yielding @xmath138 } \\ & \quad \times \pi_m(\tau ) u_\lambda \pi_n(0 ) \rho \pi_{n'}(0 ) u^\dagger_\lambda \pi_{m'}(\tau)\ : , \end{split } \label{run2}\ ] ] the pdf @xmath139 to find the work @xmath45 with two gaussian energy measurements is given by the trace of ( [ phiw2 ] ) giving    @xmath140 ^ 2 }   e^{-\frac{1}{4 \sigma^2_e } \left [ w - e_m(\tau ) + \frac{1}{2 } ( e_n(0 ) + e_{n'}(0 ) ) -
i \frac{\langle \ { x , p \ } \rangle}{2 \hbar } ( e_n(0 ) - e_{n'}(0 ) ) \right ] ^2}p_\lambda(m , n , n')\ : , \label{p2ew } \end{split}\ ] ]    where @xmath141 note that the diagonal elements of @xmath142 with @xmath143 coincide with the joint probability @xmath42 obtained by two projective energy measurements , see ( [ pmn ] ) .
in analogy to ( [ rphip ] ) the selective post - measurement state is given by @xmath144 .
a detailed discussion of the results ( [ phiw2][p2ew ] ) is presented in the context of the similar expressions for the work meter discussed next .
based on a recent idea put forward by roncaglia , cerisola and paz @xcite , recently , de chiara , roncaglia and paz @xcite suggested a method to determine work by means of a single generalized measurement . for the sake of completeness
we describe the principle of operation of such a work meter following ref .
@xcite and discuss its functioning in comparison with two gaussian energy measurements . based thereon ,
the limiting cases of most accurate and maximally imprecise measurements are investigated as well .
the work meter consists of an auxiliary system with a pointer .
this pointer interacts twice with the system .
the first interaction takes place immediately before the force protocol sets in .
it leads to a shift of the pointer proportional to the momentary energy of the system . as for a generalized energy measurement described above the interaction
is given by a unitary transformation @xmath145 transferring the negative value of the system energy to the pointer .
after the first interaction has ended the position of the pointer is not read out but rather left unchanged until the force protocol has ended .
then , a second interaction between system and the pointer moves the pointer by an amount that is proportional to the final energy .
accordingly , the interaction is described by the unitary operator @xmath146 . only after the completion of this interaction , the pointer position is measured projectively .
the whole process consisting of the two unitary pointer system interactions , interrupted by the unitary system evolution under the force protocol and the final position measurement can be expressed by a total operation @xmath147 characterizing the non - normalized post - measurement state of the system @xmath148 as for the generalized energy measurement , @xmath83 denotes the density matrix of the pointer before the first interaction has taken place .
using for @xmath83 the same gaussian form ( [ sigmag ] ) , ( [ mu ] ) together with the pointer calibration @xmath149 , the respective operation becomes    @xmath150 ^ 2}\\ & \quad \times   \pi_m(\tau ) u_\lambda \pi_n(0 ) \rho(0 ) \pi_{n'}(0 ) u^\dagger_\lambda \pi_{m'}(\tau)\ : . \label{phiw } \end{split}\ ] ]    this expression is similar in its structure to the operation ( [ phiw2 ] ) but contains two differences . as a first difference one notices the way how the non - diagonal terms with @xmath151 or @xmath152 are suppressed by the first exponential terms in the sums on the right sides of ( [ phiw2 ] ) and ( [ phiw ] ) .
the exponent is proportional to @xmath153 for two energy measurements and @xmath154 for the work - meter .
the second difference stems from the fact that , in the two measurement approach , each energy measurement contributes to the variance of the work and therefore the width of the second exponential factor is twice as large for the work - meter .
the non - selective post - measurement state @xmath155 imposed by the work meter ( wm ) is given by @xmath156 it also differs by the weights of the non - diagonal terms from @xmath136 , cf .
( [ run2 ] ) .
the work pdf @xmath157 becomes    @xmath158 ^ 2}%\\&\quad \times   e^{-\frac{1}{2 \sigma^2_e } \left [ w - e_m(\tau ) + \frac{1}{2}(e_n(0 ) + e_{n'}(0 ) ) - i \frac{\langle \ { x , p \}\rangle}{2 \hbar}(e_n(0)-e_{n'}(0 ) ) \right ] ^2 } p_\lambda(m , n , n')\ : , \label{pwp } % \end{split}\ ] ]    due to the trace the non - diagonal terms @xmath159 , which add to the operation @xmath48 , do not enter the work pdf .
those non - diagonal terms with @xmath160 contribute with the same exponential weight as for the work pdf resulting from the gaussian two energy measurement approach .
these terms vanish only for an initially stationary state , i.e. if @xmath161 = 0 $ ] .
then all non - diagonal elements @xmath142 with @xmath160 vanish and the work probability reduces to the following expression : @xmath162 ^ 2 } p_\lambda(m , n , n)\ : .
\label{pwd}\ ] ] here , the superscript d stands for `` diagonal '' indicating the restriction to initial density matrices that commute with the initial hamiltonian and hence are diagonal in the respective eigen - basis .
because , as already mentioned , the diagonal elements @xmath163 agree with the joint probabilities ( [ pmn ] ) , which determine the work pdf ( [ pw ] ) for the two projective energy measurement scheme , the work pdf ( [ pwd ] ) becomes a smeared variant of the discrete work distribution obtained by projective energy measurements .
the amount of broadening is uniformly determined by the variance @xmath164 , see ( [ se ] ) .
the work probability ( [ pwd ] ) can now be expressed as the convolution of the projective work pdf and a gaussian which is solely determined by the properties of the pointer yielding @xmath165 the pointer properties only enter this expression in the combination of @xmath166 ; in particular , the work pdf does not depend on the pointer momentum variance @xmath96 nor on the symmetrized pointer position momentum cross - correlation @xmath167 .
it is also worth noticing that the gaussian factor in the convolution is independent of the force protocol .    for a canonical initial state @xmath168
the following modified crooks relation exists @xcite @xmath169 where @xmath170 denotes the work pdf for the time - reversed protocol . as in the original crooks relation ( [ cr ] ) , the free energy difference @xmath67 refers to the two initial equilibrium states of the backward and the forward processes . from the modified crooks
relation one immediately obtains the modified jarzynski equality @xcite @xmath171 the correction factor solely depends on the pointer variance , but is independent of the force protocol .    for a pure gaussian position state of the pointer ( pgp ) , specified by ( [ spure ] , [ ps ] ) , the work pdf ( [ pwp ] ) simplifies to read @xmath172
^ 2}\\ & \quad \times e^{-\frac{1}{2 \sigma^2_e } \left [ w - e_m(\tau )
+ \frac{1}{2}(e_n(0 ) + e_{n'}(0 ) ) \right ] ^2 } p_\lambda(m , n , n')\ :
. \label{mpw } \end{split}\ ] ] in the section [ example ] this expression will be illustrated with an example .      in the limit of large values of the pointer - system coupling strength @xmath79 , both variances @xmath173 and
@xmath174 defined in ( [ se ] ) and ( [ snd ] ) , respectively , become arbitrarily small .
this suppresses all non - diagonal contributions from terms with @xmath160 and further renders the range of deviating work values about each discrete energy difference @xmath175 very narrow . in the limit
@xmath176 the work pdf of the work - meter approaches the two - projective energy measurement result ( [ pw ] ) , i.e. @xmath177 in order to sufficiently suppress all non - diagonal contributions to the sum in ( [ pwp ] ) , the variance @xmath178 needs to be substantially smaller than the smallest squared eigenenergy difference of the initial hamiltonian @xmath35 , i.e. , @xmath179 once the non - diagonal elements are sufficiently suppressed the variance @xmath107 must be chosen smaller than the minimum work difference in order to achieve their unambiguous resolution .
hence , the following inequality must be satisfied @xmath180 additionally , as mentioned above , the inequality @xmath181 must be fulfilled .
an illustrative example is presented in section [ example ] .
the opposite limit of maximally imprecise measurements is reached for a vanishingly small measurement strength @xmath79 .
one expects that in this limit the back - action of the measurement apparatus on the system will be strongly suppressed , however , most likely at the cost of a large measurement error . before confirming this qualitative picture on the basis of the work pdf ( [ pwp ] ) we first consider the mean value of the work @xmath182 in this particular limit . using ( [ pwp ] )
we obtain for the average work    @xmath183 p_\lambda(m , n , n ' ) \ : .
% \end{split } \label{mw}\ ] ]    using ( [ pmnn ] ) one can further simplify this average by performing the sum on @xmath184 and splitting the remaining sum into its diagonal and non - diagonal contributions leading to @xmath185    where @xmath186 denotes the projection of the initial density matrix onto the eigen - basis of the initial hamiltonian @xmath187 .
the expression ( [ aw ] ) for the average work is still exact .
the first two terms on the right hand side coincide with the average work obtained from two projective energy measurements ; the sum contains contributions from non - diagonal elements of the initial density matrix .
note that the imaginary term on the right hand side of ( [ mw ] ) , which is caused by a finite symmetrized pointer position momentum correlation , does not contribute to the average .    in the imprecise limit
@xmath188 the exponential term under the sum on the right hand side approaches unity .
then , the sums in ( [ aw ] ) can be performed to yield the work as the difference of the energy expectation values at the end and the beginning of the force protocol , leading to @xmath189 as expected , this result does not contain any back - action of the first energy measurement and coincides with the untouched work average ( [ varw ] ) .
hence , one might be tempted to expect that the imprecise limit could provide a physical access to untouched work .
in order to study this limit in more detail , we consider the characteristic function of work @xcite , which is defined as the fourier transform of the work pdf . hence it becomes @xmath190 where @xmath191 is determined by the fourier transformed pointer density matrix @xmath192 with @xmath193 and @xmath194 the expression ( [ g ] ) with ( [ chi ] ) and ( [ cmnn ] ) is still exact .
it can be further evaluated in the imprecise limit in which the first , u - independent exponential factor on the right hand side of ( [ chi ] ) can be replaced by unity . the triple sum in ( [ g ] ) can then be performed to yield the characteristic function in the imprecise limit , @xmath195 , reading @xmath196 where @xmath197 further , @xmath198 denotes the final hamiltonian in the heisenberg picture .
the respective work pdf @xmath199 results as a sum of wide gaussians , i.e. , @xmath200 ^ 2}\\ & \quad \times p_\lambda(m ,
n , n ' )   \label{pilw } \end{split}\ ] ] provided the inverse fourier transform of @xmath201 exists the work pdf can also be expressed as a convolution with a gaussian of width @xmath202 , i.e. @xmath203 where @xmath204 is the inverse fourier transform of @xmath205 .
before we further discuss the condition of existence and the properties of @xmath206 we note that the result given in the first line of ( [ pilw ] ) can also be directly obtained from the work pdf ( [ pwp ] ) by replacing the first exponential on the right hand side of ( [ pwp ] ) by unity . in this way
all non - diagonal elements contribute equally .
the expression ( [ glu ] ) coincides with the characteristic function of work obtained by two projective energy measurements @xcite only if the initial density matrix @xmath19 commutes with the hamiltonian @xmath35 at the beginning of the protocol .
then the two exponents containing @xmath207 can be combined into a single term such that @xmath208 and @xmath209 hold .
in general , though , the inverse fourier transform of @xmath201 leads to a divergent result due to the presence of the imaginary part of the coefficient @xmath210 .
only if the symmetrized pointer position momentum cross - correlation vanishes , @xmath211 , @xmath210 is real and @xmath206 becomes a sum of the projective work pdf @xmath44 and further delta - contributions at work values that correspond to the differences @xmath212 between the final energy eigenvalues and the arithmetic averages of all pairs of initial eigenvalues .
hence , for @xmath213 , the inverse fourier transform of the trace expression becomes @xmath214 the integral of @xmath206 over all possible work values is unity as follows from ( [ pilw ] ) with @xmath215 .
because the projective work pdf @xmath44 itself is normalized the integral over the sum expression on the right hand side must vanish .
this implies that either this sum vanishes for all values of @xmath45 or that it assumes both positive and negative values .
the first case happens only if @xmath216 for all @xmath160 .
one can show that for this to hold the initial density matrix must be stationary , i.e. @xmath217=0 $ ] .
we conclude that in all other cases @xmath206 assumes both positive and negative values and therefore does not qualify as a proper pdf .
the positivity of @xmath218 is only guaranteed by the convolution with a sufficiently broad gaussian which smooths out any negative contributions .    in agreement with the expectation formulated in the beginning of this subsection
the non - selective post - measurement state ( [ runwm ] ) converges to the state that is reached solely by the force protocol without the inference of the work meter , i.e. one obtains @xmath219    provided @xmath206 exists , the convolution in the second line of ( [ pilw ] ) can be evaluated in the limit @xmath220 yielding @xmath221 we conclude that the imprecise limit suppresses any influence of the interactions of the work measurement device and in this sense yields the untouched work but on the other hand does not carry any system - specific information on the work beyond its average .    finally , we note that the limiting form ( [ pilw ] ) presents a valid approximation of the work pdf ( [ pwp ] ) if @xmath222 where both @xmath223 and @xmath224 are elements of the set @xmath225 that exhaust the total probability obtained from the diagonal elements @xmath226 up to a negligibly small fraction @xmath227 , such that @xmath228
. here , @xmath229 and @xmath230 are the minimum and maximum energies , respectively , out of this set of states contributing to the energy distribution in the initial state .
the criterion ( [ snde ] ) is obtained from the fact that the non - diagonal elements of @xmath142 are proportional to @xmath231 , cf .
( [ pmnn ] ) , @xcite . due to the positivity of the density matrix @xmath19 ,
the absolute values of these non - diagonal elements of the density matrix are dominated by the diagonal elements as @xmath232 .
to @xmath233 given by ( [ hi ] ) and ( [ hf ] ) , respectively , is displayed as it is generated by a work meter with a pure gaussian state in position representation .
the level separation of the hamiltonian after the switch is given by @xmath234 .
both panels refer to an initial density matrix ( [ rho0 ] ) with ground - state probability @xmath235 . in panel
( a ) the work pdf is displayed for vanishing non - diagonal elements of the initial density ( @xmath236 ) and different values of the work variance @xmath107 which are @xmath237 ( red ) , @xmath238 ( blue ) , @xmath239 ( black ) . at the smallest variance ,
the work pdf consists of clearly separated peaks , which overlap at the intermediate variance and are completely washed out at the large variance . in those cases where
peaks can be identified they are always exactly located at the positions of the work values ( [ w12 ] ) obtained by projective measurements .
these values are indicated by the four thin vertical black lines .
panel ( b ) exemplifies the effect of a non - diagonal initial density matrix at the intermediate variance @xmath240 . as a reference
, the solid blue line refers to the diagonal case ( @xmath236 ) whereas the red dashed curve corresponds to @xmath241 and the black dash - dotted line to @xmath242 .
the non - diagonal elements of the initial density matrix @xmath19 lead to a substantial distortion of the work pdf .
in particular , the positions of the maxima do no longer coincide with those of the projective work values.,width=302 ]     ( [ varw ] ) as a function of the variance @xmath107 , see ( [ mw ] ) .
all curves are for a density matrix of the type ( [ rho0 ] ) with @xmath235 .
the average work is displayed for @xmath241 by the upper red curve , for @xmath243 , @xmath244 , @xmath245 and @xmath246 by the blue , green und lower red curves , respectively .
the according asymptotic values given by ( [ mw ] ) are indicated by thin horizontal lines of respective color .
the final energy is chosen as @xmath247 .
the change in the average work is largest for the two limiting values @xmath248 and vanishes for @xmath236 .
, width=302 ]     ( narrow blue curve ) and @xmath249 ( broad blue curve ) is compared to the limiting result of the imprecise measurement limit for two values of the variance @xmath107 ( thin red curves ) . at the smaller value @xmath250 the gaussian factor of the convolution integral on the right hand side of ( [ pilw ] )
is not yet broad enough to suppress the negative contributions around @xmath251 . at the larger variance ,
the approximate work pdf only insignificantly differs from the exact one .
the other parameters , @xmath235 and @xmath252 , are the same for all curves.,width=302 ]    as a simple example we consider a spin 1/2 which undergoes a sudden change of the hamiltonian from its initial form @xmath253 to the final form @xmath254 where @xmath255 and @xmath256 are pauli - spin matrices . the central quantity @xmath257
can then be expressed in terms of the eigenfunctions @xmath258 and @xmath259 of @xmath260 and @xmath233 , respectively as @xmath261 the indices @xmath262 taking the values 1 and 2 refer to the ground and the exited state , respectively , of each hamiltonian .
the scalar products are readily determined to yield @xmath263 .
we specify the density matrix @xmath19 in the basis of @xmath260 as @xmath264 with @xmath265 and @xmath266 .
choosing for the initial pointer state @xmath83 a pure gaussian state as defined in ( [ spure ] , [ ps ] ) , we obtain @xmath267\ : , \label{pw2l } \end{split}\ ] ] where the diagonal elements of the initial density matrix contribute with @xmath268 p \right .
\\ & \quad \left .
+ \left [ e^{-\frac{1}{2 \sigma^2_e}(w - w_{1,2})^2 } + e^{-\frac{1}{2 \sigma^2_e}(w - w_{2,2})^2 } \right ] ( 1-p ) \right \}\ : .
\end{split } \label{pdiag2l}\ ] ] the allowed projective work - values @xmath269 are given by @xmath270 figure [ f1 ] displays the work pdf ( [ pw2l ] ) for different variances @xmath107 and different initial system density matrices .
while an increase of @xmath107 leads , as expected , to a broadening of the peaks , the presence of non - diagonal terms @xmath271 in the system s density matrix gives rise to further deformations and , in particular , also to shifts of these peaks .
figure [ f2 ] demonstrates the transition of the average work from the accurate limit yielding the results of projective energy measurements to the limit of maximally imprecise measurements for different values of the non - diagonal elements of the initial system s density matrix . in the latter limit the approach to the average untouched work ( [ varw ] )
is confirmed .
finally , in figure [ f3 ] the asymptotic work pdf ( [ pilw ] ) is compared with the full result ( [ pw2l ] ) for two different values of the variance @xmath107 . for the smaller one , a negative contribution resulting from negative parts of @xmath206 is visible whereas for the larger one the gaussian factor in ( [ pilw ] ) is sufficiently broad to suppress any negative part . as a result , the limiting distribution coincides fairly well with the exact one , even though with @xmath272 and @xmath273 the inequality ( [ snde ] ) is only marginally satisfied .
we reviewed several attempts to specify work .
in particular , we considered three different setups for which we compared the state of the considered system immediately after the completion of selective and non - selective measurements of work as well as the respective probabilities of finding a particular value of work . in the first scenario ,
work is determined in the standard way by two projective measurements of energy ; in the second scenario , also two energy measurements are performed in each of which the system is coupled to a gaussian pointer state and read out by projective measurements of the pointer state ; the third scenario , proposed by de chiara , roncaglia and paz in @xcite , the result of the first pointer - system interaction encoding the negative initial energy is stored in the pointer until the force protocol is completed .
the final energy is transferred to the same pointer and added to the stored value .
only then the pointer state is read out by a projective measurement .    in all three cases the operations characterizing the selective as well as the non - selective post - measurement states and the distributions of work values are different .
while the projective energy measurements select the elements of the according density matrix that are diagonal with respect to the measured hamiltonians , non - diagonal elements contribute to the post - measurements states generated by both gaussian strategies , however with different weights .
moreover , when considering the work pdfs one finds broadened peaks instead of the sharp lines in the case of projective energy measurements .
the widths of these peaks are governed by an effective measurement strength , @xmath274 , which is determined by the variance of the pointer position @xmath94 , in its initial state and a parameter @xmath80 combining the strength @xmath78 and duration @xmath275 of the interaction between system and pointer . a second variance - like quantity ( @xmath276 )
governs the influence of non - diagonal terms of the initial system density matrix .
these terms not only add to the broadening but also cause shifts of the peaks of the work pdf relative to the possible work values obtained by projective energy measurements .
the two variances are restricted by an inequality which suppresses the influence of non - diagonal elements of the initial density matrix if the broadening of the lines is small . on the other hand
it entails huge broadening if the non - diagonal elements are only little suppressed .
the disjoint parameter regimes of small @xmath202 and large @xmath277 correspond to the limiting cases of accurate and imprecise measurements . in the accurate limit
the work statistics based on projective energy measurements is approached , whereas in the imprecise limit the work statistics is governed by an extremely broad gaussian distribution with an average of the untouched work @xmath17 and width @xmath278 . in this limit ,
the fluctuations are completely determined by the imprecision of the measurement device .
therefore this limit is of minor practical use ; to achieve a reliable estimate of the average untouched work an extremely large number of realizations would be required .    finally , we note that the fluctuation relations of jarzynski and crooks remain valid in its modified form only if the system initially stays in a canonical state .
in contrast to the projective two energy measurement approach it is not sufficient if only the diagonal elements in the initial energy basis are given by boltzmann factors but additional finite non - diagonal elements are present .
pt thanks the foundation for polish science ( fnp ) for providing him with an alexander von humboldt polish honorary research fellowship .
99 i. bloch , j. dalibard and w. zwerger , rev .
phys . * 80 * , 885 - 964 ( 2008 ) .
kippenberg and k.j .
vahala , kerry j. , optics express * 15 * , 17172 ( 2007 ) .
m. aspelmeyer , t.j .
kippenberg and f. marquardt , rev .
phys . * 86 * , 1391 ( 2014 ) .
p. talkner , e. lutz and p. hnggi , phys .
e * 75 * , 050102 ( 2007 ) .
p. talkner , p. hnggi and m. morillo , phys .
e * 77 * , 051131 ( 2008 ) .
roncaglia , f. cerisola and j.p .
paz , phys .
* 113 * , 250601 ( 2014 ) .
g. de chiara , a.j .
roncaglia and j.p .
paz , new j. phys .
* 17 * , 035004 ( 2015 ) .
note that for non - autonomous hamiltonian systems not any hamiltonian rendering the correct equations of motion gives a proper expression for the energy .
however , with a convenient gauge transformation it can always be achived that the value of the hamiltonian corresponds to the instantaneous energy of the system @xcite .
c. jarzynski , c. r. physique * 8 * , 495 ( 2007 ) .
venkatesh , g. watanabe and p. talkner , new j. phys .
* 17 * , 075018 ( 2015 ) .
j. kurchan , arxiv : cond - mat/0007360 ( 2000 ) .
h. tasaki , arxiv : cond - mat/0009233 ( 2000 ) .    c. jarzynski , phys
. lett . * 78 * , 2690 ( 1997 ) .
crooks , phys .
e. * 60 * , 2721 ( 1999 ) . for slightly less restrictive conditions on the initial state
see the paragraph following ( [ cr ] ) below .
m. campisi , p. talkner and p. hnggi , phys .
lett . * 105 * , 140601 ( 2010 ) .
g. watanabe , b.p .
venkatesh , p. talkner , m. campisi and p. hnggi , phys .
e * 89 * , 032114 ( 2014 ) .
j. gemmer , m. michel and g. mahler , _ quantum thermodynamics _ , springer , berlin 2009 .
we choose the name `` untouched work '' because the first registration of energy is assumed to leave the subsequent dynamics untouched .
for the two - ensemble implementation of untouched work the fluctuations of work are given by the pdf @xmath279 .
this expression , though does not have the correct classical limit and therefore can not be considered as a useful definition .
allahverdyan and th.m .
nieuwenhuizen , phys .
e * 71 * , 066102 ( 2005 ) .
a. engel and r. nolte , europhys .
lett * 79 * , 10003 ( 2007 ) .
m. campisi , p. hnggi and p. talkner , rev .
phys . * 83 * , 771 ( 2011 ) .
m. campisi , p. hnggi and p. talkner , rev .
mod . phys . * 83 * , 1653 ( 2011 ) .
p. hnggi and p. talkner , nat
. phys . * 11 * , 108 ( 2015 ) .
allahverdyan , phys .
e * 90 * , 032137 ( 2014 ) .
r. alicki and m. fannes , phys .
e * 87 * , 042123 ( 2013 ) .
m. perarnau - llobet , k.v .
hovhannisyan , m. huber , p. skrzypczyk , n. brunner and a. acn , phys .
x * 5 * , 041011 ( 2015 ) .
k. kraus , _ states , effects and operations _ , springer ,
berlin 1983 .
g. lders , ann .
( leipzig ) * 8 * , 322 ( 1951 ) ; english translation : ann . phys . ( leipzig ) * 15 * , 663 ( 2006 ) .
j. von neumann , _ mathematische grundlagen der quantenmechanik _ , springer verlag , berlin , 1932 ; english translation : _ mathematical foundation of quantum mechanics _
princeton , 1955 .
p. talkner and p. hnggi , j. phys .
a * 40 * , f569 ( 2007 ) . in order that the time - reversed process can be realized , the hamiltonian of the system must satisfy the time - reversal symmetry relation @xmath280 for all times @xmath281 $ ] with @xmath282 being the time - reversal operator and @xmath283 the parity of the parameter @xmath2 under time - reversal . for the sake of simplicity
, we consider a parameter @xmath10 that transforms evenly under time - reversal . for odd parameters , its sign must be changed .
venkatesh , g. watanabe and p. talkner , new j. phys .
* 16 * , 015032 ( 2014 ) g. watanabe , b.p .
venkatesh and p. talkner , phys .
e * 89 * , 052116 ( 2014 ) .
the assumptions of a short interaction time @xmath69 during which the system dynamics is negligible is made for the sake of simplicity .
one may allow for larger interaction times during which the system dynamics is no longer negligible @xcite without affecting the general conclusions .
p. talkner , z. phys .
b * 41 * , 365 ( 1981 ) .
the superscript @xmath284 is meant to distinguish a work operation based on two gaussian energy measurements in contrast to the operation characterizing the work meter discussed below , see section [ meter ] .    for the sake of simplicity , we assume that the energy eigenvalues @xmath15 of @xmath285 with corresponding eigenstates @xmath286 are non - degenerate .
a. prinz - zwick , g .-
ingold and p. talkner , phys .
scr . * t165 * , 014014 ( 2015 ) .


observations of accretion flows around black holes in galactic systems and in the centers of galaxies show strong evidence for the presence of long - lived , global modes at characteristic frequencies of the black - hole spacetimes ( see * ? ? ?
* ; * ? ? ?
* for reviews ) .
the origin of these modes is still a matter of debate ( see , e.g. , * ? ? ?
* ; * ? ? ?
it is anticipated , however , that modeling accurately their origin and physical properties will provide the first measurements of the spins of black holes in the universe as well as direct tests of strong - field general relativity @xcite .
systematic studies of modes in accretion disks around black holes have so far been mostly analytical , performed in the linear regime for flows with an artificial viscosity law ( see * ? ? ?
* ; * ? ? ?
* and reference therein ; see , however , gammie & balbus 1994 and menou 2003 for studies of mhd disks ) .
these studies have shown the presence of three types of trapped global modes , namely inertial - gravity , corrugation , and inertial - pressure modes , with properties that appear to agree with observations ( see * ? ? ?
despite their success , analytical models have several limitations .
first , they rely on a number of approximations , such as the wkb approximation in the radial direction .
second , because only linear terms in perturbations are taken into account , these studies are unable to reproduce resonances and couplings between various modes . however , the detected qpos often have fractional amplitudes as large as 40% of the total x - ray flux , making the linear approximation inaccurate ( see , e.g. , * ? ? ?
furthermore , pairs of qpos are typically observed ( see * ? ? ?
* ; * ? ? ?
* ) with frequency ratios equal to ratios of small integers , strongly arguing for the presence of resonances between modes @xcite .
third , analytical and numerical studies of oscillations in mhd disks cast doubt on the presence of oscillations at the radial epicyclic frequencies , as required by all diskoseismic calculations ( see , e.g. , * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
answering all the above questions necessitates a systematic , numerical study of accretion disk oscillations .
numerical studies of accretion disk modes have been very few and have not addressed in detail the above issues ( see , e.g. , * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* for simulations of viscous disks ; see also rezzolla 2004 for simulations of hydrodynamic tori ) .
in fact , no numerical simulation of hydrodynamic disks to date has resulted in solutions that show all three types of accretion - disk modes that were discovered analytically . in this series of papers ,
we perform a systematic study of the oscillatory behavior of hydrodynamic and mhd accretion disks in two and three dimensions . to this end , we have developed a pseudo - spectral numerical algorithm , which we present here . even though spectral methods have been used extensively in the study of hydrodynamic modes in various planetary atmospheres , including the earth s ( see , e.g. , * ? ? ?
* ) , their application to the studies of accretion disks has been very limited @xcite .
spectral algorithms are high order numerical methods and are perfectly suited to studying modes of hydrodynamic flows for a number of reasons .
their major advantage is accuracy and economy in the number of degrees of freedom @xcite . in spectral methods ,
only @xmath0 collocation points are needed to resolve one wavelength @xcite , whereas in finite difference methods a lot more grid points are required to reach the same accuracy .
the solution is already expressed as a set of orthogonal modes ; this property improves the accuracy of studies of mode coupling and resonance .
moreover , the dimensionality of the problem can be altered very easily , for investigating the effects of the number of spatial dimensions on the properties of hydrodynamic modes and turbulence . in simulating mhd flows ,
the high order of spectral methods allows for the equations to be solved in terms of the vector potential and not of the magnetic field itself ; this guarantees that the resulting magnetic field is always divergence free . also , super spectral viscosity @xcite , which is one kind of artificial viscosity , is trivial to implement in spectral methods .
it resolves shocks and yet preserves the high spectral accuracy of the solution .
finally , incorporating the self - gravity of the flows is trivial and does not increase significantly the computational time ( see , e.g. , * ? ? ?
* ) .    in this first paper
, we discuss our numerical algorithm for evolving two - dimensional viscous , hydrodynamic accretion disks . in the following section
, we present our assumptions and equations . in  3 , we discuss the details of our numerical method . in  4 , we present a series of tests to verify our algorithm . in  5 , we apply our algorithm to non - axisymmetric instabilities in viscous spreading rings .
we confirm the result of @xcite , which shows that the standard solution of a viscous spreading ring @xcite is unstable to non - axisymmetric perturbation . in  6 , we present our conclusions .
we consider two - dimensional , viscous , compressible flows . in this first paper , we neglect self - gravity and the magnetic fields of the flows .
the hydrodynamic equations , therefore , contain the continuity equation @xmath1 the navier - stokes equation @xmath2 and the energy equation @xmath3 we denote by @xmath4 the height - integrated density , by @xmath5 the velocity , and by @xmath6 the thermal energy . in the navier - stokes equation , @xmath7 is the height - integrated pressure , @xmath8 is the viscosity tensor , and @xmath9 is the gravitational acceleration .
we use @xmath10 to denote the viscous dissipation rate , @xmath11 to denote the heat flux vector , and @xmath12 to denote the radiation flux on the @xmath13-@xmath14 plane .
the last term in the heat equation , @xmath15 , takes into account the radiation losses in the vertical direction .
we allow for large flexibility in the physical assumptions in our algorithm , i.e. , we can change the functional form of @xmath7 , @xmath9 , @xmath11 , @xmath12 , and @xmath16 easily and apply our algorithm to various problems .
we also write the viscosity tensor in the general form @xmath17 here @xmath18 , @xmath19 , and @xmath20 are the coefficients of radiative , bulk , and shear viscosity , respectively . these coefficients can also be changed easily to satisfy different physical assumptions .
the strain - rate tensor @xmath21 is @xmath22 the viscous dissipation rate is @xmath23 in appendix  [ app : equations ] , we write down explicitly the equations used in the algorithm .
the default setup for our calculations is that of a geometrically thin disk , in which radiation pressure is assumed to be negligible . using the ideal gas law ,
the thermal energy density and pressure become @xmath24 where @xmath25 is the boltzmann constant , @xmath26 is the central temperature , @xmath27 is the mean molecular weight , and @xmath28 is the mass of the hydrogen atom .
the viscosity coefficients @xmath18 , @xmath19 , and @xmath20 are chosen based on the physical assumptions of the specific problems .    in order to approximate the effects of general relativity in the vicinity of compact objects , we use the pseudo - newtonian approximation for the gravitational acceleration @xcite @xmath29 ^ 2\left[\frac{r^2 - 2(a / c)\sqrt{gmr / c^2 } + ( a / c)^2 }                 { \sqrt{gmr / c^2}(r - r_\mathrm{g } ) + a / c}\right]^2\mathbf{\hat r}.\ ] ] here , @xmath30 is speed of light
, @xmath31 is the gravitational constant , @xmath32 is the mass of the central object , @xmath33 is its specific angular momentum , @xmath34 is its schwarzschild radius , and @xmath35 is the unit vector in the radial direction . for a non - rotating star ,
we set @xmath36 and the gravitational acceleration reduces to the standard pseudo - newtonian acceleration @xmath37 . when @xmath38 , it recovers newtonian gravity .
regarding radiative cooling , we follow @xcite and @xcite to take into account the energy loss in the vertical direction by the standard form @xmath39 where we use @xmath40 to denote the stefan - boltzmann constant . the optical depth @xmath41 is again chosen based on the physical problem .
we finally set to zero the other two terms , @xmath42 and @xmath43 , in the energy equation .
in our numerical algorithm , we use pseudo - spectral methods to evaluate the spatial derivatives in the partial differential equations and an explicit runge - kutta method to advance the solution in time .
spectral methods are based on the idea that any function can be expanded in a series of orthogonal basis functions .
when a well - behaved basis is chosen , this series converges exponentially in the absence of discontinuities and the numerical partial derivatives can be easily evaluated .
there exist different ways to approximate functions by a series with a finite number of terms , such as the galerkin method , the tau method , and the pseudo - spectral method ( see * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ) . in pseudo - spectral methods , as the one we use here ,
we choose a set of collocation points and then evaluate the expansion ( spectral ) coefficients such that the truncated series agree exactly with the original functions at the collocation points up to the machine accuracy . in the next subsection , we discuss our implementation of the pseudo - spectral method .
the fourier basis is the natural choice for expanding functions with periodic boundary conditions , as is the case along the azimuthal direction in our problem .
any physical quantity @xmath44 can be expanded in this basis as @xmath45 we use a total of @xmath32 evenly spaced , discrete collocation points in the domain @xmath46 , @xmath47 so that the above fourier series can be approximated by the ( truncated ) discrete fourier series @xmath48 the derivative of @xmath49 with respect to @xmath14 is , therefore , @xmath50 in order to evaluate equation  ( [ eq : fourier_derivative ] ) , we use a fast fourier transform algorithm to find @xmath51 , multiply the fourier coefficients by @xmath52 , and then take the inverse fast fourier transform of the series .
the computational order of the azimuthal derivative is therefore @xmath53 .    when non - periodic boundary conditions are present , as in the case along the radial direction , the fourier basis can no longer be used .
popular choices of bases are the legendre and chebyshev polynomials , which are both defined on the domain @xmath54 $ ] . between these two ,
the chebyshev polynomials are usually preferred because of their relation to the cosine function , which makes them easier to compute .
suppose the domain of @xmath13 is @xmath55 $ ] . in order to map the standardized radial
coordinate @xmath56 $ ] to the physical radial coordinate @xmath57 $ ] , we introduce a mapping function @xmath58 which is strictly increasing and satisfies both @xmath59 and @xmath60 .
let @xmath61 be the @xmath62-th order chebyshev polynomial , i.e. , @xmath63 the chebyshev - gauss - lobatto collocation points are defined by @xmath64 where the collocation points in the physical radial coordinate are given by @xmath65 .
note that there are totally @xmath66 collocation points including both boundary points of the domain . for any physical quantity @xmath67
, we approximate its chebyshev - fourier series by the double sum @xmath68 \nonumber\\    & = & \sum^{m/2 - 1}_{m =- m/2}\sum^n_{n=0}\check f_{n , m}t_n(\bar r_k)e^{i2\pi mj / m } \nonumber\\    & = & \sum^{m/2 - 1}_{m =- m/2}\sum^n_{n=0}\check f_{n , m}\cos\left(\frac{\pi nk}{n}\right)e^{i2\pi mj / m}.\end{aligned}\ ] ] we then use a fast discrete cosine transform to obtain the spectral coefficient @xmath69 from @xmath70 $ ] . the radial derivative can be found using the chain rule @xmath71 expressing the derivative with respect to the standardized coordinate as @xmath72 we can employ the following three - term recursive relation to obtain @xmath73 from @xmath69 , @xmath74 where @xmath75 , and @xmath76 , for @xmath77 .
this recursion relation allows the use of an @xmath78 algorithm in calculating the numerical derivatives in spectral space along the radial direction .
the transformation between physical and spectral space can then be done by a fast cosine transform , the order of which is @xmath79 .
the most trivial map @xmath58 is linear , i.e. , @xmath80 in this case , @xmath81 is just a constant .
however , the grid spacings @xmath82 , for @xmath83 , scale with the number of collocation points @xmath84 as @xmath85 , when @xmath86 is close to @xmath87 or @xmath84 .
this requires the stability condition for time - stepping to be @xmath88 due to viscous time scale ( see  [ sec : time_stepping ] ) .
the grid spacings for fourier collocation are @xmath89 .
they are uniform and scale as @xmath90 which gives the stability condition @xmath91 the stability condition in the radial direction is too expensive numerically compared to the one required by the azimuthal direction . to overcome this restriction
, @xcite proposed the mapping @xmath92      - \frac{r_{\min}}{2}\left[\frac{\arcsin(\alpha \bar r)}{\arcsin(\alpha ) } - 1\right ] ,      \label{eq : modified_chebyshev_collocation}\ ] ] which makes the spacing @xmath93 around the boundaries . in the above transformation
, @xmath94 is a parameter .
let @xmath95 be the machine accuracy .
@xcite showed that the choice @xmath96 minimizes the errors in the numerical derivatives .
we therefore refer to the mapping  ( [ eq : modified_chebyshev_collocation ] ) with the optimized choice ( [ eq : optimized_alpha ] ) as the modified chebyshev collocation and employ it in our algorithm .
the numerical derivatives for the modified chebyshev collocation can be easily calculated by @xmath97 where @xmath98 is obtained by the usual chebyshev method  ( [ eq : chebyshev_derivative ] ) .
the constant scaling in ( [ eq : chebysehv_derivative_linear_scaling ] ) and the scaling in equation ( [ eq : chebysehv_derivative_scaling ] ) can be done together with the normalization , so neither of them have extra computational cost .      in low order numerical methods ,
one uses the conservative form of the hydrodynamic equations to ensure conservation of mass and momentum @xcite .
this is not necessarily the ideal way for pseudo - spectral methods because the conservative form is sometime numerically unstable ( see * ? ? ?
* ) . to illustrate this , consider two arbitrary functions @xmath99 and @xmath100
the derivative of their product has two different but equivalent forms @xmath101    the pseudo - spectral fourier coefficients ( with @xmath32 collocation points ) of @xmath102 and @xmath103 are @xmath104 , \\
\hat d_m & = & im\sum_{p+q = m}\hat u_p\hat v_q + i\left[\sum_{p+q = m+m}(m+m)\hat u_p\hat v_q \right.\nonumber\\    & & \left.+ \sum_{p+q = m - m}(m - m)\hat u_p\hat v_q\right].\end{aligned}\ ] ] the first term in each equation corresponds to the truncated fourier series .
the other terms in the square brackets are therefore due to the aliasing error of pseudo - spectral methods ( see * ? ? ?
* ) , which may cause numerical instability . one can show that these aliasing terms have opposite signs .
the skew symmetric form @xmath105 , therefore , has a much smaller aliasing error .
unfortunately , calculating the skew symmetric form increases the number of numerical derivatives and lowers the algorithmic performance .
a similar argument is valid for the chebyshev collocation .
however , in that case , the problem becomes more complicated due to the boundary conditions .
@xcite carried out numerical experiments and reported that , without aliasing removal , the convective form is stable for the two different boundary method they tested ; the conservative form is unstable for one of their methods .
we carried out some numerical experiments for our algorithm . when the initial conditions are smooth , both conservative and convective forms are stable
however , when an initial perturbation is introduced , the conservative form sometimes become unstable . in these cases ,
the spectral coefficients at high wavenumbers in the radial direction grow exponentially even with spectral filtering ( see the next subsection ) .
the convective form , on the other hand , is able to reproduce various analytical stability criteria , as shown in
[ sec : tests ] .
because the convective form gives an approximation that is of the same order as the conservative form , in the present implementations of the numerical algorithm , we use the convective form for the non - linear terms in navier - stokes equation to ensure numerical stability .
the continuity and energy equations , on the other hand , are written in conservative form to conserve mass and energy .
the exact equations we solve in the algorithm can be found in appendix  [ app : equations ] .      in our numerical algorithm
, we use a combination of spectral filters in order to resolve the two principle drawbacks of spectral methods .
first , because of the non - linear character of the navier - stokes equations described above , we need to filter out the high - frequency modes in each time step to reduce the aliasing error .
the spectral filters ensure long - time stability of the algorithm .
second , when shocks are present in the solutions , the spectral coefficients do not converge exponentially and oscillations appear around the discontinuities ( gibbs phenomenon ) . introducing an additional spectral
filter increases the converge rate of the solutions .
indeed , it has been proven that the filtered solution converges to the correct entry solution and hence gives the correct shock properties .
( for more information see * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* and reference therein . )    suppose we want to apply a filter in the @xmath14-direction .
we first find the fourier coefficients @xmath106 according to equation  ( [ eq : fourier_expansion ] ) .
we then denote the filtered sum by @xmath107 where we use the exponential filter @xmath108 the parameter @xmath95 here is again the machine accuracy .
we choose @xmath109 so that the filtered sum approximates the original function very well and does not reduce the accuracy of the numerical solution .
the same filter is used in the radial direction , i.e. , @xmath110 where @xmath111 is chosen close to @xmath84 so the double filtered sum is @xmath112      spectral methods have been used successfully to study non - randomized perturbation , such as the tidal effects presented by @xcite .
later , @xcite described a method to add random perturbations to their initial conditions . in their simulation
, they generated 100 gaussian profiles randomly within the computation domain .
this method ensure that the spectral coefficients of the perturbed function converge exponentially , and avoids changing the direction of the characteristic at the boundary .    in our calculations
, we require the initial perturbations to be smooth , i.e. , we require the spectrum of the perturbations to converge exponentially .
one simple method to obtain such a perturbation is to generate random noise in spectral space , multiply the noise by an exponential filter , and transform the noise back to physical space .    to formulate this method
, we first generate a flat - noise spectrum , @xmath113 , which is totally random .
the perturbation is added to the original function by the following equation @xmath114f_0(r,\phi),\ ] ] where @xmath115 is the perturbed function , @xmath116 is the size of the perturbation , @xmath117 is the filtered sum @xmath118 as defined in the pervious subsection , and @xmath119 is the unperturbed function .
the order of filter , @xmath111 , controls the spacial scale of the perturbation . because @xmath120 is periodic in @xmath14
, we can simply use a @xmath14-independent function @xmath121 .
however , in the @xmath13-direction we do not want the perturbation to extend the boundaries .
we , therefore , set @xmath122 which is pre - computed by equation  ( [ eq : chebysehv_derivative_scaling ] ) , when we use the modified chebyshev collocation method .    in figure
[ fig : perturbation ] , we illustrate this method of introducing perturbations to an one - dimensional constant function @xmath123 .
the left plot uses a fourier basis with 256 collocation points . where the right plot uses a chebyshev basis with 257 collocation points .
all the lines have @xmath124 but different orders @xmath111 .
note that the extra rescaling for chebyshev collocation lowers the amplitude of the perturbations around the boundaries .      solving partial differential equations in a finite domain
usually requires dirichlet or / and neumann boundary conditions . when using finite difference methods , one can simply change the values of physical quantities at the boundary points to achieve dirichlet boundary conditions
alternatively , one can adjust the `` ghost points '' to achieve neumann boundary conditions .
unfortunately , these methods do not generally work for spectral methods .
indeed , changing the boundary points ( or ghost points ) effectively introduces step functions .
when discontinuities are present , the spectral coefficients do not converge exponentially and the spectral methods fail to produce stable solutions .
perturbations around the boundaries can also change the characteristic directions of the flow .
a naive dirichlet or neumann boundary treatment fails to take care of these oscillations between inflowing and outgoing characteristics . when the inflowing boundary conditions are not given , or when the outgoing boundary conditions are not consistent with the solutions in the computation domain , the system of differential equations is ill - posed and the algorithm diverges .
although we generate the initial perturbations in a way that they are small around the boundaries ( see the previous subsection ) , they can still propagate and reach the boundaries as time evolves .    in our numerical algorithm
, we introduce a new boundary treatment in the radial direction , which is a spatial filter .
this method forces each dynamic variable to approach smoothly to its boundary value so the characteristics directions at the boundaries are well - defined .
this ensures that any instabilities of the solution are not due to boundary conditions .
for example , consider a one - dimensional problem @xmath125\ ] ] for any functional form @xmath126 . if we want to apply a dirichlet boundary condition at the outer boundary , we choose some smooth monotonic function @xmath127 such that @xmath128 for interior points of the computational domain and @xmath129 at the boundary . at each time step
, we impose the boundary condition by the spatial filter @xmath130 where @xmath131 denotes the numerical approximation of our function at time @xmath132 and radial collocation point @xmath86 .
this filter makes the function @xmath49 approach its boundary value @xmath133 and produces a numerical boundary layer . rearranging
, the above step is equivalent to setting @xmath134(f_k^i - f_0).\ ] ] hence , it is equivalent to adding an extra source / sink term @xmath135 in the original equation @xmath136 - \frac{1 - h(r)}{\delta t}(f - f_0 ) \equiv f[f ] + \dot f_\mathrm{s},\ ] ] where @xmath137 is the time step ( see  [ sec : time_stepping ] ) . omitting @xmath126 in the above equation ,
it becomes @xmath138 .
the value of @xmath139/\delta t$ ] controls the converge rate of @xmath49 to @xmath133 , which is automatically proportional to the velocity , because @xmath140 .
we use an exponential filter that is similar to the spectral filter discussed in  3.3 . to impose an outer boundary condition
, we need the monotonically decreasing filter @xmath141.\ ] ] on the other hand , for the inner boundary , we use the monotonically increasing filter @xmath142.\ ] ] we can change the thickness of the numerical boundary layer by changing the order of the filter , @xmath111 .    this boundary treatment turns out to be very convenient in modeling non - reflective boundary conditions . when we choose the parameter @xmath111 to be equal to the number of collocation points , the boundary layer is thick enough to discard any outgoing waves but thin enough so that the interior solution is not affected significantly .    for applying neumann boundary conditions
, the addition of a ghost zone is not practical in spectral methods .
this is because chebyshev polynomials approximate the derivatives based on all the interior points .
@xcite presented a method which involves solving for the boundary values of physical quantities , so that their derivatives agree with the boundary conditions .
this is effectively a dirichlet boundary treatment with the boundary values depending on all the interior values at each time step .    to avoid numerical instabilities due to the neumann boundary conditions , @xmath143
, we choose another method that involves applying a spatial filter to each variable after taking the radial derivatives .
this is equivalent to replacing the radial derivatives @xmath144 by @xmath145    \left(\left.\frac{\partial f}{\partial r}\right|_{r_k}^{\ i } - f'_0\right)\ ] ] for the inner boundary , and @xmath146    \left(\left.\frac{\partial f}{\partial r}\right|_{r_k}^{\ i } - f'_0\right)\ ] ] for the outer boundary .
this ensures that the first derivatives around the boundaries are smooth .
we integrate the hydrodynamics equations with low - storage , explicit runge - kutta methods .
let @xmath147 be the right hand sides of hydrodynamic equations  ( [ eq : hydro_begin ] )  ( [ eq : hydro_end ] ) and let @xmath148 be the dynamic variable ; the superscript @xmath149 here stands for transpose .
the low - storage explicit runge - kutta methods have the general from @xmath150 where @xmath137 is the time step and @xmath151 .
all other @xmath152 s and @xmath153 s are coefficients that characterize the scheme and @xmath154 are the intermediate stages of @xmath155 . the method to obtain these coefficients
can be found in @xcite .
depending on the complexity of the problem , we choose between second order or third order runge - kutta , and third order or fourth order carpenter - kennedy runge - kutta methods .
the different algorithms are compared during the verification tests ( see  [ sec : tests_free_fall ] and fig .  [
fig : error_time ] below ) .
the third order runge - kutta scheme , proposed by williamson ( see * ? ? ?
* ) , turns out to be the most popular in spectral methods because of its efficiency and accuracy .
for this reason , we present here this scheme explicitly : @xmath156    recalling the definition of @xmath157 and @xmath158 in  [ sec : collocation ] , we define the courant - friedrich - lewy ( cfl ) time step in different directions independently , @xmath159 where @xmath160 is the sound speed .
let @xmath161 be the minimum grid separation .
we also define the viscously restricted time step as @xmath162 where @xmath163 is the kinematic viscosity coefficient . using these definitions ,
the maximum allowed time step @xmath137 is chosen adaptively by @xmath164 here @xmath165 is a constant that depends on the physical problem .
for example , for a free falling dust ring , the flow is very stable and @xmath165 could be chosen as large as 29 . for most of accretion problems with @xmath166 ,
@xmath165 is of order unity .
we have verified our numerical algorithm by comparing our numerical results to a number of test problems with analytical solutions .
these problems are designed to test the implementation of the different terms in the equations , such as the ones that describe gravity , pressure , and viscosity . in this section
, we describe these tests in details .
+    as a first test , we study the free - fall of an axisymmetric distribution of matter with no angular momentum , pressure , or viscosity .
this problem tests the implementation of gravity , the radial boundary conditions , and the conservation of mass in the radial direction .
also , we use this problem to evaluate the efficiency and stability of the different time - stepping schemes .
we set @xmath167 , @xmath168 , @xmath169 , and consider only newtonian gravity with @xmath170 .    in order to verify our numerical result
, we also solve the problem analytically .
using dimensionless quantities so that @xmath171 , we write the conservation of energy for a fluid element initially at @xmath172 as @xmath173 integrating over time , we obtain the trajectory @xmath174 of each fluid element in the implicit form @xmath175 we now consider conservation of mass , i.e. , at any time we require that @xmath176 evaluating @xmath177 by using equation  ( [ eq : r_0 ] ) , i.e. , @xmath178^{-1},\ ] ] the analytical solution for the density becomes @xmath179^{-1},\ ] ] where @xmath172 can be obtained implicitly using equation  ( [ eq : r_0 ] ) .
although this is an one dimensional problem , we simulate it in the two - dimensional domain @xmath180\times[-\pi , \pi]$ ] with @xmath181 collocation points .
the initial condition is a gaussian ring @xmath182\ ] ] with zero initial velocity . at the outer boundary ,
we use the standard neumann boundary conditions , i.e. , we set @xmath183 and @xmath184 for all times . moreover , because the characteristics at the inner boundary point towards the negative @xmath13-direction and we have neglected viscosity and pressure , we do not need to impose any explicit boundary conditions there . because filtering stabilizes the flow , we do not apply any filters in this test in order to compare how different time - stepping methods affect the stability of the algorithm .
the top panels of figure  [ fig : free_fall ] compare the results of the simulations to the analytical solutions ; the open circles denote the numerical results using the third order runge - kutta method and the solid lines are the analytical solution .
the numerical results are indistinguishable from the analytical solution .
the bottom panels of figure  [ fig : free_fall ] show the error between the numerical and analytical solution for the maximum stable time step .
we test four different time - stepping schemes : second order runge - kutta ( rk2 ) , third order runge - kutta ( rk3 ) , third order carpenter - kennedy ( rk3ck ) , and four order carpenter - kennedy ( rk4ck ) .
figure  [ fig : error_time ] shows the result of this test . in the left plot ,
the vertical axis shows the computation time .
the horizontal axis shows the dimensionless time - stepping factor @xmath185 ( see  [ sec : time_stepping ] ) .
the right plot shows the numerical errors , @xmath186 , at @xmath187 , for the same problem . for @xmath188 in rk2 , @xmath189 in rk3 , @xmath190 in rk3ck , and @xmath191 in rk4ck
, the solutions diverge so neither the computation time nor the error are plotted in the graphs .
this test demonstrates the ability of our algorithm to conserve mass to an accuracy better than a few parts in a million .
it also demonstrates the advantage of the third order runge - kutta method over other algorithms , when solutions of high accuracy are necessary .
+    we now study the ability of our algorithm to model correctly instabilities in hydrodynamic flows . in the absence of viscosity
, the necessary and sufficient condition for a rotating flow with angular velocity @xmath192 to be stable is @xmath193 which is known as rayleigh s criterion @xcite .
although rayleigh s criterion usually describes the stability condition in a couette flow , i.e. , for an incompressible fluid between two rotating cylinders , the criterion is also valid for rotating compressible fluids , when the unperturbed radial velocity vanishes everywhere in the flow .
this can be achieved by balancing the centrifugal and centripetal accelerations .
let @xmath194 be the square of the epicyclic frequency .
rayleigh s criterion is equivalent to requiring @xmath195 , because @xmath196 .
we define a modified newtonian gravity with a negative gravitational index @xmath197 such that the gravitational acceleration is @xmath198 setting @xmath171 , the corresponding `` keplerian '' velocity @xmath199 is given by @xmath200 substituting this into rayleigh s criterion , i.e. , equation  ( [ eq : rayleigh ] ) , we find that @xmath201 is the critical stability condition .
the growth rate of the instability is @xmath202 of course , the same result can be obtained by observing that the effective potential @xmath203 has no local minimum when @xmath204 ; here @xmath205 is the angular momentum of a fluid element with a unit mass .
we use a spatial resolution of @xmath181 collocation points to test the rayleigh criterion .
the initial conditions are with a uniform density , @xmath206 , and the velocity profile  ( [ eq : velocity ] ) .
random perturbations that are of order @xmath207 are added to all physical quantities and the boundary conditions are set to @xmath208 .    because rayleigh s criterion refers to an one - dimensional problem
, we discuss here explicitly the evolution of the @xmath209 mode .
this is equivalent to averaging over the azimuthal direction .
figure  [ fig : rayleigh ] shows the evolution of power at @xmath210 , @xmath211 , @xmath212 , and @xmath213 ( and @xmath214 ) of the density , i.e. , it is the plot of @xmath215 against time . when the flow is unstable , the perturbations grow very fast and
diverge . as required by rayleigh s criterion , flows with @xmath216 are stable to perturbations .
cccc 1.0 & 1.011210 & 1.000000 & 1.12095% + 1.1 & 1.062727 & 1.048808 & 1.32702% + 1.2 & 1.107763 & 1.095445 & 1.12449% + 1.3 & 1.153139 & 1.140175 & 1.13695% + 1.4 & 1.193408 & 1.183216 & 0.86140% + 1.5 & 1.235294 & 1.224744 & 0.86136%    in order to test our implementation of the thermal pressure and the numerical spreading of wavefronts , we neglect gravity , set all velocities equal to zero , and simulate the propagation of a sound wave .
we use the equation of state @xmath217 with @xmath218 and vary the polytropic index @xmath219 from @xmath87 to @xmath220 .
this pressure term decouples the energy equation from the navier - stokes equation and the sound speed is simply @xmath221 .
the initial density is @xmath222.\ ] ] we use @xmath181 collocation points and calculate the solution from @xmath223 to @xmath224 .
figure  [ fig : density_contour ] shows six gray - scale snapshots of the density for @xmath225 . the resulting sound wave propagates outward as a circle .
note that , because of our boundary treatment , the density wave is not reflected back as it propagates close to the boundaries . to measure the sound speed , we take the density profile at @xmath226 and trace the wavefronts .
the collocation points that correspond to the peak density are then used to calculate , via @xmath227-fitting , the sound speed .
table  [ tab : error_speed ] shows the @xmath227-fitted sound speed of the simulation .
compared to the analytical sound speed , the error is of order 1% .
the spreading of an axisymmetric viscous ring with small kinematic viscosity @xmath228 @xcite has become a standard test for numerical methods including both smoothed particle hydrodynamics ( sph ) and grid - based codes .
it has also often been used to guide studies of many other astrophysical problems , such as the fall - back disk after a supernova explosion ( see , e.g. , * ? ? ?
* ; * ? ? ?
* ) .    in the standard solution
, it is assumed that @xmath229 , so the viscosity tensor can be approximated by @xmath230 using conservation of mass , conservation of angular momentum , the fact that @xmath199 is always close to the keplerian value , and assuming that the kinematic viscosity coefficient @xmath231 is a constant , the analytical solution for the density , in our units , becomes @xmath232 where @xmath233 is a modified bessel function .
we perform our simulations with axisymmetric initial conditions .
we follow @xcite and use a typical value @xmath234 .
the energy equation is decoupled from the hydrodynamic equations as in the previous subsection .
we set @xmath225 , and choose @xmath235 such that @xmath236 .
the spatial resolution is @xmath181 and the time step factor @xmath237 .
we start with an initial density given by equation  ( [ eq : pringle ] ) at @xmath238 , which corresponds to @xmath239 .
the boundary conditions are @xmath240 and @xmath241 , which are the ones assumed in the standard solution .
figure  [ fig : pringle ] compares the analytical solution to the numerical solution .
the simulation shows that some concentric rings appear at the beginning .
they come from the relaxation effect as our initial velocities approach standard solution .
in fact , these additional structures have been found in other simulations ( for more information see * ? ? ? * ) , and decay away after about 24 rotations .
+    here we consider the thin disk problem and suppose that the disk is able to settle to a steady - state structure . by assuming an @xmath94-viscosity law
, @xcite solved the local disk structure analytically .
their work has been highly cited for studies in accretion disks .
( see frank , king , & raine 2002 and reference therein ) .    in our simulation
, we solve the hydrodynamic equations  ( [ eq : continuity ] )  ( [ eq : energy ] ) including the energy equation .
the kinematic viscosity coefficient is given by @xmath242 the sound speed is given by @xmath243 and the disk scale height is @xmath244 .
we , also , assume the vertical optical depth of the disk to be @xmath245 , where the rosseland mean opacity @xmath246 is given by kramers law @xmath247    based on the above assumption and using the fact that @xmath228 is small , the shakura - sunyaev disk solution is given by @xmath248 where @xmath249 , @xmath250 , @xmath251 , and @xmath252 , with @xmath253 being the radius of the central object .
considering the flow around a standard neutron star with a mass of @xmath254 , and a radius of @xmath255 , we setup the simulation with @xmath256 and @xmath257 .
the initial conditions for density and energy are as the shakura - sunyaev disk solution with @xmath258 , @xmath259 , and @xmath260 .
we set the initial radial velocity to zero and the initial azimuthal velocity to be keplerian .
perturbations were added to all variables with amplitude @xmath261 and order @xmath262 .
the simulation runs with @xmath263 collocation points up to @xmath264 , which is approximately @xmath265 viscous time scales .    in figure  [ fig : shakura_sunyaev ]
, we show our numerical steady solution for @xmath266 , at @xmath267 ; note that we use the magnitude of the radial velocity in order to plot it in log - log scale .
the numerical values are different from the shakura - sunyaev solution by a few percent .
we point out explicitly that the pressure term in the navier - stokes equation is neglected in obtaining the analytical solution .
although the pressure term does not transport angular momentum , the effect of pressure compared to those of viscosity is proportional to @xmath268 . since @xmath269 in our simulation ,
the pressure effects can account for the difference between the analytical and numerical solution .
+    as we mentioned in  [ sec : tests_pringle ] , the viscous spreading ring has become a standard test for numerical simulations . in these simulations ,
additional structures always appear , such as the concentric rings in figure  [ fig : pringle ] .
we attributed the presence of these concentric rings to relaxation effects of the initial conditions .
@xcite , on the other hand , showed that the concentric rings that appear in sph simulations using the artificial viscosity given by @xcite are numerical artifacts .
later , @xcite used perturbation methods to show that viscous spreading rings are unstable to non - axisymmetric perturbations .    assuming a compressible , pressureless , and viscous fluid , the equations used in @xcite are the continuity equation  ( [ eq : continuity ] ) and the navier - stokes equation  ( [ eq : navier_stokes ] ) , with zero pressure . by setting @xmath163 to be constant and @xmath270 ,
the first order instability is an one - armed spiral , whereas the second order instability is a superposition of an one - armed and a two - armed spirals .
if we define a function @xmath271 where @xmath272 is the keplerian angular velocity , then @xmath273 measures the first order perturbation amplitude .
its dispersion relation is @xmath274 where @xmath86 is the radial wavenumber and @xmath275 is the standard solution  ( [ eq : pringle ] ) . assuming @xmath276
, it follows that the condition for instability is @xmath277 and the growth rate is @xmath278 in order to test this claim , we carried out a test with the same condition as speith and kley s rh2d simulation ( a radiative hydrodynamic code ; see * ? ? ?
the only differences are in the initial perturbations and a small constant background term in the density , i.e. , the setup is the same as in
[ sec : tests_pringle ] but we add initial perturbations by the method described in  [ sec : perturbation ] with order 3 and magnitude 0.001 .
the additional constant background term in the density varies from 0.1 to 0.001 depending upon the resolution , which keeps the solution stable .
we perform the simulation with resolution @xmath279 , @xmath181 , @xmath263 , and @xmath280 .
figure  [ fig : speith_kley_compare ] shows the density contours for different resolutions at time @xmath281 .
it is clear that the direction of the spiral in low resolution is different then in high resolution .
we confirm this result with speith and kley ( private communication ) , i.e. , that the transition radius between leading and trailing spirals vary as the resolution changes .
figure  [ fig : speith_kley ] is the density contour of the simulation with @xmath263 collocation points and 0.001 background density , at different times . at @xmath282 , some concentric rings due to relaxation effects are seen . at @xmath283 ,
a one - armed spiral starts to form at the inner disk .
the spiral is fully developed by @xmath284 .    in order to find out the unstable wave number , we plot in figure  [ fig : speith_kley_evolve ] the contour of density along @xmath226 against time
region i shows the relaxation effect , where the relaxation waves propagate outwards . in region
ii , the solution has relaxed to the standard solution .
later on , the speith - kley instability starts to develop , which is shown in region iii .
we can estimate the wavelength of the fully developed spirals , which varies from @xmath261 to @xmath285 . for region
iv , the unstable wavelengths are too short to be resolved in our numerical method .
finally , in figure  [ fig : speith_kley_modes_evolve ] we plot the first 6 modes , i.e. , @xmath286 , of @xmath287 .
the late time behavior of our solution agrees with figure  8 in @xcite . to compare our numerical result with the analytical growth rate  ( [ eq : growth_rate ] ) , we @xmath227-fit the slope of the @xmath288 mode in figure  [ fig : speith_kley_modes_evolve ] between @xmath289 and @xmath290 , which gives @xmath291
. that corresponds to unstable wavenumber @xmath292 .
it agrees with the width of the spiral @xmath293 as shown in figures  [ fig : speith_kley ] and [ fig : speith_kley_evolve ] .
physically , the viscous spreading ring problem is an important guide to understanding the transport of angular momentum in accretion disks .
we have independently verified the speith - kley instability : a cold viscous disk is unstable to non - axisymmetric perturbations .
we described a numerical method based on a pseudo - spectral algorithm for studying the rapid variability properties of two - dimensional , viscous , hydrodynamic accretion disks .
we demonstrated the ability of the spectral methods to handle correctly non - reflective boundary conditions and different stability conditions .
we verified the implementation of the algorithm using various test problems .
also , we confirmed the non - axisymmetric instability of viscous spreading rings discovered by speith and kley .
spectral methods calculate the time evolution of a solution as an interaction of different waves . from a mathematical point of view
, this approach naturally agrees with existing methods to study non - linear equations .
it helps us to confirm directly the result of linear mode analysis as well as turbulence theories . from a computational point of view , these methods are high order and produce accurate result in most problems .
it is straightforward to extend the current algorithm to simulate 3d mhd accretion disks . in particular , because of the high order of the spectral methods , we can solve directly for the vector potential and not for the magnetic field , in order to guarantee that the resulting field will be free of divergence at each time step . also , spectral methods can be used to solve self - gravity problem without increasing significantly the computation time .
finally , and most important , form a physical point of view , our algorithm provides another tool to set up numerical experiments and test astrophysical models .
it is useful to confirm independently the results from other numerical simulations as well as test new models .
as we describe in  [ sec : non - linear ] , we employ a convective - conservative mixed method .
the non - linear term @xmath294 in the euler equation is implemented in convective from , and all other terms are in conservation form .
@xmath295 here , the notation @xmath296 denote partial derivative with respect to time .
the other notations @xmath297 and @xmath298 denote the numerical derivative operators .
hence , the notation @xmath299 means , we first take a numerical derivative of the variable @xmath300 and multiply the result with @xmath300 , which is in convective form . on the other hand ,
@xmath301 means , we first use a temporary variable to store the produce @xmath302 , apply the procedure to calculate the numerical derivative on it , and then divide it by @xmath13 .
this is the conservative form .
the viscosity tensor @xmath303 in the above equation has the following general form @xmath17 as we describe before , @xmath18 , @xmath19 , and @xmath20 are coefficient of radiative , bulk , and shearing viscosity .
the strain rate tensor @xmath21 written in cylindrical coordinate becomes @xmath304 and @xmath305 in cylindrical coordinate is @xmath306 for completeness , we provide again the viscous dissipation rate @xmath307 the functional forms of @xmath7 , @xmath18 , @xmath19 , @xmath20 , @xmath11 , @xmath12 , and @xmath16 can be change easily depend upon the physical assumption ( where the defaults are described in  [ sec : equations ] ) .
c. and d. p. acknowledge the support from a nasa atp grant nag-513374 .
f. . acknowledges support by nasa through hubble fellowship grant hf-01156 from the space telescope science institute , which is operated by the association of universities for research in astronomy , inc .
, under nasa contract nas 5 - 26555 .