def eigvals(self,basespace=None,mode='*'):
'''
This method returns all the eigenvalues of the Hamiltonian.
Parameters
----------
basespace : BaseSpace, optional
The base space on which the Hamiltonian is defined.
mode : string,optional
The mode to iterate over the base space.
Returns
-------
1d ndarray
All the eigenvalues.
'''
if basespace is None:
result=eigh(self.matrix(),eigvals_only=True)
else:
result=asarray([eigh(self.matrix(**paras),eigvals_only=True) for paras in basespace(mode)]).reshape(-1)
return result
评论列表
文章目录