Search Blogs

Thursday, May 11, 2023

Creating Dr. Kohn

 I recently was able to create a GPT chatbot that provides answers for VASP. I called it Dr. Kohn; I wrote about something like this in an early post this year here. For the past few weeks, I've been working on another activity where I'm trying to use LangChain to create a very robust generative app for aiding computational scientists, but for the GPT chatbot I'm referencing I used another platform called proudly. What made it so fascinating was how easy it was to do. In essence, you provide workflow steps and then deploy. There isn't anything too special about Dr. Kohn compared to other GPT uses, but what makes it maybe a bit better is that it has "knowledge" about VASP documentation and tutorials. One can further expand the knowledge by just providing more reference documents. 

I'm curious how useful it will be to me. I'm planning on using it when I start my VASP calculations from scratch. When it fails, I'll revisit how to improve it. If you want to test it out please do! and let me know if it fails miserably. Eventually, I would redo this using the LangChain package which will allow for a lot more hands-on adjusting 


Reuse and Attribution

Tuesday, May 9, 2023

Am I too hopeful for self-driving labs?

I have always been bullish and captivated by the concept of automated materials design through cutting-edge lab facilities and computation.  When I see all the advances in robotic systems over the past decade I do think we are headed in the direction of material synthesis, characterization, and testing data in a closed-loop system. Maybe we have already started the initial seed. In my view, it does seem that the integration of robotics, data science, and AI is now catalyzing a new era in the field of materials science. I'm hoping that we eventually get the to point that self-driving labs for accelerated materials discovery.

The pressing question is whether we are on the verge of achieving fully automated materials design. Can researchers simply specify a desired material property with constraints and rely on a self-driving lab to devise the synthesis route and characterize properties? Encouragingly, we seem to be heading in that direction. Academic groups like those led by AlĆ”n Aspuru-Guzik at the University of Toronto [1] and Taylor Sparks at the University of Utah [2] have laid the groundwork for self-driving labs, employing robotics for high-throughput experimentation, data science for handling vast volumes of data, and AI for enhanced prediction and optimization. These efforts are impressive, but further advancements will be required to enable more diverse access to synthesis routes, types of characterization, and testing. The goal should eventually be to develop labs capable of employing various methods for creating and testing materials to meet multi-objective property targets. The success of self-driving labs will probably occur through the collaboration between academia and industry, which will help with overcoming the challenges posed by high capital costs and ensuring the widespread adoption of self-driving labs.

My opinion is that the rapid development and growing capabilities of AI systems will continue to be a driving force behind self-driving labs. These narrow/specialized AI systems, although maybe not yet exhibiting general intelligence, are becoming increasingly adept at processing large datasets and extracting valuable insights using techniques like Bayesian optimization [3]. This enables researchers to explore vast design spaces, generate new hypotheses, and iteratively refine their experiments to identify optimal materials design criteria. I'll posit that the convergence of robotics, data science, and AI will revolutionize the field of materials science given researchers don't overpromise and several strong case studies are realized. This will pave the way for new and groundbreaking technologies that can only be realized if materials can be discovered and regularly synthesized given design criteria. As someone who has been studying Bayesian techniques for the past three years and has long been interested in self-driving labs, I hope I get the chance to work on this.


References

[1] B.P. MacLeod, F.G.L. Parlane, T.D. Morrissey, F. HƤse, L.M. Roch, K.E. Dettelbach, R. Moreira, L.P.E. Yunker, M.B. Rooney, J.R. Deeth, V. Lai, G.J. Ng, H. Situ, R.H. Zhang, M.S. Elliott, T.H. Haley, D.J. Dvorak, A. Aspuru-Guzik, J.E. Hein, C.P. Berlinguette, Self-driving laboratory for accelerated discovery of thin-film materials, Sci. Adv. 6 (2020) eaaz8867. https://doi.org/10.1126/sciadv.aaz8867.
[2] S.G. Baird, T.D. Sparks, What is a minimal working example for a self-driving laboratory?, Matter. 5 (2022) 4170–4178. https://doi.org/10.1016/j.matt.2022.11.007.
[3] F. HƤse, L. M. Roch, A. Aspuru-Guzik, Chimera: enabling hierarchy based multi-objective optimization for self-driving laboratories, Chemical Science. 9 (2018) 7642–7655. https://doi.org/10.1039/C8SC02239A.


Reuse and Attribution

Thursday, May 4, 2023

Calculating Phase Diagrams

Why do I love phase diagrams so much? I've always been fascinated by these relatively cursory-looking plots that show where the phases of matter at different thermodynamic conditions are stable. I remember my excitement in the intro lecture and lab, MATE 25 at SJSU, where in the lab we constructed points on the phase diagram of a lead alloy system. I thought this was the coolest thing that we could build these maps and then use them later to determine what phase a material would be in a given temperature and composition. At the time I had no thermodynamics course work so I didn't realize the underlying driving force of this phenomenon nor did I realize you can calculate these phase diagrams using the CALPHAD method. When I got to grad school I took the required thermodynamics course and then I was even more blown away at how powerful this framework was. I was particularly lucky because the course was taught from a "grassroots" approach where everything was built from the ground up given a set of postulates (you can see the book by H. Callen to get the gist). 

So what does a phase diagram look like and how does one use it? Here I'm going to leverage the excellent Python library pycalphad [1]. Which lets you construct phase diagrams using thermochemical databases, if available. Let's take an example of Cu-Ni system, you can work through the CALPHAD calculation with pycalphad in this google colab notebook. Here is the  binary phase diagram predicted for Cu-Ni:


Phase diagram predicted using cost507.tdb and pycalphad.

How do you read this? Well the blue and yellow points indicate the equilibrium phase boundary. The regions between phase boundaries indicates what phases are in eqiulibrium and how much (see my old notes on tie-lines). So how does the prediction look? Not very good if you consider what the textbook phase diagram looks like:

Textbook phase diagram for Cu-Ni from adapted by ref. [1] 

As we see the predicted phase diagram isn't even close to that shown in the textbook version. This is a direct consequence of the thermodynamic database. However, if we use the same thermodynamic database and look at another system like Al-Zn its much better:

Phase diagram prediction using cost507.tdb. Not bad!


This is much better when you compare it to the phase diagram reported in ref [2]. I just think the CALPHAD approach is so cool in that you just need thermodynamic descriptions of various phases of a material system to make predictions about stability regions. To make a CALPHAD calculation work you would need the following:

  1. Thermodynamic data/descriptions of individual phases such as enthalpy, entropy, and Gibbs free energy.
  2. The phases that could exist and their structure.
  3. Well-defined reference states (e.g.pure metal) allow for consistent and accurate calculations.
  4. Interaction model/parameters to describe mixing behavior of components/species.

The CALPHAD framework then enables the building of a model with these inputs to predict the phase equilibria and diagrams. You can also calculate other thermodynamic properties like heat capacity or even more useful is that the free energy models can be used within the context of phase-field simulations to evolve microstructures.


References

[1] R. Otis, Z.-K. Liu, pycalphad: CALPHAD-based Computational Thermodynamics in Python, JORS. 5 (2017) 1. https://doi.org/10.5334/jors.140.
[2] https://sv.rkriz.net/classes/MSE2094_NoteBook/96ClassProj/examples/cu-ni.html, reproduced from Callister, William D., Materials Science and Engineering: An Introduction. United States, Wiley.
[3] A. Pola, M. Tocci, F.E. Goodwin, Review of Microstructures and Properties of Zinc Alloys, Metals. 10 (2020) 253. https://doi.org/10.3390/met10020253.


Reuse and Attribution