Simulate & classify transient absorption spectroscopy (TAS) spectral features for bulk semiconducting materials (Post-DFT)

Overview

PyTASER

PyTASER is a Python (3.9+) library and set of command-line tools for classifying spectral features in bulk materials, post-DFT. The goal of this library is to provide qualitative comparisons for experimental TAS spectra - a complex and tedious process, especially for pristine materials. The main features include:

  • An interactive TAS spectrum for a pristine semiconducting material
  • Isolating spectra for individual band transitions from the overall TAS spectrum for the material.
  • Spectra in different conditions: temperature, carrier concentrations (analogous to pump-probe time delay)
  • Identifying partial occupancies of valence and conduction bands, using the Fermi-Dirac distribution for different Quasi-Fermi levels.
  • Considers both non-magnetic and magnetic materials.
  • Taking DFT-calculated bandstructure and dos inputs, with primary support for the Materials Project.

Installation

The recommended way to install PyTASER is in a conda environment.

Installation method to be updated here

PyTASER is currently compatible with Python 3.9+ and relies on a number of open-source python packages, specifically:

Visualisation

Once the library is installed, please setup a file as done in the examples provided. Then just run it as a python file:

python3 filename.py

Contributing

The library is currently undergoing some final changes before it is finalised. However, once it is completed, we would greatly appreciate any contributions in the form of a pull request. Additionally, any test cases/example spectra performed with PyTASER would be welcomed.

Future topics we'd like to build on:

  • Converting between carrier concentrations and pump-probe time delay (for a more quantitative analysis)
  • Incorporating spin-change processes (e.g. moving from Spin.up to Spin.down and vice-versa) for spin-polarised systems
  • Incorporating finite-temperature effects (particularly with indirect bandgaps and phonons, and defects)
  • Incorporating more complex optical processes (e.g. Stimulated Emissions)
  • Cleaning the regions further away from the bandgap
  • Implementing the optical transition probabilities alongside the JDOS
  • Creating a kinetics plot for TAS analysis.
  • Relating spectral features with associated optical processes

Acknowledgements

Developed by Savyasanchi Aggarwal, Alex Ganose and Liam Harnett-Caulfield. Aron Walsh designed and led the project.

Thanks to the WMD group @ Imperial/Yonsei for all the interesting discussions and improvements!

