netket.exact.full_ed¶
-
netket.exact.
full_ed
(operator, *, compute_eigenvectors=False)[source]¶ Computes all eigenvalues and, optionally, eigenvectors of a Hermitian operator by full diagonalization.
- Parameters
operator (
AbstractOperator
) – NetKet operator to diagonalize.compute_eigenvectors (
bool
) – Whether or not to return the eigenvectors of the operator.
- Returns
Either w or the tuple (w, v) depending on whether compute_eigenvectors is True.
Example
Test for 1D Ising chain with 8 sites.
>>> import netket as nk >>> hi = nk.hilbert.Spin(nk.graph.Chain(8), s=1/2) >>> hamiltonian = nk.operator.Ising(hi, h=1.0) >>> w = nk.exact.full_ed(hamiltonian) >>> w.shape (256,)