Functions  
void  GenerateChebyshevMatrix (itype N, DenseMatrix< complex > &M) 
Computes an NxN matrix, where is the coefficient of in the 'th Chebyshev polynomial.  
void  ResizeChebyshevMatrix (itype N, DenseMatrix< complex > &M) 
Efficiently resizes an existing Chebyshev polynomial matrix to NxN, using the coefficients already computed.  
void  GenerateChebyshevEvolutionVector (double time, itype N, DenseVector< complex > &V) 
Computes an Nelement vector, where is the coefficient of the 'th Chebyshev polynomial in the expansion of .  
int  ChebyshevPrep (double timestep, double prec, DenseVector< complex > &PowerCoeffs, DenseVector< double > &CoeffsBoundSeq) 
Precomputes the coefficients needed to evolve a state using ChebyshevStep(), for time timestep , with accuracy prec .  
template<typename T>  
int  ChebyshevStep (const State &initial, State &final, DenseVector< complex > &PowerCoeffs, DenseVector< double > &CoeffsBoundSeq, const T &Hamiltonian, double E_bound, double prec) 
Transforms the quantum state initial by , placing the result in final . Requires precomputation by ChebyshevPrep().  
template<typename T>  
int  ChebyshevEvolve (const State &initial, State &final, double time, const T &Hamiltonian, double E_bound, double prec=1e10) 
Evolves the quantum state initial for a single step of duration time according to Hamiltonian , placing the result in final .  
template<typename T>  
int  ChebyshevStepEvolve (const State &initial, State &final, double time, double maxtimestep, const T &Hamiltonian, double E_bound, double prec=1e10) 
Evolves the quantum state initial ==> final , for duration time , in steps no longer than maxtimestep , according to Hamiltonian . 

Computes an NxN matrix, where is the coefficient of in the 'th Chebyshev polynomial.
The matrix generated by GenerateChebyshevMatrix() represents all the Chebyshev polynomials of order The coefficients are computed efficiently (in time) using the recursion relation , with and . 

Efficiently resizes an existing Chebyshev polynomial matrix to NxN, using the coefficients already computed. The structure of the Chebyshev polynomial recursion relation means that:


Computes an Nelement vector, where is the coefficient of the 'th Chebyshev polynomial in the expansion of . Evolving a state vector using the Chebyshev polynomial approximation requires first expanding in Chebyshev polynomials. The expansion is computed by GenerateChebyshevEvolutionVector(), and the coefficient of in the expansion is stored in . The coefficients can be worked out analytically, and turn out to be Bessel functions:
The Bessel functions are computed all at once using the Gnu Scientific Library's gsl_sf_bessel_Jn_array() function. 

Precomputes the coefficients needed to evolve a state using ChebyshevStep(), for time
ChebyshevPrep() constructs the coefficients of a polynomial in a Hamiltonian that approximates (where is given by
The order of approximation required (N) depends on both
Because the coefficient sequence ( ) is not necessarily decreasing in absolute value, we also compute a bounding sequence ( , or The bounding sequence allows the routine that actually applies repeatedly to a state (ChebyshevStep()) to do dynamic error estimation. Since will typically be very contracting (all eigenvalues will be closer to zero than to 1 or 1), the norm of will decrease rapidly with . When it decreases enough (relative to the bounding sequence of the coefficients), ChebyshevStep() can terminate the expansion. 