예제 #1
0
    def plot_pe(self):
        """ calculating number of entries with given energy"""
        e_array = sorted(self.E[self.nts:])
        pe_list = []
        e_values = []
        tmp_i = e_array[0]
        counter = 0
        for i in e_array:
            if not i in e_values:
                e_values.append(i)
        e_values = sorted(e_values)

        for i in range(len(e_values)):
            counter = 0
            for j in e_array:
                if e_values[i] == j:
                    counter += 1
            pe_list.append(counter)
        semilogy(e_values, pe_list)
        self.e_array = e_array
예제 #2
0
	def plot_pe(self):
		""" calculating number of entries with given energy"""
		e_array = sorted(self.E[self.nts:])
		pe_list = []
		e_values = []
		tmp_i = e_array[0]
		counter = 0
		for i in e_array:
			if not i in e_values:
				e_values.append(i)
		e_values = sorted(e_values)

		for i in range(len(e_values)):
			counter = 0
			for j in e_array:
				if e_values[i] == j:
					counter += 1
			pe_list.append(counter)
		semilogy(e_values, pe_list)
		self.e_array = e_array
예제 #3
0
eigenvalues = None
rho = None
sqsum = None
for name in os.listdir(path):
    if "eigenvalues" in name:
        eigenvalues = np.fromfile(path + name, dtype=np.float64)
        print eigenvalues

    if "grid" in name:
        print path + name
        rho = np.fromfile(path + name, dtype=np.float64)
        print rho

    if "sqsum" in name:
        sqsum = []
        fileInput = open(path + name)
        for line in fileInput:
            sqsum.append(float(eval(line)))
        sqsum = np.asarray(sqsum)
        figure()
        semilogy(sqsum)
        title("Sum of squared off-diagonal elements")


for name in os.listdir(path):
    if "state" in name:
        plotSolution(path, name, rho, eigenvalues)


raw_input("press enter")
예제 #4
0
path = "/scratch/henriasv/FYS3150/project2/" + sys.argv[1]

eigenvalues = None
rho = None
sqsum = None
for name in os.listdir(path):
    if "eigenvalues" in name:
        eigenvalues = np.fromfile(path + name, dtype=np.float64)
        print eigenvalues

    if "grid" in name:
        print path + name
        rho = np.fromfile(path + name, dtype=np.float64)
        print rho

    if "sqsum" in name:
        sqsum = []
        fileInput = open(path + name)
        for line in fileInput:
            sqsum.append(float(eval(line)))
        sqsum = np.asarray(sqsum)
        figure()
        semilogy(sqsum)
        title("Sum of squared off-diagonal elements")

for name in os.listdir(path):
    if "state" in name:
        plotSolution(path, name, rho, eigenvalues)

raw_input("press enter")