Comments
  • Remove .DS_Store and .idea folders and add .gitignore

    Remove .DS_Store and .idea folders and add .gitignore

    Mac OS writes .DS_Store files for caching information about folders you visit in finder. Also PyCharm writes the .idea folder for storing information about the pycharm project.

    Typically you don't want either of these in a git repo. The easiest way to handle them is using a .gitignore file in the root directory of the project which states which files to ignore.

    To fix this you should:

    1. Run find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch to remove .DS_Store files from git.
    2. Run git rm -f .idea to remove the idea folder from git.
    3. Add a .gitignore file to the root folder. You can use the one from IFermi: https://github.com/utf/IFermi/blob/master/.gitignore
    4. Commit your changes to GitHub.
    opened by utf 4
  • Is abipy actually a dependency

    Is abipy actually a dependency

    You mention abipy in the readme as a dependency and you also import it in your examples and library code. However, it doesn't seem that you actually use abipy anywhere?

    If that is the case you can remove all the imports and update the readme.

    opened by utf 4
  • Calculate wavelength mesh on the fly

    Calculate wavelength mesh on the fly

    The Tas class doesn't need to store the energy mesh in both eV and wavelength as it is redundant information. E.g. https://github.com/WMD-group/PyTASER/blob/953968c3f0044e79644744415b33647dc7b2dae3/TAS.py#L60

    You should just keep the eV mesh and calculate the wavelength mesh when needed on the fly.

    opened by utf 3
  • Labelling bands relative to VB and CB

    Labelling bands relative to VB and CB

    Currently, the bands are listed according to their energies - this makes it clunky for the user when deciding which bands to isolate in the spectrum. Instead, we want to make the bands relative to the VB and CBs (e.g. if a band is 2 below VB (band -1), change it from band 7 to band -3. Likewise, 2 band above the CB (band +1) would be band +3 instead of band 12).

    However, there are different VBs and CBs according to the spin and k-points, making it hard to identify one specific band number as the VB or 1 below the VB.

    Fixing this issue will also simplify #14, as we can specify the "auto" mode as transitions associated with the 3 bands before and after the VB/CB.

    opened by savya10 2
  • Tidy plotter arguments

    Tidy plotter arguments

    Why are material_name, temp, and conc, needed in the plotter? E.g. https://github.com/WMD-group/PyTASER/blob/953968c3f0044e79644744415b33647dc7b2dae3/plotter.py#L38

    The docstring makes it sound like the temp will impact the plot but I don't think it should as the TAS has already been generated.

    If these are just for additional labels and titles, then they should all be optional arguments with no default value (e.g., an empty string).

    opened by utf 2
  • Tidy files

    Tidy files

    Hi @savya10,

    I tidied the package a little by:

    • Running the black code formatter to format the file as standard python.
    • Running the isort --profile black to sort the import statements.
    • Removing unused import statements.
    • Renamed the TAS.py file to tas.py as filenames shouldn't have capital letters in them.
    • Renamed the tas class to Tas as python classes should always start with a capital letter (unlike functions).
    • Reduced the length of some docstrings to keep the line length under 80 characters long.
    • Removed documentation above imports or above functions (these aren't needed, as functions are documented using docstrings).

    Most of these are just minor edits to for standard python formatting conventions (called PEP8 if you want to read more).

    Once, you've looked through, please can you merge this PR and I will do a proper code review.

    opened by utf 2
  • Automatic transition selection

    Automatic transition selection

    I think the best approach for automatically selecting which transitions to plot is as follows:

    1. Get the maximum absolute value of each transition within the plotting region.
    2. Find the largest of all maximums.
    3. Include transitions whose maximum value is within X% of largest maximum.

    The X% should be an adjustable parameter, e.g., transition_cutoff. By default, I think a good value is 0.97 (e.g., 97%) but this could be tuned.

    opened by utf 1
  • Package needs tests

    Package needs tests

    We need unit tests to check that the package is running properly and to prevent further changes breaking the code.

    The modern way to write tests in python is using pytest

    You can see an example of how tests should be setup by looking at the evgraf repo (although actually the test files should begin with the prefix test_): https://github.com/pmla/evgraf/tree/master/tests

    If we want to submit to JOSS then having tests will be essential.

    opened by utf 1
  • gaussian_width argument is not used in generate_tas

    gaussian_width argument is not used in generate_tas

    The gaussian width argument is not used in the Generator.generate_tas function. https://github.com/WMD-group/PyTASER/blob/953968c3f0044e79644744415b33647dc7b2dae3/generator.py#L508

    I think you just need to pass the value through to the jdos function (you will have to do this in multiple places).

    opened by utf 1
  • Auto mode for transition selection

    Auto mode for transition selection

    Currently the most painful thing is working out which transitions you need to select when plotting. I think it would be best to add an "auto" mode, that automatically works out which transitions are the most important for the energy range of interest, and then automatically labels those.

    You would enable this mode by setting relevant_transitions="auto" in the plotter as an alternative to passing a list.

    And I think all of the examples, except one, should use "auto".

    opened by utf 1
  • Make bandgap_ev an optional argument in plotter

    Make bandgap_ev an optional argument in plotter

    bandgap_ev should be an optional argument with a default value of None, here: https://github.com/WMD-group/PyTASER/blob/953968c3f0044e79644744415b33647dc7b2dae3/plotter.py#L37

    If the band gap is not set then no line should be displayed.

    opened by utf 1
  • Error with CdTe BS

    Error with CdTe BS

    Hi! This is a really useful and well put-together package! 🙌 Excited to see how it develops!

    I was trying to run this with CdTe, in the same way as the GaAs example notebook, and I'm running into this issue (see attachments). Basically it seems that the MP bandstructure has a down-sampled 12x12x12 mesh (I think), so manually hard-coding the mesh to 6x6x6 works, but the default doesn't.

    I've pulled my hair out for a few hours now trying to figure out what was going on here & where it was failing 😅, so I think I've found mostly where the issue is coming from but not how best to fix. Hopefully those who are more familiar with the code will be able to spot/fix the issue quicker!

    CdTe_TAS_Error_MWE.ipynb.zip

    opened by kavanase 3
  • Better error message if line mode band structure provided

    Better error message if line mode band structure provided

    get_kpoint_weights or somewhere else in the code should give a proper error message if a line mode band structure is used instead of a calculation on a uniform k-point mesh.

    This can be checked by looking if the band structure object is an instance of the BandStructureSymmLine class.

    opened by utf 0
  • Implementing deltaT/T

    Implementing deltaT/T

    A lot of TAS spectra in literature use ΔT/T plots instead of just the ΔT plots that are currently used in PyTASER. To enable effective comparison against this data, we need to be able to switch the y-axis into a ΔT/T plot as well.

    However, it is unclear if the denominator in ΔT/T is normalised according to JDOS_dark or JDOS_light - this seems to vary across literature. Furthermore, the denominator is often zero, despite a non-zero ΔT - this results in the ΔT/T shooting to infinity. While we could use a filter to ignore normalisation of T~0 values, there is no indicator of how this would affect the accuracy of the plot. As such, we need a clear indication of how ΔT/T works.

    help wanted 
    opened by savya10 0
  • Package needs documentation

    Package needs documentation

    We need to create a documentation website or just have more details on how to run the code in the readme. An example of a package with a good readme is effmass

    If we want to submit to JOSS then having good documentation will be essential.

    opened by utf 2
Owner
Materials Design Group
Research group in computational chemistry & physics led by @aronwalsh
Materials Design Group
Penguins species predictor app is used to classify penguins species created using python's scikit-learn, fastapi, numpy and joblib packages.

Penguins Classification App Penguins species predictor app is used to classify penguins species using their island, sex, bill length (mm), bill depth

Siva Prakash 3 Apr 5, 2022
Retrieve annotated intron sequences and classify them as minor (U12-type) or major (U2-type)

(intron I nterrogator and C lassifier) intronIC is a program that can be used to classify intron sequences as minor (U12-type) or major (U2-type), usi

Graham Larue 4 Jul 26, 2022
Automatic extraction of relevant features from time series:

tsfresh This repository contains the TSFRESH python package. The abbreviation stands for "Time Series Feature extraction based on scalable hypothesis

Blue Yonder GmbH 7k Jan 6, 2023
High performance Python GLMs with all the features!

High performance Python GLMs with all the features!

QuantCo 200 Dec 14, 2022
Breast-Cancer-Classification - Using SKLearn breast cancer dataset which contains 569 examples and 32 features classifying has been made with 6 different algorithms

Breast-Cancer-Classification - Using SKLearn breast cancer dataset which contains 569 examples and 32 features classifying has been made with 6 different algorithms

Mert Sezer Ardal 1 Jan 31, 2022
Larch: Applications and Python Library for Data Analysis of X-ray Absorption Spectroscopy (XAS, XANES, XAFS, EXAFS), X-ray Fluorescence (XRF) Spectroscopy and Imaging

Larch: Data Analysis Tools for X-ray Spectroscopy and More Documentation: http://xraypy.github.io/xraylarch Code: http://github.com/xraypy/xraylarch L

xraypy 95 Dec 13, 2022
"MST++: Multi-stage Spectral-wise Transformer for Efficient Spectral Reconstruction" (CVPRW 2022) & (Winner of NTIRE 2022 Challenge on Spectral Reconstruction from RGB)

MST++: Multi-stage Spectral-wise Transformer for Efficient Spectral Reconstruction (CVPRW 2022) Yuanhao Cai, Jing Lin, Zudi Lin, Haoqian Wang, Yulun Z

Yuanhao Cai 274 Jan 5, 2023
Wordle Tas Tool is a terminal application for solving Wordle puzzles

Wordle Tas Tool Terminal application for solving Wordle puzzles Wordle Tas Tool (WTT) is a Python script that iterates over SCOWL95 to solve Wordle pu

null 1 Feb 8, 2022
Fastapi mail system sending mails(individual, bulk) attachments(individual, bulk)

Fastapi-mail The fastapi-mail simple lightweight mail system, sending emails and attachments(individual && bulk) ?? Installation $ pip install fastap

Sabuhi 399 Dec 29, 2022
A bulk pdf generator. This application can generate PDFs in bulk by using just one click.

A bulk html pdf generator. This application can generate PDFs in bulk by using just one click. Screenshots Requirements ?? Your system must have the f

Aman Nirala 3 Apr 23, 2022
A minimal implementation of the IQRM interference flagging algorithm for radio pulsar and transient searches

A minimal implementation of the IQRM interference flagging algorithm for radio pulsar and transient searches. This module only provides the algorithm that infers a channel mask from some spectral statistic that measures the level of RFI contamination in a time-frequency data block. It should be useful as a reference implementation to developers who wish to integrate IQRM into an existing pipeline / search code.

Vincent Morello 6 Nov 29, 2022
Automation of VASP DFT workflows with ASE - application scripts

This repo contains a library that aims at automatizing some Density Functional Theory (DFT) workflows in VASP by using the ASE toolkit.

Frank Niessen 5 Sep 6, 2022
Non-Imaging Transient Reconstruction And TEmporal Search (NITRATES)

Non-Imaging Transient Reconstruction And TEmporal Search (NITRATES) This repo contains the full NITRATES pipeline for maximum likelihood-driven discov

null 13 Nov 8, 2022
PyAbsorp is a python module that has the main focus to help estimate the Sound Absorption Coefficient.

This is a package developed to be use to find the Sound Absorption Coefficient through some implemented models, like Biot-Allard, Johnson-Champoux and

Michael Markus Ackermann 8 Oct 19, 2022
Time Dependent DFT in Tamm-Dancoff Approximation

Density Function Theory Program - kspy-tddft(tda) This is an implementation of Time-Dependent Density Functional Theory(TDDFT) using the Tamm-Dancoff

Peter Borthwick 2 Nov 17, 2022
PyTorch implementation of the Transformer in Post-LN (Post-LayerNorm) and Pre-LN (Pre-LayerNorm).

Transformer-PyTorch A PyTorch implementation of the Transformer from the paper Attention is All You Need in both Post-LN (Post-LayerNorm) and Pre-LN (

Jared Wang 22 Feb 27, 2022
Use MATLAB to simulate the signal and extract features. Use PyTorch to build and train deep network to do spectrum sensing.

Deep-Learning-based-Spectrum-Sensing Use MATLAB to simulate the signal and extract features. Use PyTorch to build and train deep network to do spectru

null 10 Dec 14, 2022
An experimental script to perform bulk parsing of arbitrary file features with YARA and console logging.

RonnieColemanYARAParser This script is named after Ronnie Coleman, and peforms bulk lifts on arbitary file features using YARA console logging. Requir

Steve 20 Dec 13, 2022
A windows post exploitation tool that contains a lot of features for information gathering and more.

Crowbar - A windows post exploitation tool Status - ✔️ This project is now considered finished. Any updates from now on will most likely be new script

null 29 Nov 20, 2022
Open Source Discord bot with many cool features like Weather, Balance, Avatar, User, Server, RP-commands, Gif search, YouTube search, VK post search etc.

Сокобот Дискорд бот с открытым исходным кодом. Содержит в себе экономику, полезные команды (!аватар, !юзер, !сервер и тд.), рп-команды (!обнять, !глад

serverok 2 Jan 16, 2022