|extern double quantum_groundstate(quantum_reg *reg, double epsilon, quantum_reg H(MAX_UNSIGNED, double), int solver, double stepsize);|
This function returns the ground state energy of the Hamiltonian implemented in the function H. The quantum register reg should have been initialized with quantum_new_qureg_size and filled with random amplitudes for best results. Upon return, reg will contain the ground state of the Hamiltonian. The desired absolute precision of the energy is controlled with epsilon. The variable solver allows to choose from different algorithms and can take any of the following values:
|QUANTUM_SOLVER_LANCZOS||A straight-forward implementation of the Lanczos algorithm. As this implementation does not perform reorthogonalization, results may become unreliable for very large system sizes.|
|QUANTUM_SOLVER_LANCZOS_MODIFIED||A modified (and slower) version of the Lanczos algorithm [Dagotto, 1985] that is numerically stable.|
|QUANTUM_SOLVER_IMAGINARY||Imaginary time evolution using quantum_rk4.|
Generally speaking, QUANTUM_SOLVER_LANCZOS is the fastest algorithm, but QUANTUM_SOLVER_LANCZOS_MODIFIED and QUANTUM_SOLVER_IMAGINARY are more reliable. Finally, the variable stepsize only needs to be supplied for QUANTUM_SOLVER_IMAGINARY and should correspond to the inverse of the typical energy scale of the Hamiltonian. Note that using the ground state solver will almost certainly require the use of double-precision arithmetic, which can be enabled by the --with-complex-type="double _Complex" configure switch.
The transverse Ising chain in a one-dimensional spin model is
described by the Hamiltonian