Code Monkey home page Code Monkey logo

tdep-tutorials's Introduction

TDEP tutorials

Tutorials for the Temperature Dependent Effective Potentials code and method.

Contents

  • Preparations, file parsing, potentials energy surfaces for testing: here
  • Basic handling of the TDEP binaries: here
  • Self-consistent sampling with sTDEP: here
  • Phonon thermodynamics: here
  • Thermal conductivity: here
  • Spectral functions: here
  • Infrared spectroscopy: here
  • Raman spectroscopy: here

tdep-tutorials's People

Contributors

flokno avatar jageo avatar johkl avatar jpabatista avatar mjv500 avatar orbitalc avatar prakayastha avatar robertafarris93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tdep-tutorials's Issues

Interface with phono3py

Is there any ready solution (function/command, maybe in tdeptools) to convert force constants from phono3py fc2.hdf5 (fc3.hdf5) files to TDEP infile.forceconstant (infile.forceconstant_thirdorder)?

ups

there is a specific error that comes up just for this one material (anthracene) when using "extract_forceconstants"

ERROR                                                                                                                                                                                                              
exit code 4: symmetry error                                                                                                                                                                                                                                                                                                                                                                                                           Bad operation singlets                                                                                                                                                                                                                                                                                                                                                                                                                    occurs in file: lo_symmetry_of_interactions_nullspace.f90                                                                                                                                                          
occurs on line: 643                                                                                                                                                                                                   
active rank: 0 out of 1                                                                                                                                                                                    
ERROR STOP 4      

I refined the structure (either ase_geometry or refine_structure) and the correct space-group is found and even tried different unit cell conventions but the error persists. It does not occur for any other material I tried so far.

Thanks for looking into it! :)
infiles.zip

proposal to change code to sum mode 3+4

"# Which mode are we interested in?\n",

# spectral function = imaginary part of G:

epsilon = eps_inf

# Which mode are we interested in?
for s_mode in (3, 4):
    
    # angular frequency:
    ws = df_intensity.frequency.iloc[s_mode]

    Z = df_intensity.Z_x.iloc[s_mode]

    S = Z ** 2 * df_intensity.prefactor.iloc[s_mode]

    G_imag = np.pi * ds.spectralfunction_per_mode[s_mode]

    # KK to get real
    G_real = get_kk_real(xs=ds.frequency, ys=G_imag)

    # the full G
    G = G_real + 1.0j * G_imag


    pref = ws / 2  # makes G(0) -> ~1

    # full dielectric function
    epsilon += S * pref * G

Python 3.8.10 error when calling shutil.py when calling canonical_configuration

2. Check the `Makefile` and the target `init`

╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/jpabatista/Work/tdep-tutorials/venv/lib/python3.8/site-packages/tdepto │
│ ols/scripts/tdep_create_sample_folders.py:41 in main                         │
│                                                                              │
│   38 │   │   atoms.write(fol / outfile, format=format)                       │
│   39 │   │                                                                   │
│   40 │   │   # move original file as well for reference                      │
│ ❱ 41 │   │   shutil.move(file, fol)                                          │
│   42 │   │                                                                   │
│   43 │   │   if files_control is not None:                                   │
│   44 │   │   │   for file in files_control:                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │            _a = 'contcar_conf0001'                                       │ │
│ │            _b = 'vasp'                                                   │ │
│ │            _c = 'aims'                                                   │ │
│ │            _d = 'samples/sample.00001/geometry.in'                       │ │
│ │         atoms = Atoms(symbols='Mg108O108', pbc=True,                     │ │
│ │                 cell=[12.67727773641, 12.67727773641, 12.67727773641])   │ │
│ │   base_folder = 'samples'                                                │ │
│ │          file = PosixPath('contcar_conf0001')                            │ │
│ │         files = [                                                        │ │
│ │                 │   PosixPath('contcar_conf0001'),                       │ │
│ │                 │   PosixPath('contcar_conf0002'),                       │ │
│ │                 │   PosixPath('contcar_conf0003'),                       │ │
│ │                 │   PosixPath('contcar_conf0004')                        │ │
│ │                 ]                                                        │ │
│ │ files_control = []                                                       │ │
│ │           fol = PosixPath('samples/sample.00001')                        │ │
│ │        folder = 'sample'                                                 │ │
│ │         force = False                                                    │ │
│ │        format = 'aims'                                                   │ │
│ │     format_in = 'vasp'                                                   │ │
│ │            ii = 0                                                        │ │
│ │       outfile = 'geometry.in'                                            │ │

│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/lib/python3.8/shutil.py:787 in move                                     │
│                                                                              │
│    784 │   │   │   os.rename(src, dst)                                       │
│    785 │   │   │   return                                                    │
│    786 │   │                                                                 │
│ ❱  787 │   │   real_dst = os.path.join(dst, _basename(src))                  │
│    788 │   │   if os.path.exists(real_dst):                                  │
│    789 │   │   │   raise Error("Destination path '%s' already exists" % real │
│    790 │   try:                                                              │
│                                                                              │
│ ╭────────────────────── locals ──────────────────────╮                       │
│ │ copy_function = <function copy2 at 0x7fa2309fba60> │                       │
│ │           dst = PosixPath('samples/sample.00001')  │                       │
│ │      real_dst = PosixPath('samples/sample.00001')  │                       │
│ │           src = PosixPath('contcar_conf0001')      │                       │
│ ╰────────────────────────────────────────────────────╯                       │
│                                                                              │
│ /usr/lib/python3.8/shutil.py:750 in _basename                                │
│                                                                              │
│    747 │   # A basename() variant which first strips the trailing slash, if  │
│    748 │   # Thus we always get the last component of the path, even for dir │
│    749 │   sep = os.path.sep + (os.path.altsep or '')                        │
│ ❱  750 │   return os.path.basename(path.rstrip(sep))                         │
│    751                                                                       │
│    752 def move(src, dst, copy_function=copy2):                              │
│    753 │   """Recursively move a file or directory to another location. This │
│                                                                              │
│ ╭─────────────── locals ───────────────╮                                     │
│ │ path = PosixPath('contcar_conf0001') │                                     │
│ │  sep = '/'                           │                                     │
│ ╰──────────────────────────────────────╯                                     │
╰──────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'PosixPath' object has no attribute 'rstrip'

segmentation fault for 01_basics/GaN_infiles

Dear developers,
When I try to run the basic examples for GaN via extract_forceconstants -rc2 100 --polar -s 50, I obtain some error:

 ... reading unitcell
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source             
libpthread-2.31.s  0000151BA2979420  Unknown               Unknown  Unknown
extract_forcecons  00000000009B0882  Unknown               Unknown  Unknown
extract_forcecons  00000000009A09E1  Unknown               Unknown  Unknown
extract_forcecons  00000000007E260D  Unknown               Unknown  Unknown
extract_forcecons  0000000000415D02  Unknown               Unknown  Unknown
extract_forcecons  0000000000410A3D  Unknown               Unknown  Unknown
libc-2.31.so       0000151B9A2BD083  __libc_start_main     Unknown  Unknown
extract_forcecons  000000000041095E  Unknown               Unknown  Unknown

If you have any suggestion?

Provide forces?

- Perform sTDEP sampling for MgO at 300K until you reach convergence
- Extract 2nd and 3rd order force constants
- Copy `infile.ucposcar`, `infile.lotosplitting` and the `infile.forceconstant` + `infile.forceconstant_thirdorder` into a new folder
- Run `lineshape` with `lineshape --temperature TEMPERATURE --qpoint Q1 Q2 Q3 --qdirin Q1 Q2 Q3` where you fill the numbers according to the considerations above. This will produce the phonon spectral function and write it to `outfile.phonon_self_energy.hdf5`

Can we provide the force constants just in case someone cannot finish the tutorial? (or link the previous tutorial where we get those?)

Raman tutorial - obtain infile.dielectric_constants

Dear developers,

I calculate the Raman spectrum for As2S3. I have generated the structures with displacements using the command "tdep_displace_modes". Then I peformed DFT calculations for each structure using VASP (the results of calculations are attached, displacements.zip
displacements.zip
).
According to the Raman tutorial, tdep_parse_output command can make the file infile.dielectric_constants from the VASP output and it works "out of the box".

However, when I ran the command "tdep_parse_output ../d-*/vasprun.xml" from the folder with the calculations folders I did not get infile.dielectric_constants (I got forces, positions, born charges etc but not dielectric constants).

Could you please tell if it is possible to extract the dielectric constants automatically in my case?

If no - could you please give a more detailed explanation of the infile.dielectric_constants file structure - how to denerate it manually:

  1. in which order the tensors from the distorted structures should be provided?
  2. I should skip non-raman-active modes or I should put tensor from the undistorted unit cell to their places?

File handling tutorial

Probably good to teach how to inspect the files with python

  • xarray for .hdf5
  • pandas for .csv
  • numpy for plain .dat and e.g. infile.lotosplitting

stress not found, set to 0

stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
*** stress not found, set to 0
... found 10000 samples
... discard 0 steps at beginning
... write forces, positions, and statistics
... positions written to 'infile.positions'
... statistics written to 'infile.stat'
... forces written to 'infile.forces'
... meta info written to 'infile.meta'

For two-dimensional systems, is this normal, and will it affect subsequent processing?

Basics tutorial

Using LAMMPS as the force calculator

Dear community!
I was trying to reproduce the tutorial n. 2 "sTDEP with DFT forces" for a system I am interested in. It is stated "...move the initial sample (contcar_conf0001) to that folder and compute forces using your force field or DFT of choice". I supposed I can use LAMMPS simulation as a force calculator since it is much faster than DFT. However, I find that --output_format for the canonical configuration still doen't support LAMMPS (although here I found some information on how to run LAMMPS simulation to obtain TDEP input data). I managed to convert CONTCAR format to LAMMPS input myself, however, the initial velocities of atoms from contcar_conf0001 are lost in this case. So my first question is - are these velocities essential in order to obtain correct data for TDEP? I suppose yes because after running the simulation, postprocessing as reccomended on the above mentioned page, and running extract_forceconstants -rc2 0 2>&1 | tee extract_forceconstants.log I obtain very low R^2 value, and unphysical elastic constants and dispersion curves. May be I do something wrong, so your advices are highly appreciated. I attach extract_forceconstants.log here and can provide additional files of the calculation if needed.

Best regards,
Anton.
extract_forceconstants.log

Write first round of tutorials

Guidelines for the tutorials

  • pick easiest non-trivial example from your work
  • briefly sketch the scope of the tutorial:
    • What are the goals?
    • What's the general workflow?
    • What are the specific steps?
    • What is the outcome of the workflow and what postprocessing steps need to be performed?
  • check in input files
  • document the steps you need to perform to get some output files
  • possibly document some extra steps for postprocessing
  • document possible errors and hickups
  • document errors and sources of misunderstanding in the
  • keep it simple!
  • don't re-invent the wheel, point to existing documentation, e.g., here
  • don't spend more than 1h tops for the first draft

Software that can be used

  • TDEP binaries
  • Makefile
  • gnuplot
  • bash and python scripts
  • anything else needed? Weigh in the overhead costs

Topics

  • Basics

    • how to use the binaries
    • band structures
    • ...
  • Lineshape

  • Thermodynamics

    • sampling
    • Free energies
    • Quasi-(effective)-harmonic approx. for lattice expansion?
      • via volume-temperature grid
  • Thermal conductivity

  • Raman

  • supercell convergence?

Who writes which tutorial?

Spelling mistake in 00_basics README.md

Under the title "Extracting forceconstants".

The command:
extract_forceconstant -rc2 100 -s 50 > fc2.log
Should be:
extract_forceconstants -rc2 100 -s 50 > fc2.log

Red flag tutorial

Collection of red flags:

  • molten trajectory
  • bad R2 in general
  • close to phase transition

Typos in 02_sampling/sTDEP tutorial

Check the following typos in README.md file:

  1. lines 10 and 30: generature_structure -> generate_structure
  2. line 70: extract_forceconsants' -> extract_forceconstants`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.