This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#密度(spin)相関函数を計算してFourier変換するプログラム | |
''' | |
sitesize,elecsize,basissizeはint型のparameterで | |
basisseqは演算子の行列表示を作るのに使う基底の列で | |
たとえば4siteで | |
1234←siteindex | |
↑ ↓ ←電子の状態 | |
を配列として(配列の行indexがsite index) | |
np.array( | |
[[1,0,0,0],←upspinがあるところが1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.fftpack import fft,ifft | |
def CalCorFFT(sitesize,elecsize,basisseq,basissize,gsvec): | |
numupseq=(np.tile(np.identity(basissize),(sitesize,1))*basisseq.reshape(basissize,2*sitesize)[:,:sitesize].T.reshape(sitesize*basissize,1)).reshape(sitesize,basissize,basissize) | |
numdownseq=(np.tile(np.identity(basissize),(sitesize,1))*basisseq.reshape(basissize,2*sitesize)[:,sitesize:].T.reshape(sitesize*basissize,1)).reshape(sitesize,basissize,basissize) | |
sumspin=numupseq+numdownseq | |
densitycor=sumspin-(elecsize/sitesize)*np.tile(np.identity(basissize),(sitesize,1,1)) | |
spincor=(numupseq-numdownseq)/2 | |
nmq=fft(densitycor@gsvec,sitesize,axis=0) | |
smq=fft(spincor@gsvec,sitesize,axis=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subroutine assert(condition) | |
implicit none | |
logical, intent(in) condition | |
int :: a=0 | |
if(condition==.false.) a=1/a | |
end subroutine assert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import numpy as np | |
def ve(x, xerror): | |
if abs(x) > xerror: | |
round_xerror = np.float("{:.1g}".format(xerror)) | |
if round_xerror < 1: | |
exponent_xerror = np.int(np.floor(np.log10(round_xerror))) | |
mantissa_xerror = np.int(round_xerror / (10 ** exponent_xerror)) | |
round_x = np.round(x, -exponent_xerror) | |
specifier_x = "." + str(-exponent_xerror) + "f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{figure}[htbp] | |
\begin{minipage}{0.5\hsize} | |
\centering | |
\includegraphics[width=70mm]{fig1.png} | |
\caption{caption1} | |
\label{fig1} | |
\end{minipage} | |
\begin{minipage}{0.5\hsize} | |
\centering | |
\includegraphics[width=70mm]{fig2.png} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -A nplist | |
nplist["node12"]=8;nplist["node13"]=8;nplist["node14"]=8;nplist["node15"]=8 | |
nplist["node16"]=12;nplist["node17"]=12;nplist["node18"]=12 | |
nplist["node19"]=12;nplist["node20"]=12;nplist["node21"]=12 | |
nplist["node22"]=12;nplist["node23"]=12;nplist["node24"]=12;nplist["node25"]=12 | |
nplist["node26"]=24;nplist["node27"]=24 | |
nplist["node28"]=28;nplist["node29"]=28 | |
nplist["node30"]=44;nplist["node31"]=44;nplist["node32"]=44;nplist["node33"]=44 | |
for i in {12..33} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import norm | |
import sys | |
import numpy as np | |
total=584#DC1 数物系科学 | |
#total=342#DC1 化学 | |
rv = norm(loc=3,scale=0.6) | |
print("Your rank is {}/{}.".format(np.int(np.trunc(rv.sf(float(sys.argv[1]))*total)),total)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
io = open("zvo_eigenvec_0_rank_0.dat") | |
Lanczos = read(io, Int32) | |
Hilbert = read(io, Int64) | |
discard = read(io, ComplexF64) | |
#1st component is useless 0+0*im | |
evec = zeros(ComplexF64, Hilbert) | |
for i in 1:Hilbert | |
evec[i] = read(io, ComplexF64) | |
end | |
println(Lanczos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from sys import argv | |
from numpy.random import rand, randn | |
fig = plt.figure(figsize=(8, 6)) | |
print(plt.rcParams['font.family']) | |
plt.rcParams['font.family'] = "Harrington" | |
samples = 100 | |
x = rand(100) | |
y = rand(100) |
OlderNewer