Skip to content

Instantly share code, notes, and snippets.

@ultimatile
Created August 12, 2017 19:39
Show Gist options
  • Save ultimatile/72cf9de81da3c42775b90d0991273fa9 to your computer and use it in GitHub Desktop.
Save ultimatile/72cf9de81da3c42775b90d0991273fa9 to your computer and use it in GitHub Desktop.
script to extract an eigenvector from HΦ output binary data as numpy.ndarray
import numpy as np
with open('CHECK_Memory.dat') as f:
dim= f.read()
dimH= int(dim[25:-53])
dimvec=dimH+1
dvec=[("{}".format(i), np.complex128) for i in np.arange(dimvec)]
dvec=[('lan', np.int32),('hil', np.uint64)]+dvec
data=np.fromfile("zvo_eigenvec_0_rank_0.dat",dtype=np.dtype(dvec))
print(np.array(list(data[0]))[3:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment