Lab Lecture materials & Programs

This page includes 'standalone' and 'tklib' programs. You may easily follow the codes of the standalone programs and modify them for your purposes.
The tklib programs would be more difficult to understand but more useful for research.

以下には、'standalone' プログラムと 'tklib' プログラムがあります。
'standalone' プログラムは、anaconda python 3.xの標準モジュールだけで動作します。
また、 比較的小さい1ファイルのみのプログラムなので、コードを追って理解し、それぞれの研究目的に応じて改変して使うこともできると思います。
'tklib' プログラムは大きく難解なものが多いですが、研究の実践で有用なプログラムには必要になってきます。



COE Seminar 2020



Open materials and programs
公開講義資料、pythonプログラム等

  1. Lecture materials and related python programs (standalone)
    講義資料、関連pythonプログラム

  2. 2019年度 Materials Research Meeting チュートリアル
    第一原理計算でなにがわかるのか (Japanese)

  3. 2019年度 応用物理学会 結晶工学分科会 結晶工学スクール
    第一原理バンド構造を用いた材料開発(実践編) (Japanese)

  4. 2012年度 応用物理学会 薄膜・表面物理分科会 第41回薄膜・表面物理基礎講座
    実験補完ツールとしての材料シミュレーション入門 (Japanese)

  5. 2006年度 日本セラミックス協会 第14回セラミックス基礎秋季教室
    コンピューターシミュレーションと機能セラミックス研究 Vol .1 (Japanese)
    コンピューターシミュレーションと機能セラミックス研究 Vol .2
    (Japanese)

  6. 2019年度 ICANS28 Oxide thin-film transistor tutorial slides (English)

  7. 2019年度Q2 計算材料学特論 (English+Japanese)
     (2019Q2 Computational Materials Science)

        some small python programs are available
        一部、pythonの参考プログラムあり

  8. 2019年度Q3 統計力学(C) 神谷担当分 (量子統計〜応用) (Japanese)

        some small python programs are available
        一部、pythonの参考プログラムあり

  9. 2019年度Q2 セラミックス概論 「透明導電体」 (Japanese)

  10. 2006年度 横浜国立大学物質工学科 無機固体化学 (Japanese)

     


python ノート



Lab inside only
研究室内限定プログラム


Standalone python (small) programs

The following programs run only with standard modules of anaconda python 3.x.  (No need to install Programs and no need tklib)
以下のプログラムは、anaconda python 3.xの標準モジュールのみで動作します

  1. Difficulty level: 4
    Calculate carrier densities, Fermi level etc vs temperature Ne(T), Nh(T), ND-(T), NA+(T), and EF(T) from DOSCAR of VASP
    VASPのDOSCARからキャリア密度やフェルミ準位を計算
      (Japanese)
    Algorisms:
    Bisection method to refine EF
                        scipy.quad() (accuracy guaranteed, slow) or implemented trapezoidal method (accuracy not guaranteed, fast) for numerical integration
     
  2. Difficulty level: 5
    Calculate the contributes of electrons for finite temperature energy and entropy from DOSCAR of VAPS
    VASP の DOSCARから、温度Tにおける電子の励起エネルギー・エントロピーを計算
    (English+Japanese)
    Algorisms:
    Newton method to refine EF
                        scipy.quad() for numerical integration
     
  3. Difficulty level: 4
    縦MR, 横MRから弱(反)局在、Drude型電子−正孔混合伝導のキャリア濃度、移動度をもとめる
    Algorisms: scipy.optimize (SIMPLEX method) for non-linear least-squares fitting
     
  4. Difficulty level: 3 ◆◆
    縦MR、横MRから弱(反)局在モデルのフィッティングを行うe
    Algorisms: scipy.optimize (SIMPLEX method) for non-linear least-squares fitting
     
  5. Difficulty level: 3
    Analyze carrier densities and mobilities for the two carrier model of longitudinal and transversal magnetoresistance
    縦MR, 横MRから電子−正孔混合伝導のキャリア濃度、移動度をもとめる
    (Japanese)
    Algorisms:
    scipy.optimize (SIMPLEX method) for non-linear least-squares fitting
    Caution: Carefully check the possibility of overfitting
     
  6. Difficulty level: 3 ◆◆◆
    Calculate energy level of H-like 1s orbital using Slator's Xa exchange potentiall

    Algorisms: Integration by scipy.quad() for radial distribution functions
                        scipy.optimize (SIMPLEX method) for variational principle calculation of R(r) 1s function           
     
  7. Difficulty level: 2
    Calculate XRD pattern for superlattice from a superlattice model
    層構造モデルから超格子のXRDパターンを計算
    (English+Japanese)
    Algorisms:
    python-standard complex variable type / functions
     
  8. Difficulty level: 2
    逆畳み込み (Deconvolution) (Japanese)
    Algorisms:
    Implemented Gauss-Seidel method (recommended) and Jacobi method (just for comparison).
    Caution: numpy/scipy.deconvolve() and fft method are implemented but should not be used
     
  9. Difficulty level: 1
    Analyze a depth profile of carrier traps from C-V data of a diode
    ダイオードのC-V特性から、キャリアトラップ密度の深さ方向分析を行う
    (English+Japanese)
    Algorisms:
    numerical differentiation is done by the central difference method
    Caution: Numerical differentiation should not be done by forward or backward difference method, which looses the accuracy
     
  10. Difficulty level: 1
    Analyze a depth profile of carrier traps from C-V data of a diode
    ダイオードのC-V特性から、キャリアトラップ密度の深さ方向分析を行う
    (English+Japanese)
    Algorisms:
    numerical differentiation is done by the central difference method
    Caution: Numerical differentiation should not be done by forward or backward difference method, which looses the accuracy 
     
  11. Difficulty level: 0
    Plot band diagram of a Schottky junction
    Algorisms: None

python / perl programs using tk libraries and databases

These programs required tk libraries (tklib) to run. tklibs are included in the Programs.zip 
at \Programs\Perl\lib for perl tklib and \Programs\python\lib for python tklib.
以下のプログラムは、anaconda python 3.xの標準モジュールの他、Programs.zipに含まれているtklibが必要です。
tklibはPrograms.zip内の \Programs\Perl\lib に Perl用 tklib、\Programs\python\libに python用 tklib が含まれています。

(A) Get started 
     準備

  1. Download Programs.zip and burst it, e.g., to d:\Programs (recommended) c:\Programs, etc.
    The path should not include blank characters and double-byte characters like Japanese and Chinese;
    otherwise, some perl program will not run.
  2. Install activestate perl to run perl programs
    Make a library path to \Programs\perl\lib
  3. Install anaconda python 3.x to run python programs.
    Make a library path to \Programs\python\lib

(A) CIF reader and Crystal Object modules
     CIFリーダ、結晶構造オブジェクトモジュール

  1. Download inside/cif/cif.py and a test CIF file inside/cif/igzo.cif
  2. Run
    python cif.py igzo.cif
    You will see the crystal structure information on display.

How to make a program:

  1. See html for a sample program to read a cif file.
  2. Import tklibraries, tkCIF, tkCrystal, tk AtomType etc.
  3. Read a cif file like and get a CIF object:
    cifdata = cif.ReadCIF(filename, find_valid_structure = 1)
  4. Print the crystal structure information
    cifdata.Print()
  5. Get a Crystal Object.
    cry = cifdata.GetCrystal()
  6. Get crystal structure information from the Crystal Object.
    Read tkcrystal.PrintInf for details.
    cry = self
    print("CIF path = ", cry.path)
    print("CrystalName = ", cry.CrystalName(Create = 1))
    print("SampleName = ", cry.SampleName(Create = 1))
    # print("CrystalName = ", cry.__CrystalName)
    # print("SampleName = ", cry.__SampleName)

    print("")
    print("Symmetry:")
    ls = cry.LatticeSystem()
    print("Lattice system: ", ls)
    la = cry.LatticeAxis()
    print("Lattice axis: ", la)
    SPGName, iSPG, iSet = cry.GetSpaceGroupInf()
    print("Space group: [{}] #{} set {}".format(SPGName, iSPG, iSet))
    for i in range(self.nSymmetryOperation()):
    sym = self.SymmetryOperation(i)
    print(" {}: {}".format(i,sym))

    print("")
    print("Real space:")
    a, b, c, alpha, beta, gamm = cry.LatticeParameters()
    print("cell: {} {} {} A {} {} {}".format(a, b, c, alpha, beta, gamm))
    gij, Rgij = cry.Metrics()
    print("Metrics gij:")
    pprint(gij)
    aij = cry.LatticeVectors()
    print("Lattice vectors aij:")
    pprint(aij)
    # cry.CalculateVolume()
    V = cry.Volume()
    print("Volume: {} A^3".format(V))

    print("")
    print("Reciprocal space:")
    ra, rb, rc, ralpha, rbeta, rgamm = cry.ReciprocalLatticeParameters()
    print("cell: {:12.6f} {:12.6f} {:12.6f} A^-1 {} {} {}".format(ra, rb, rc, ralpha, rbeta, rgamm))
    print("Metrics Rgij (A):")
    pprint(Rgij)
    Raij = cry.ReciprocalLatticeVectors()
    print("Lattice vectors Raij (A^-1):")
    pprint(Raij)
    RV = cry.ReciprocalVolume()
    print("Volume: {} A^-3".format(RV))

    print("")
    print("Properties:")
    cc = cry.ChemicalComposition()
    sumcc = cry.SumChemicalComposition()
    fu = cry.FormulaUnit()
    MW = Round(cry.UnitcellWeight(), 6)
    d = cry.Density()
    ad = cry.AtomDensity()
    print(" Chemical composition: ", cc)
    print(" Sum chemical composition: ", sumcc)
    print(" Formula unit: ", fu)
    print(" Unit cell weight: ", MW)
    print(" Density: ", d, "g/cm3")
    print(" Atom density: {:12.6e} /cm3".format(ad))

    print("")
    print("Atom types:")
    AtomTypes = self.AtomTypeList()
    for t in AtomTypes:
    typea = t.AtomType()
    typeo = t.AtomTypeOnly()
    charge = t.Charge()
    AN = t.AtomicNumber()
    M = t.AtomicMass()
    print(" %4s (%2s) Z=%8.4f [#%3d M=%6.4f]" % (typea, typeo, charge, AN, M))

    print("")
    print("Asymmetric atom sites:")
    AtomSites = self.AtomSiteList()
    for atom in AtomSites:
    label = atom.Label()
    atomname = atom.AtomName()
    atomname0 = atom.AtomNameOnly()
    charge = atom.Charge()
    pos = atom.Position()
    occ = atom.Occupancy()
    id = atom.IdAsymmetricAtomSite()
    m = atom.Multiplicity()
    print(" %3d: %5s: %4s Z=%6.3f (%6.3f, %6.3f, %6.3f) occ=%8.4f m=%d" 
            % (id, label, atomname, charge, pos[0], pos[1], pos[2], occ, m))

    print("")
    print("Expanded atom sites:")
    AtomSites = self.ExpandedAtomSiteList()
    for atom in AtomSites:
    label = atom.Label()
    atomname = atom.AtomName()
    atomname0 = atom.AtomNameOnly()
    charge = atom.Charge()
    pos = atom.Position()
    occ = atom.Occupancy()
    id = atom.IdAsymmetricAtomSite()
    m = atom.Multiplicity()
    print(" %3d: %5s: %4s Z=%6.3f (%6.3f, %6.3f, %6.3f) occ=%8.4f m=%d" 
            % (id, label, atomname, charge, pos[0], pos[1], pos[2], occ, m))