diff --git a/README.html b/README.html index b8f956d..5893e7a 100644 --- a/README.html +++ b/README.html @@ -175,10 +175,10 @@
diff --git a/_sources/book/first_agent.ipynb b/_sources/book/1-crystalstructure-agent.ipynb similarity index 78% rename from _sources/book/first_agent.ipynb rename to _sources/book/1-crystalstructure-agent.ipynb index 1c069a2..b1e6100 100644 --- a/_sources/book/first_agent.ipynb +++ b/_sources/book/1-crystalstructure-agent.ipynb @@ -6,9 +6,9 @@ "metadata": {}, "source": [ "# Crystalstructure Agent\n", - "Develop an LLM agent which can predict the crystal structure of a chemical element, by accessing the reference database of the [Atomic Simulation Environment](https://wiki.fysik.dtu.dk/ase/). While the corresponding python function is simple and only requires a few lines of code, this example already limits the hallucinations of the LLM, by using the [langchain](https://www.langchain.com) framework to interface a python function with the LLM. \n", + "As a first demonstration the langchain team decided to develop a LLM agent, which can predict the crystal structure of a chemical element, by accessing the reference database of the [Atomic Simulation Environment](https://wiki.fysik.dtu.dk/ase/). While the corresponding python function is simple and only requires a few lines of code, this example already limits the hallucinations of the LLM, by using the [langchain](https://www.langchain.com) framework to interface the LLM with the python function. \n", "\n", - "In particular we follow the [Custom Agent](https://python.langchain.com/docs/modules/agents/how_to/custom_agent/) tutorial from the Langchain documentation. " + "In particular, we follow the [Custom Agent](https://python.langchain.com/docs/modules/agents/how_to/custom_agent/) tutorial from the Langchain documentation. " ] }, { @@ -17,7 +17,7 @@ "metadata": {}, "source": [ "## Python Function\n", - "For this first example we use [OpenAI](https://www.langchain.com) as LLM provider but the example can also be adjusted to work with other LLM providers. We store the OpenAI API key in the `OPENAI_API_KEY` variable: " + "For this first example, we use [OpenAI](https://openai.com) as LLM provider but the example can also be adjusted to work with other LLM providers, for more details check the [langchain documentation](https://python.langchain.com/v0.2/docs/integrations/platforms/). We store the OpenAI API key in the `OPENAI_API_KEY` variable: " ] }, { @@ -52,9 +52,7 @@ "cell_type": "markdown", "id": "136e7571-ac3b-4587-82b5-3351d6a6d3f2", "metadata": {}, - "source": [ - "As a next step we import the corresponding functionality from `ASE` and the `tool` decorator from `langchain`:" - ] + "source": "As a next step, we import the corresponding functionality from `ASE` and the `tool` decorator from `langchain`:" }, { "cell_type": "code", @@ -71,9 +69,7 @@ "cell_type": "markdown", "id": "3aae31dd-fb84-45f9-81b9-3f1f18786f4f", "metadata": {}, - "source": [ - "For the python function it is important to include `type` hints and documentation based on a Docstring for the LLM to understand the functionality of the function. Finally, all data types used as input or output of the function need to have a `JSON` representation so they can be communicated to the LLM. For example numpy arrays have to be converted to standard python lists. " - ] + "source": "For the python function, it is important to include `type` hints and documentation based on a Docstring for the LLM to understand the functionality of the function. Finally, all data types used as input or output of the function need to have a `JSON` representation so they can be communicated to the LLM. For example, numpy arrays have to be converted to standard python lists. " }, { "cell_type": "code", @@ -148,7 +144,7 @@ "metadata": {}, "source": [ "## Define Agent\n", - "After the definition of the Python function, the next step is the definition of the agent which the LLM uses to interact with the Python function. In this example the `ChatOpenAI` interface of the `langchain_openai` package is used. Depending on your configuration it might be necessary to install this using: \n", + "After the definition of the Python function, the next step is the definition of the agent which the LLM uses to interact with the Python function. In this example the `ChatOpenAI` interface of the `langchain_openai` package is used. Depending on your configuration, it might be necessary to install the `langchain_openai` package using the following command: \n", "```\n", "conda install -c conda-forge langchain-openai\n", "```" @@ -256,14 +252,14 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_crystal_structure` with `{'chemical_symbol': 'Au'}`\n", "\n", "\n", - "\u001b[0m\u001b[36;1m\u001b[1;3mfcc\u001b[0m\u001b[32;1m\u001b[1;3mThe crystal structure of gold is face-centered cubic (fcc).\u001b[0m\n", + "\u001B[0m\u001B[36;1m\u001B[1;3mfcc\u001B[0m\u001B[32;1m\u001B[1;3mThe crystal structure of gold is face-centered cubic (fcc).\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] } ], @@ -276,11 +272,11 @@ "id": "43bc4d75-bae7-4fe2-8005-52e2629eec8d", "metadata": {}, "source": [ - "With the `verbose=True` parameter the internal steps of the LLM agent are printed in green. As a first step the Agent calls the `get_crystal_structure()` already with the converted input parameter, rather than using gold as input it uses the chemical symbol `Au`. The function returns `fcc` and the LLM converts this answer in a sentence a human can understand: \n", + "With the `verbose=True` parameter the internal steps of the LLM agent are printed in green. As a first step the agent calls the `get_crystal_structure()` already with the converted input parameter, rather than using gold as input it uses the chemical symbol `Au`. The function returns `fcc` and the LLM converts this answer in a sentence a human can understand: \n", "```\n", "The crystal structure of gold is face-centered cubic (fcc).\n", "```\n", - "This example highlights how easy it is these days to make a python function accessible via an LLM for all kinds of users to interact with this python funtion." + "This example highlights how easy it is these days to make a python function accessible via a LLM for all kinds of users to interact with this python funtion." ] }, { @@ -304,14 +300,14 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_crystal_structure` with `{'chemical_symbol': 'C'}`\n", "\n", "\n", - "\u001b[0m\u001b[36;1m\u001b[1;3mdiamond\u001b[0m\u001b[32;1m\u001b[1;3mThe crystal structure of carbon (C) is diamond.\u001b[0m\n", + "\u001B[0m\u001B[36;1m\u001B[1;3mdiamond\u001B[0m\u001B[32;1m\u001B[1;3mThe crystal structure of carbon (C) is diamond.\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] } ], @@ -383,10 +379,10 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3mI'm sorry, but the query does not contain a valid chemical element. Please provide a chemical symbol for an element to determine its crystal structure.\u001b[0m\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3mI'm sorry, but the query does not contain a valid chemical element. Please provide a chemical symbol for an element to determine its crystal structure.\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] } ], @@ -398,9 +394,7 @@ "cell_type": "markdown", "id": "f23ddd66-9032-41e0-90fb-a574845ce426", "metadata": {}, - "source": [ - "With the modified system prompt the agent correctly replies that it was not able to determine the crystal structure of a car, because it fails to determine the chemical element a car consists of. " - ] + "source": "With the modified system prompt, the agent correctly replies that it was not able to determine the crystal structure of a car, because it fails to determine the chemical element a car consists of. " }, { "cell_type": "markdown", @@ -408,7 +402,7 @@ "metadata": {}, "source": [ "## Summary\n", - "By following the [Custom Agent](https://python.langchain.com/docs/modules/agents/how_to/custom_agent/) tutorial from the Langchain documentation we were able to create a first simulation agent, which calls specialized python frameworks like [ASE](https://wiki.fysik.dtu.dk/ase/) to address material-science specific questions. Still it is important to carefully engineer the prompt of the agent, otherwise even these LLMs with access to specialized agents tend to hallucinat." + "By following the [Custom Agent](https://python.langchain.com/docs/modules/agents/how_to/custom_agent/) tutorial from the Langchain documentation, we were able to create a first simulation agent, which calls specialized python frameworks like [ASE](https://wiki.fysik.dtu.dk/ase/) to address material-science specific questions. Still, it is important to carefully engineer the prompt of the agent, otherwise even these LLMs with access to specialized agents tend to hallucinate." ] }, { diff --git a/_sources/book/energy_volume_curve.ipynb b/_sources/book/2-energy-volume-curve-agent.ipynb similarity index 96% rename from _sources/book/energy_volume_curve.ipynb rename to _sources/book/2-energy-volume-curve-agent.ipynb index b95fd5c..e3ffb27 100644 --- a/_sources/book/energy_volume_curve.ipynb +++ b/_sources/book/2-energy-volume-curve-agent.ipynb @@ -6,16 +6,14 @@ "metadata": {}, "source": [ "# Energy Volume Curve Agent\n", - "Based on the previous tutorial, the next step is extending the simple crystal structure agent to address the benchmark challenge of calculating an energy volume curve using the EMT simulation code. Again, this demonstration is based on the Langchain tutorial for [custom agents](https://python.langchain.com/docs/modules/agents/how_to/custom_agent/)." + "Based on the previous tutorial, the next step is to extend the simple crystal structure agent to address the benchmark challenge of calculating an energy-versus-volume curve using the EMT simulation code. Again, this demonstration is based on the Langchain tutorial for [custom agents](https://python.langchain.com/docs/modules/agents/how_to/custom_agent/)." ] }, { "cell_type": "markdown", "id": "abebe249-91bd-44ad-bcec-79bf4de2e1a6", "metadata": {}, - "source": [ - "As a first step we import a number of python modules, these consist of the [ASE](https://wiki.fysik.dtu.dk/ase/), some standard python libraries like `numpy` and `matplotlib` as well as a number of tools from [langchain](https://www.langchain.com):" - ] + "source": "As a first step, we import a number of python modules, these consist of the [ASE](https://wiki.fysik.dtu.dk/ase/), some standard python libraries as well as a number of tools from [langchain](https://www.langchain.com):" }, { "cell_type": "code", @@ -29,7 +27,6 @@ "from ase.calculators.emt import EMT\n", "from ase.constraints import UnitCellFilter\n", "from ase.eos import calculate_eos, plot\n", - "from ase.data import reference_states, atomic_numbers\n", "from ase.optimize import LBFGS" ] }, @@ -41,8 +38,6 @@ "outputs": [], "source": [ "from getpass import getpass\n", - "import matplotlib.pyplot as plt\n", - "import numpy as np\n", "from typing import List" ] }, @@ -67,7 +62,7 @@ "metadata": {}, "source": [ "## Multiple Functions\n", - "To connect multiple python functions it is essential to convert all inputs and outputs to JSON compatible data types as the communication to the LLM in the background happens in terms of web requests using the JSON format. This especially applies to python functions which return python objects. In the case of [ASE](https://wiki.fysik.dtu.dk/ase/) a typical python object is the `ase.atoms.Atoms()` object. To convert the `Atoms()` object to JSON format, we use a [pydantic](https://pydantic.dev) data class as suggested by [langchain](https://www.langchain.com):" + "To connect multiple python functions, it is essential to convert all inputs and outputs to `JSON` compatible data types as the communication to the LLM in the background happens in terms of web requests using the `JSON` format. This especially applies to python functions which return python objects. In the case of [ASE](https://wiki.fysik.dtu.dk/ase/) a typical python object is the `ase.atoms.Atoms()` object. To convert the `Atoms()` object to JSON format, we use a [pydantic](https://pydantic.dev) data class as suggested by [langchain](https://www.langchain.com):" ] }, { @@ -114,7 +109,7 @@ "id": "30085089-4b70-40c9-9a92-62caa4c0aa22", "metadata": {}, "source": [ - "In terms of functions, two functions are defined: A `get_equilibirum_lattice()` function which for a given chemical element returns the optimized equilibrium structure as `AtomsDict`. The second function is an `plot_equation_of_state()` function, which takes the already optimized structure as `AtomsDict` as input and then uses the [ASE](https://wiki.fysik.dtu.dk/ase/) internal functionality to plot the energy volume curve. \n", + "In terms of functions, two functions are defined: A `get_equilibirum_lattice()` function which for a given chemical element returns the optimized equilibrium structure as `AtomsDict`. The second function is a `plot_equation_of_state()` function, which takes the already optimized structure as `AtomsDict` as input and then uses the [ASE](https://wiki.fysik.dtu.dk/ase/) internal functionality to plot the energy volume curve. \n", "\n", "The important point here is that `get_equilibirum_lattice()` would typically just return an `ase.atoms.Atoms()` object, but for compatibility with the LLM it has to be converted to an `AtomsDict` which can be converted to JSON. Finally, in the `plot_equation_of_state()` function the `AtomsDict` is again converted to an `ase.atoms.Atoms()` object to continue the calculation. This is currently a bit tedious. " ] @@ -157,9 +152,7 @@ "cell_type": "markdown", "id": "8ae5f04f-b9b9-40ad-9306-de17b66c11b4", "metadata": {}, - "source": [ - "Finally, the functions converted to LLM tools using the `tool` decorator can again be tested using the `invoke()` function. It takes a python dictionary as input to address the different arguments individually. With this test the correct implementation of the python functions is validated:" - ] + "source": "Finally, the functions converted to LLM tools using the `tool` decorator can again be tested using the `invoke()` function. It takes a python dictionary as input to address the different arguments individually. With this test, the correct implementation of the python functions is validated:" }, { "cell_type": "code", @@ -220,7 +213,7 @@ "metadata": {}, "source": [ "## Agents\n", - "Following the same Langchain tutorial for [custom agents](https://python.langchain.com/docs/modules/agents/how_to/custom_agent/) as before an LLM agent is constructed which combines the system prompt, the python functions `get_equilibirum_lattice()` and `plot_equation_of_state()` as tools and the `OpenAIToolsAgentOutputParser()`:" + "Following the same Langchain tutorial for [custom agents](https://python.langchain.com/docs/modules/agents/how_to/custom_agent/) as before a LLM agent is constructed which combines the system prompt, the python functions `get_equilibirum_lattice()` and `plot_equation_of_state()` as tools and the `OpenAIToolsAgentOutputParser()`:" ] }, { @@ -286,12 +279,12 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_equilibirum_lattice` with `{'chemical_symbol': 'Au'}`\n", "\n", "\n", - "\u001b[0m Step Time Energy fmax\n", + "\u001B[0m Step Time Energy fmax\n", "LBFGS: 0 18:48:23 0.002606 0.308859\n", "LBFGS: 1 18:48:23 0.000032 0.077808\n", "LBFGS: 2 18:48:24 -0.000135 0.003099\n", @@ -311,13 +304,13 @@ "output_type": "stream", "text": [ "LBFGS: 4 18:48:24 -0.000135 0.000000\n", - "\u001b[36;1m\u001b[1;3mnumbers=[79] positions=[[4.761270571021482e-17, -3.4431732128676475e-17, -2.0729599738876008e-16]] cell=[[7.040904860568554e-17, 2.028082809705617, 2.0280828097056176], [2.028082809705617, 1.0384771021574885e-16, 2.0280828097056176], [2.028082809705617, 2.028082809705618, 4.963320342464553e-17]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[36;1m\u001B[1;3mnumbers=[79] positions=[[4.761270571021482e-17, -3.4431732128676475e-17, -2.0729599738876008e-16]] cell=[[7.040904860568554e-17, 2.028082809705617, 2.0280828097056176], [2.028082809705617, 1.0384771021574885e-16, 2.0280828097056176], [2.028082809705617, 2.028082809705618, 4.963320342464553e-17]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `plot_equation_of_state` with `{'atom_dict': {'numbers': [79], 'positions': [[4.761270571021482e-17, -3.4431732128676475e-17, -2.0729599738876008e-16]], 'cell': [[7.040904860568554e-17, 2.028082809705617, 2.0280828097056176], [2.028082809705617, 1.0384771021574885e-16, 2.0280828097056176], [2.028082809705617, 2.028082809705618, 4.963320342464553e-17]], 'pbc': [True, True, True]}}`\n", "\n", "\n", - "\u001b[0m\u001b[33;1m\u001b[1;3mAxes(0.125,0.11;0.775x0.77)\u001b[0m\u001b[32;1m\u001b[1;3mHere is the plot of the equation of state of gold.\u001b[0m\n", + "\u001B[0m\u001B[33;1m\u001B[1;3mAxes(0.125,0.11;0.775x0.77)\u001B[0m\u001B[32;1m\u001B[1;3mHere is the plot of the equation of state of gold.\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] }, { @@ -341,9 +334,9 @@ "metadata": {}, "source": [ "## Summary\n", - "The important point in this example is that at no point the order in which the functions should be executed. Instead the LLM automatically determines that `plot_equation_of_state()` needs an `AtomsDict()` object as input and that `get_equilibirum_lattice()` returns such a `AtomsDict()` object, so it makes sense to call `get_equilibirum_lattice()` first and `plot_equation_of_state()` second. The same principles apply to a LLM agents with a larger number of python functions. \n", + "The important point in this example is, that the order of execution of the Python functions is not defined by the user. Instead the LLM automatically determines that `plot_equation_of_state()` needs an `AtomsDict()` object as input and that `get_equilibirum_lattice()` returns such a `AtomsDict()` object as an output, so it makes sense to call `get_equilibirum_lattice()` first and `plot_equation_of_state()` second. The same principles apply to LLM agents with a larger number of python functions. \n", "\n", - "The limiting point at the moment is that the LLMs are web services, so all Python objects have to be converted to JSON to be communicated to the LLMs. This restricts the choice of Python objects and requires the development of specialized data classes to construct those interfaces between different Python functions. " + "The limiting point at the moment is that the LLMs are web services, so all Python objects have to be converted to `JSON` to be communicated to the LLMs. This restricts the choice of Python objects and requires the development of specialized data classes to construct those interfaces between different Python functions. " ] }, { diff --git a/_sources/book/demonstration.ipynb b/_sources/book/3-hackathon-demonstration.ipynb similarity index 74% rename from _sources/book/demonstration.ipynb rename to _sources/book/3-hackathon-demonstration.ipynb index 20e003e..5fb818c 100644 --- a/_sources/book/demonstration.ipynb +++ b/_sources/book/3-hackathon-demonstration.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "source": [ "# Hackathon Demonstration\n", - "Beyond the two previous examples, which closely followed the Langchain [custom agent](https://python.langchain.com/v0.1/docs/modules/agents/how_to/custom_agent/) tutorial, the goal for the final presentation was to highlight the use of `LangSim` in production. For this purpose the functionality was transferred from the Jupyter notebook to a python module. As a first step the `LangSim` module is loaded using the `reload_ext` jupyter magic:" + "Beyond the two previous examples, which closely followed the Langchain [custom agent](https://python.langchain.com/v0.1/docs/modules/agents/how_to/custom_agent/) tutorial, the goal for the final presentation was to highlight the use of `LangSim` in production. For this purpose, the functionality was transferred from the Jupyter notebook to a Python module. As a first step the `LangSim` module is loaded using the `%reload_ext` jupyter magic command:" ] }, { @@ -52,7 +52,7 @@ "metadata": {}, "source": [ "## Dialog\n", - "From this point on the user can chat with the `LangSim` interface using the `chat` jupyter magic. As a first challenge the user communicates their interest to find a material with a bulk modulus in the range of 200 GPa. Following with a clarification of this statement by asking the LLM to calculate the bulk modulus for the noble metals. In contrast to the previous example the LLM is tasked with repeating the same calculation multiple times and then identify the chemical element which most closly matches the targeted bulk modulus of 200GPa. All the required logic is not implemented explicitly, rather the LLM only has access to an `get_equilibrium_lattice()` function to calculate the equilibrium structure and an `get_bulk_modulus()` function which calculates the bulk modulus for a given equilibrium structure." + "From this point on the user can chat with the `LangSim` interface using the `chat` jupyter magic. As a first challenge the user communicates their interest to find a material with a bulk modulus in the range of 200 GPa; following with a clarification of this statement by asking the LLM to calculate the bulk modulus for the noble metals. In contrast to the previous example, the LLM is tasked with repeating the same calculation multiple times and then identify the chemical element, which most closely matches the targeted bulk modulus of 200GPa. None of the required logic is implemented explicitly, rather the LLM only has access to a `get_equilibrium_lattice()` function to calculate the equilibrium crystal structure and a `get_bulk_modulus()` function, which calculates the bulk modulus for a given equilibrium crystal structure." ] }, { @@ -67,10 +67,10 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3mSure, I can help with that. The noble metals include gold (Au), silver (Ag), and platinum (Pt). Which model would you like to use for the calculations: EMT or MACE?\u001b[0m\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3mSure, I can help with that. The noble metals include gold (Au), silver (Ag), and platinum (Pt). Which model would you like to use for the calculations: EMT or MACE?\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] }, { @@ -97,9 +97,7 @@ "cell_type": "markdown", "id": "837750e4-d51d-4ea9-bb7e-be3fd7b1f63c", "metadata": {}, - "source": [ - "The LLM is instructed by the system prompt to clarify which simulation method it should use to calculate a given material property. A the time of the demonstration, two simulation methods were implemented, [EMT](https://wiki.fysik.dtu.dk/ase/ase/calculators/emt.html) and [MACE](https://mace-docs.readthedocs.io). As the user in this demonstration is not aware of the technical details of these simulation methods, he asks for clarification. This highlights how LLMs can use the context of the previous conversation to answer a given question:" - ] + "source": "The LLM is instructed by the system prompt to clarify which simulation method it should use to calculate a given material property. At the time of the demonstration, two simulation methods were implemented, [EMT](https://wiki.fysik.dtu.dk/ase/ase/calculators/emt.html) and [MACE](https://mace-docs.readthedocs.io). As the user in this demonstration is not aware of the technical details of these simulation methods, he asks for clarification. This highlights how LLMs can use the context of the previous conversation to answer a given question:" }, { "cell_type": "code", @@ -113,8 +111,8 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3mCertainly! Here is a brief overview of the two models:\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3mCertainly! Here is a brief overview of the two models:\n", "\n", "1. **Effective Medium Theory (EMT)**:\n", " - **Description**: EMT is a computationally efficient, analytical model that describes the macroscopic properties of composite materials.\n", @@ -126,9 +124,9 @@ " - **Advantages**: It leverages machine learning to provide highly accurate predictions of atomic interactions and material properties.\n", " - **Limitations**: It can be computationally more intensive compared to EMT.\n", "\n", - "Please choose one of these models for the calculations.\u001b[0m\n", + "Please choose one of these models for the calculations.\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] }, { @@ -166,9 +164,7 @@ "cell_type": "markdown", "id": "ba002cb9-b406-49dd-a716-c57904d48472", "metadata": {}, - "source": [ - "Based on the explanation the user chooses the [EMT](https://wiki.fysik.dtu.dk/ase/ase/calculators/emt.html), primarily because it is computationally more efficient to calculate a large number of calculation in a short amount of time. The LLM then executes two calculation for each of the three noble metals silver, gold and platinum. These calculations are the calculation of the equilibrium structure `get_equilibrium_lattice()` which in addition to the chemical symbol now also takes the name of the chosen calculator as an input and the calculation of the bulk modulus `get_bulk_modulus()` which takes the optimized structure as `AtomsDict()` object as an input in addition to the chosen calculator as string. " - ] + "source": "Based on the explanation of the LLM, the user chooses the [EMT](https://wiki.fysik.dtu.dk/ase/ase/calculators/emt.html) method, primarily because it is computationally more efficient to calculate a large number of calculations in a short amount of time. The LLM then executes two calculations for each of the three noble metals silver (Ag), gold (Au) and platinum (Pt). These calculations are the calculation of the equilibrium structure `get_equilibrium_lattice()` which in addition to the chemical symbol now also takes the name of the chosen calculator as an input and the calculation of the bulk modulus `get_bulk_modulus()` which takes the optimized structure as `AtomsDict()` object as an input in addition to the chosen calculator as string. " }, { "cell_type": "code", @@ -182,69 +178,69 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_atom_dict_bulk_structure` with `{'chemical_symbol': 'Au'}`\n", "\n", "\n", - "\u001b[0m\u001b[33;1m\u001b[1;3mnumbers=[79] positions=[[0.0, 0.0, 0.0]] cell=[[0.0, 2.04, 2.04], [2.04, 0.0, 2.04], [2.04, 2.04, 0.0]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[33;1m\u001B[1;3mnumbers=[79] positions=[[0.0, 0.0, 0.0]] cell=[[0.0, 2.04, 2.04], [2.04, 0.0, 2.04], [2.04, 2.04, 0.0]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_atom_dict_bulk_structure` with `{'chemical_symbol': 'Ag'}`\n", "\n", "\n", - "\u001b[0m\u001b[33;1m\u001b[1;3mnumbers=[47] positions=[[0.0, 0.0, 0.0]] cell=[[0.0, 2.045, 2.045], [2.045, 0.0, 2.045], [2.045, 2.045, 0.0]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[33;1m\u001B[1;3mnumbers=[47] positions=[[0.0, 0.0, 0.0]] cell=[[0.0, 2.045, 2.045], [2.045, 0.0, 2.045], [2.045, 2.045, 0.0]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_atom_dict_bulk_structure` with `{'chemical_symbol': 'Pt'}`\n", "\n", "\n", - "\u001b[0m\u001b[33;1m\u001b[1;3mnumbers=[78] positions=[[0.0, 0.0, 0.0]] cell=[[0.0, 1.96, 1.96], [1.96, 0.0, 1.96], [1.96, 1.96, 0.0]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[33;1m\u001B[1;3mnumbers=[78] positions=[[0.0, 0.0, 0.0]] cell=[[0.0, 1.96, 1.96], [1.96, 0.0, 1.96], [1.96, 1.96, 0.0]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_atom_dict_equilibrated_structure` with `{'atom_dict': {'numbers': [79], 'positions': [[0.0, 0.0, 0.0]], 'cell': [[0.0, 2.04, 2.04], [2.04, 0.0, 2.04], [2.04, 2.04, 0.0]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m Step Time Energy fmax\n", + "\u001B[0m Step Time Energy fmax\n", "LBFGS: 0 19:41:36 0.002606 0.308859\n", "LBFGS: 1 19:41:36 0.000032 0.077808\n", "LBFGS: 2 19:41:36 -0.000135 0.003099\n", "LBFGS: 3 19:41:36 -0.000135 0.000029\n", "LBFGS: 4 19:41:36 -0.000135 0.000000\n", - "\u001b[38;5;200m\u001b[1;3mnumbers=[79] positions=[[4.761270571021482e-17, -3.4431732128676475e-17, -2.0729599738876008e-16]] cell=[[7.040904860568554e-17, 2.028082809705617, 2.0280828097056176], [2.028082809705617, 1.0384771021574885e-16, 2.0280828097056176], [2.028082809705617, 2.028082809705618, 4.963320342464553e-17]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[38;5;200m\u001B[1;3mnumbers=[79] positions=[[4.761270571021482e-17, -3.4431732128676475e-17, -2.0729599738876008e-16]] cell=[[7.040904860568554e-17, 2.028082809705617, 2.0280828097056176], [2.028082809705617, 1.0384771021574885e-16, 2.0280828097056176], [2.028082809705617, 2.028082809705618, 4.963320342464553e-17]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_atom_dict_equilibrated_structure` with `{'atom_dict': {'numbers': [47], 'positions': [[0.0, 0.0, 0.0]], 'cell': [[0.0, 2.045, 2.045], [2.045, 0.0, 2.045], [2.045, 2.045, 0.0]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m Step Time Energy fmax\n", + "\u001B[0m Step Time Energy fmax\n", "LBFGS: 0 19:41:36 0.001584 0.198735\n", "LBFGS: 1 19:41:36 0.000254 0.113272\n", "LBFGS: 2 19:41:36 -0.000366 0.004325\n", "LBFGS: 3 19:41:36 -0.000367 0.000089\n", "LBFGS: 4 19:41:36 -0.000367 0.000000\n", - "\u001b[38;5;200m\u001b[1;3mnumbers=[47] positions=[[3.632034897593557e-17, -7.643082441891503e-17, -4.3481411845850515e-16]] cell=[[9.839176801279394e-17, 2.031776305380803, 2.0317763053808036], [2.031776305380803, -6.293048194449085e-17, 2.0317763053808036], [2.031776305380803, 2.031776305380803, -2.945414531846451e-17]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[38;5;200m\u001B[1;3mnumbers=[47] positions=[[3.632034897593557e-17, -7.643082441891503e-17, -4.3481411845850515e-16]] cell=[[9.839176801279394e-17, 2.031776305380803, 2.0317763053808036], [2.031776305380803, -6.293048194449085e-17, 2.0317763053808036], [2.031776305380803, 2.031776305380803, -2.945414531846451e-17]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_atom_dict_equilibrated_structure` with `{'atom_dict': {'numbers': [78], 'positions': [[0.0, 0.0, 0.0]], 'cell': [[0.0, 1.96, 1.96], [1.96, 0.0, 1.96], [1.96, 1.96, 0.0]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m Step Time Energy fmax\n", + "\u001B[0m Step Time Energy fmax\n", "LBFGS: 0 19:41:36 -0.000125 0.036183\n", "LBFGS: 1 19:41:36 -0.000149 0.004500\n", "LBFGS: 2 19:41:36 -0.000150 0.000013\n", "LBFGS: 3 19:41:36 -0.000150 0.000000\n", - "\u001b[38;5;200m\u001b[1;3mnumbers=[78] positions=[[1.733508800950033e-17, 1.1611829961508788e-16, 1.1092203033984378e-16]] cell=[[4.60232654901218e-18, 1.9609007393798525, 1.960900739379854], [1.9609007393798532, -3.193849078504324e-16, 1.9609007393798543], [1.9609007393798532, 1.9609007393798528, 1.704915243852484e-16]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[38;5;200m\u001B[1;3mnumbers=[78] positions=[[1.733508800950033e-17, 1.1611829961508788e-16, 1.1092203033984378e-16]] cell=[[4.60232654901218e-18, 1.9609007393798525, 1.960900739379854], [1.9609007393798532, -3.193849078504324e-16, 1.9609007393798543], [1.9609007393798532, 1.9609007393798528, 1.704915243852484e-16]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_bulk_modulus` with `{'atom_dict': {'numbers': [79], 'positions': [[4.761270571021482e-17, -3.4431732128676475e-17, -2.0729599738876008e-16]], 'cell': [[7.040904860568554e-17, 2.028082809705617, 2.0280828097056176], [2.028082809705617, 1.0384771021574885e-16, 2.0280828097056176], [2.028082809705617, 2.028082809705618, 4.963320342464553e-17]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m\u001b[36;1m\u001b[1;3m173.83830457892148\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[36;1m\u001B[1;3m173.83830457892148\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_bulk_modulus` with `{'atom_dict': {'numbers': [47], 'positions': [[3.632034897593557e-17, -7.643082441891503e-17, -4.3481411845850515e-16]], 'cell': [[9.839176801279394e-17, 2.031776305380803, 2.0317763053808036], [2.031776305380803, -6.293048194449085e-17, 2.0317763053808036], [2.031776305380803, 2.031776305380803, -2.945414531846451e-17]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m\u001b[36;1m\u001b[1;3m100.1580099631827\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[36;1m\u001B[1;3m100.1580099631827\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_bulk_modulus` with `{'atom_dict': {'numbers': [78], 'positions': [[1.733508800950033e-17, 1.1611829961508788e-16, 1.1092203033984378e-16]], 'cell': [[4.60232654901218e-18, 1.9609007393798525, 1.960900739379854], [1.9609007393798532, -3.193849078504324e-16, 1.9609007393798543], [1.9609007393798532, 1.9609007393798528, 1.704915243852484e-16]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m\u001b[36;1m\u001b[1;3m278.29661366411915\u001b[0m\u001b[32;1m\u001b[1;3mHere are the calculated bulk moduli for the noble metals using the EMT model:\n", + "\u001B[0m\u001B[36;1m\u001B[1;3m278.29661366411915\u001B[0m\u001B[32;1m\u001B[1;3mHere are the calculated bulk moduli for the noble metals using the EMT model:\n", "\n", "- **Gold (Au)**: 173.84 GPa\n", "- **Silver (Ag)**: 100.16 GPa\n", "- **Platinum (Pt)**: 278.30 GPa\n", "\n", - "Among these, Platinum (Pt) has a bulk modulus within the range of 200 GPa.\u001b[0m\n", + "Among these, Platinum (Pt) has a bulk modulus within the range of 200 GPa.\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] }, { @@ -279,7 +275,7 @@ "source": [ "The results are summarized in a short list. This demonstration highlights that `LangSim` can be used without prior technical experience in calculating material properties. From students to teachers and professors, it is a handy tool for everybody who wants to have quick access to material properties computed with one of the standard methods like [EMT](https://wiki.fysik.dtu.dk/ase/ase/calculators/emt.html). Obviously, the [MACE](https://mace-docs.readthedocs.io) method is more accurate than the [EMT](https://wiki.fysik.dtu.dk/ase/ase/calculators/emt.html) method, but also computationally more expensive. \n", "\n", - "Still to further highlight the real-life application of a tool like `LangSim` the next step after the completion of those calculation is the comparison to an experimental reference. For this purpose the `get_experimental_elastic_property_wikipedia()` function is implemented which downloads the experimental values for the elastic properties from the wikipedia site for [elastic properties](https://en.wikipedia.org/wiki/Elastic_properties_of_the_elements_(data_page))." + "Still, to further highlight the real-life application of a tool like `LangSim` the next step after the completion of these calculations is the comparison to an experimental reference. For this purpose, the `get_experimental_elastic_property_wikipedia()` function is implemented which downloads the experimental values for the elastic properties from the wikipedia site for [elastic properties](https://en.wikipedia.org/wiki/Elastic_properties_of_the_elements_(data_page))." ] }, { @@ -294,20 +290,20 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_experimental_elastic_property_wikipedia` with `{'chemical_symbol': 'Au'}`\n", "\n", "\n", - "\u001b[0m\u001b[33;1m\u001b[1;3m{'youngs_modulus': 78.0, 'poissons_ratio': 0.44, 'bulk_modulus': 180.0, 'shear_modulus': 27.0}\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[33;1m\u001B[1;3m{'youngs_modulus': 78.0, 'poissons_ratio': 0.44, 'bulk_modulus': 180.0, 'shear_modulus': 27.0}\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_experimental_elastic_property_wikipedia` with `{'chemical_symbol': 'Ag'}`\n", "\n", "\n", - "\u001b[0m\u001b[33;1m\u001b[1;3m{'youngs_modulus': 83.0, 'poissons_ratio': 0.37, 'bulk_modulus': 100.0, 'shear_modulus': 30.0}\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[33;1m\u001B[1;3m{'youngs_modulus': 83.0, 'poissons_ratio': 0.37, 'bulk_modulus': 100.0, 'shear_modulus': 30.0}\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_experimental_elastic_property_wikipedia` with `{'chemical_symbol': 'Pt'}`\n", "\n", "\n", - "\u001b[0m\u001b[33;1m\u001b[1;3m{'youngs_modulus': 168.0, 'poissons_ratio': 0.38, 'bulk_modulus': 230.0, 'shear_modulus': 61.0}\u001b[0m\u001b[32;1m\u001b[1;3mHere are the experimental bulk moduli for the noble metals compared to the calculated values using the EMT model:\n", + "\u001B[0m\u001B[33;1m\u001B[1;3m{'youngs_modulus': 168.0, 'poissons_ratio': 0.38, 'bulk_modulus': 230.0, 'shear_modulus': 61.0}\u001B[0m\u001B[32;1m\u001B[1;3mHere are the experimental bulk moduli for the noble metals compared to the calculated values using the EMT model:\n", "\n", "- **Gold (Au)**:\n", " - **Calculated (EMT)**: 173.84 GPa\n", @@ -321,9 +317,9 @@ " - **Calculated (EMT)**: 278.30 GPa\n", " - **Experimental**: 230.0 GPa\n", "\n", - "The calculated values are quite close to the experimental values, with the exception of Platinum (Pt), which shows a larger discrepancy.\u001b[0m\n", + "The calculated values are quite close to the experimental values, with the exception of Platinum (Pt), which shows a larger discrepancy.\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] }, { @@ -363,9 +359,7 @@ "cell_type": "markdown", "id": "9f9cb1aa-cf38-49be-8654-7b77cc6ef207", "metadata": {}, - "source": [ - "Finally, as last step the user tasks the LLM to compare the theoretical predictions and the experimental results to give an indication of the trust worthiness of these calculation. Given the optimization for computational efficiency the result for Platinum with an error of over 20% is insufficient for any real life application. Still this can be addressed by switching to the [MACE](https://mace-docs.readthedocs.io) model. " - ] + "source": "Finally, as the last step the user tasks the LLM to compare the theoretical predictions and the experimental results to give an indication of the trustworthiness of these calculations. Given the optimization for computational efficiency, the result for Platinum with an error of over 20% is insufficient for any real life application. Still, this can be addressed by switching to the [MACE](https://mace-docs.readthedocs.io) model. " }, { "cell_type": "code", @@ -379,8 +373,8 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3mCertainly! Let's calculate the percentage deviation between the calculated and experimental bulk moduli for the noble metals.\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3mCertainly! Let's calculate the percentage deviation between the calculated and experimental bulk moduli for the noble metals.\n", "\n", "The formula for percentage deviation is:\n", "\\[ \\text{Percentage Deviation} = \\left( \\frac{\\text{Calculated Value} - \\text{Experimental Value}}{\\text{Experimental Value}} \\right) \\times 100 \\]\n", @@ -407,9 +401,9 @@ "- **Silver (Ag)**: 0.16%\n", "- **Platinum (Pt)**: 21.87%\n", "\n", - "These deviations indicate how close the calculated values are to the experimental values.\u001b[0m\n", + "These deviations indicate how close the calculated values are to the experimental values.\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] }, { @@ -464,9 +458,9 @@ "metadata": {}, "source": [ "## Summary\n", - "The jury was convinced that this demonstration of the capabilities of `LangSim` highlight a future direction in the application of LLMs for materials and chemistry. So the `LangSim` team won the [first price](https://medium.com/@blaiszik/llms-to-accelerate-discovery-in-materials-science-and-chemistry-refections-on-a-hackathon-b8364ca32242) sponsored by [RadicalAI](https://www.radical-ai.com). \n", + "The jury was convinced that this demonstration of the capabilities of `LangSim` highlights a future direction in the application of LLMs for materials and chemistry. So the `LangSim` team won the [first prize](https://medium.com/@blaiszik/llms-to-accelerate-discovery-in-materials-science-and-chemistry-refections-on-a-hackathon-b8364ca32242) sponsored by [RadicalAI](https://www.radical-ai.com). \n", "\n", - "In comparison to the previous examples, the highlight of this presentation besides hiding the technical complexity by developing a python module was the capability of the LLM to repeat the workflow consisting of two calculation, the `get_equilibrium_lattice()` function and the `get_bulk_modulus()` function, over three elements without the need to define any additional functionality. " + "In comparison to the previous examples, the highlight of this presentation, besides hiding the technical complexity by developing a python module, was the capability of the LLM to repeat the workflow consisting of two calculations, the `get_equilibrium_lattice()` function and the `get_bulk_modulus()` function, over three elements without the need to define any additional functionality. " ] }, { diff --git a/_sources/book/inverse-alloy-design.ipynb b/_sources/book/4-inverse-alloy-design.ipynb similarity index 96% rename from _sources/book/inverse-alloy-design.ipynb rename to _sources/book/4-inverse-alloy-design.ipynb index 12ce89f..16651e2 100644 --- a/_sources/book/inverse-alloy-design.ipynb +++ b/_sources/book/4-inverse-alloy-design.ipynb @@ -6,9 +6,9 @@ "metadata": {}, "source": [ "# Inverse Alloy Design\n", - "Inverse prediction of material properties is a key challenge in materials science. For the example the dependence of the bulk modulus on the concentration of an alloy, is typically evaluated by computing the bulk modulus for a given concentration. But the relevant material property is the bulk modulus, so we would like to predict the concentration which is required to achieve a specific bulk modulus. \n", + "Inverse prediction of material properties is a key challenge in materials science. For example, the dependence of the bulk modulus on the concentration of an alloy is typically evaluated by computing the bulk modulus for a given concentration. But the relevant material property is the bulk modulus, so we would like to predict the concentration which is required to achieve a specific bulk modulus. \n", "\n", - "To demonstrate the application of LLMs for inverse alloy design, we extended the calculation of bulk moduli to complex alloys in solid solution. For computational efficiency we use 32-atom special quasi-random structures (SQS) to simulate solid solutions. " + "To demonstrate the application of LLMs for inverse alloy design, we extended the calculation of bulk moduli to complex alloys in solid solution. For computational efficiency we use 32-atom special quasi-random structures (SQS) to simulate solid solutions." ] }, { @@ -371,7 +371,7 @@ "metadata": {}, "source": [ "## Dialog\n", - "Finally, the agent is tasked to find the alloy concentration of an Copper Gold alloy which matches the bulk modulus of 145GPa with in an error bound of 2GPa. In addition, it received the hint to use linear interpolation rather than random sampling or other strategies to find the desired concentration. " + "Finally, the agent is tasked to find the alloy concentration of an Copper Gold alloy which matches the bulk modulus of 145GPa within an error bound of 2GPa. In addition, it received the hint to use linear interpolation rather than random sampling or other strategies to find the desired concentration. " ] }, { @@ -386,8 +386,8 @@ "text": [ "\n", "\n", - "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3m\n", + "\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n", + "\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_complex_alloy_bulk_structure` with `{'element_lst': ['Cu'], 'concentration_lst': [1.0], 'number_of_atoms': 32, 'crystal_structure': 'fcc'}`\n", "responded: Sure, let's start by validating the presence of chemical elements in your query. You mentioned Copper (Cu) and Gold (Au), which are valid chemical elements.\n", "\n", @@ -401,7 +401,7 @@ "\n", "Let's compute the bulk moduli for these initial concentrations using the EMT simulation code.\n", "\n", - "\u001b[0m\u001b[36;1m\u001b[1;3mnumbers=[13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13] positions=[[0.0, 0.0, 0.0], [0.0, 1.805, 1.805], [1.805, 0.0, 1.805], [1.805, 1.805, 0.0], [0.0, 0.0, 3.61], [0.0, 1.805, 5.415], [1.805, 0.0, 5.415], [1.805, 1.805, 3.61], [0.0, 3.61, 0.0], [0.0, 5.415, 1.805], [1.805, 3.61, 1.805], [1.805, 5.415, 0.0], [0.0, 3.61, 3.61], [0.0, 5.415, 5.415], [1.805, 3.61, 5.415], [1.805, 5.415, 3.61], [3.61, 0.0, 0.0], [3.61, 1.805, 1.805], [5.415, 0.0, 1.805], [5.415, 1.805, 0.0], [3.61, 0.0, 3.61], [3.61, 1.805, 5.415], [5.415, 0.0, 5.415], [5.415, 1.805, 3.61], [3.61, 3.61, 0.0], [3.61, 5.415, 1.805], [5.415, 3.61, 1.805], [5.415, 5.415, 0.0], [3.61, 3.61, 3.61], [3.61, 5.415, 5.415], [5.415, 3.61, 5.415], [5.415, 5.415, 3.61]] cell=[[7.22, 0.0, 0.0], [0.0, 7.22, 0.0], [0.0, 0.0, 7.22]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[36;1m\u001B[1;3mnumbers=[13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13] positions=[[0.0, 0.0, 0.0], [0.0, 1.805, 1.805], [1.805, 0.0, 1.805], [1.805, 1.805, 0.0], [0.0, 0.0, 3.61], [0.0, 1.805, 5.415], [1.805, 0.0, 5.415], [1.805, 1.805, 3.61], [0.0, 3.61, 0.0], [0.0, 5.415, 1.805], [1.805, 3.61, 1.805], [1.805, 5.415, 0.0], [0.0, 3.61, 3.61], [0.0, 5.415, 5.415], [1.805, 3.61, 5.415], [1.805, 5.415, 3.61], [3.61, 0.0, 0.0], [3.61, 1.805, 1.805], [5.415, 0.0, 1.805], [5.415, 1.805, 0.0], [3.61, 0.0, 3.61], [3.61, 1.805, 5.415], [5.415, 0.0, 5.415], [5.415, 1.805, 3.61], [3.61, 3.61, 0.0], [3.61, 5.415, 1.805], [5.415, 3.61, 1.805], [5.415, 5.415, 0.0], [3.61, 3.61, 3.61], [3.61, 5.415, 5.415], [5.415, 3.61, 5.415], [5.415, 5.415, 3.61]] cell=[[7.22, 0.0, 0.0], [0.0, 7.22, 0.0], [0.0, 0.0, 7.22]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_complex_alloy_bulk_structure` with `{'element_lst': ['Au'], 'concentration_lst': [1.0], 'number_of_atoms': 32, 'crystal_structure': 'fcc'}`\n", "responded: Sure, let's start by validating the presence of chemical elements in your query. You mentioned Copper (Cu) and Gold (Au), which are valid chemical elements.\n", "\n", @@ -415,35 +415,35 @@ "\n", "Let's compute the bulk moduli for these initial concentrations using the EMT simulation code.\n", "\n", - "\u001b[0m\u001b[36;1m\u001b[1;3mnumbers=[13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13] positions=[[0.0, 0.0, 0.0], [0.0, 2.04, 2.04], [2.04, 0.0, 2.04], [2.04, 2.04, 0.0], [0.0, 0.0, 4.08], [0.0, 2.04, 6.12], [2.04, 0.0, 6.12], [2.04, 2.04, 4.08], [0.0, 4.08, 0.0], [0.0, 6.12, 2.04], [2.04, 4.08, 2.04], [2.04, 6.12, 0.0], [0.0, 4.08, 4.08], [0.0, 6.12, 6.12], [2.04, 4.08, 6.12], [2.04, 6.12, 4.08], [4.08, 0.0, 0.0], [4.08, 2.04, 2.04], [6.12, 0.0, 2.04], [6.12, 2.04, 0.0], [4.08, 0.0, 4.08], [4.08, 2.04, 6.12], [6.12, 0.0, 6.12], [6.12, 2.04, 4.08], [4.08, 4.08, 0.0], [4.08, 6.12, 2.04], [6.12, 4.08, 2.04], [6.12, 6.12, 0.0], [4.08, 4.08, 4.08], [4.08, 6.12, 6.12], [6.12, 4.08, 6.12], [6.12, 6.12, 4.08]] cell=[[8.16, 0.0, 0.0], [0.0, 8.16, 0.0], [0.0, 0.0, 8.16]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[36;1m\u001B[1;3mnumbers=[13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13] positions=[[0.0, 0.0, 0.0], [0.0, 2.04, 2.04], [2.04, 0.0, 2.04], [2.04, 2.04, 0.0], [0.0, 0.0, 4.08], [0.0, 2.04, 6.12], [2.04, 0.0, 6.12], [2.04, 2.04, 4.08], [0.0, 4.08, 0.0], [0.0, 6.12, 2.04], [2.04, 4.08, 2.04], [2.04, 6.12, 0.0], [0.0, 4.08, 4.08], [0.0, 6.12, 6.12], [2.04, 4.08, 6.12], [2.04, 6.12, 4.08], [4.08, 0.0, 0.0], [4.08, 2.04, 2.04], [6.12, 0.0, 2.04], [6.12, 2.04, 0.0], [4.08, 0.0, 4.08], [4.08, 2.04, 6.12], [6.12, 0.0, 6.12], [6.12, 2.04, 4.08], [4.08, 4.08, 0.0], [4.08, 6.12, 2.04], [6.12, 4.08, 2.04], [6.12, 6.12, 0.0], [4.08, 4.08, 4.08], [4.08, 6.12, 6.12], [6.12, 4.08, 6.12], [6.12, 6.12, 4.08]] cell=[[8.16, 0.0, 0.0], [0.0, 8.16, 0.0], [0.0, 0.0, 8.16]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_atom_dict_equilibrated_structure` with `{'atom_dict': {'numbers': [29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29], 'positions': [[0.0, 0.0, 0.0], [0.0, 1.805, 1.805], [1.805, 0.0, 1.805], [1.805, 1.805, 0.0], [0.0, 0.0, 3.61], [0.0, 1.805, 5.415], [1.805, 0.0, 5.415], [1.805, 1.805, 3.61], [0.0, 3.61, 0.0], [0.0, 5.415, 1.805], [1.805, 3.61, 1.805], [1.805, 5.415, 0.0], [0.0, 3.61, 3.61], [0.0, 5.415, 5.415], [1.805, 3.61, 5.415], [1.805, 5.415, 3.61], [3.61, 0.0, 0.0], [3.61, 1.805, 1.805], [5.415, 0.0, 1.805], [5.415, 1.805, 0.0], [3.61, 0.0, 3.61], [3.61, 1.805, 5.415], [5.415, 0.0, 5.415], [5.415, 1.805, 3.61], [3.61, 3.61, 0.0], [3.61, 5.415, 1.805], [5.415, 3.61, 1.805], [5.415, 5.415, 0.0], [3.61, 3.61, 3.61], [3.61, 5.415, 5.415], [5.415, 3.61, 5.415], [5.415, 5.415, 3.61]], 'cell': [[7.22, 0.0, 0.0], [0.0, 7.22, 0.0], [0.0, 0.0, 7.22]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m Step Time Energy fmax\n", + "\u001B[0m Step Time Energy fmax\n", "LBFGS: 0 00:21:46 -0.181808 0.160183\n", "LBFGS: 1 00:21:46 -0.182901 0.158188\n", "LBFGS: 2 00:21:46 -0.225134 0.004528\n", "LBFGS: 3 00:21:46 -0.225168 0.000123\n", "LBFGS: 4 00:21:46 -0.225168 0.000000\n", - "\u001b[33;1m\u001b[1;3mnumbers=[29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29] positions=[[6.761801057876339e-16, 2.4178592947955473e-15, -3.696205154607726e-15], [2.362265601281247e-15, 1.7949128008674702, 1.794912800867473], [1.794912800867468, 6.295993829604061e-15, 1.7949128008674684], [1.7949128008674664, 1.7949128008674673, 2.178736226937247e-15], [-4.052659683212801e-15, -7.250244798076016e-16, 3.589825601734939], [1.9048356294552537e-15, 1.7949128008674733, 5.384738402602442], [1.794912800867467, 8.597570995802812e-15, 5.384738402602447], [1.794912800867472, 1.7949128008674635, 3.5898256017349444], [9.298328874081624e-16, 3.589825601734933, -3.323078787730939e-15], [-3.041708126507229e-15, 5.384738402602446, 1.7949128008674713], [1.7949128008674673, 3.589825601734951, 1.7949128008674664], [1.7949128008674717, 5.384738402602446, 4.766586294737296e-15], [6.043692340833827e-15, 3.5898256017349484, 3.589825601734948], [3.067145173531617e-15, 5.384738402602432, 5.384738402602436], [1.794912800867466, 3.5898256017349444, 5.384738402602436], [1.7949128008674617, 5.384738402602442, 3.58982560173494], [3.5898256017349275, 5.841702500885102e-15, -9.874153064309176e-16], [3.5898256017349386, 1.7949128008674704, 1.7949128008674662], [5.384738402602439, -7.622611728751917e-16, 1.794912800867471], [5.384738402602442, 1.7949128008674675, 2.500162875281997e-15], [3.5898256017349386, 2.502593039137387e-15, 3.5898256017349426], [3.5898256017349413, 1.7949128008674726, 5.384738402602438], [5.3847384026024345, 8.606035168920653e-16, 5.384738402602437], [5.384738402602433, 1.794912800867463, 3.5898256017349404], [3.589825601734946, 3.5898256017349426, -1.7390314304769608e-15], [3.589825601734946, 5.384738402602441, 1.7949128008674675], [5.384738402602442, 3.5898256017349497, 1.7949128008674708], [5.384738402602438, 5.384738402602439, 8.989257719002385e-16], [3.5898256017349524, 3.589825601734952, 3.589825601734947], [3.5898256017349346, 5.384738402602433, 5.38473840260243], [5.384738402602431, 3.5898256017349417, 5.3847384026024345], [5.384738402602436, 5.384738402602435, 3.589825601734939]] cell=[[7.1796512034698905, 9.5626712638785e-17, -6.159891355103644e-17], [9.5626712638785e-17, 7.17965120346989, 1.1161347749589607e-16], [-6.159891355103644e-17, 1.1161347749589607e-16, 7.1796512034698905]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[33;1m\u001B[1;3mnumbers=[29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29] positions=[[6.761801057876339e-16, 2.4178592947955473e-15, -3.696205154607726e-15], [2.362265601281247e-15, 1.7949128008674702, 1.794912800867473], [1.794912800867468, 6.295993829604061e-15, 1.7949128008674684], [1.7949128008674664, 1.7949128008674673, 2.178736226937247e-15], [-4.052659683212801e-15, -7.250244798076016e-16, 3.589825601734939], [1.9048356294552537e-15, 1.7949128008674733, 5.384738402602442], [1.794912800867467, 8.597570995802812e-15, 5.384738402602447], [1.794912800867472, 1.7949128008674635, 3.5898256017349444], [9.298328874081624e-16, 3.589825601734933, -3.323078787730939e-15], [-3.041708126507229e-15, 5.384738402602446, 1.7949128008674713], [1.7949128008674673, 3.589825601734951, 1.7949128008674664], [1.7949128008674717, 5.384738402602446, 4.766586294737296e-15], [6.043692340833827e-15, 3.5898256017349484, 3.589825601734948], [3.067145173531617e-15, 5.384738402602432, 5.384738402602436], [1.794912800867466, 3.5898256017349444, 5.384738402602436], [1.7949128008674617, 5.384738402602442, 3.58982560173494], [3.5898256017349275, 5.841702500885102e-15, -9.874153064309176e-16], [3.5898256017349386, 1.7949128008674704, 1.7949128008674662], [5.384738402602439, -7.622611728751917e-16, 1.794912800867471], [5.384738402602442, 1.7949128008674675, 2.500162875281997e-15], [3.5898256017349386, 2.502593039137387e-15, 3.5898256017349426], [3.5898256017349413, 1.7949128008674726, 5.384738402602438], [5.3847384026024345, 8.606035168920653e-16, 5.384738402602437], [5.384738402602433, 1.794912800867463, 3.5898256017349404], [3.589825601734946, 3.5898256017349426, -1.7390314304769608e-15], [3.589825601734946, 5.384738402602441, 1.7949128008674675], [5.384738402602442, 3.5898256017349497, 1.7949128008674708], [5.384738402602438, 5.384738402602439, 8.989257719002385e-16], [3.5898256017349524, 3.589825601734952, 3.589825601734947], [3.5898256017349346, 5.384738402602433, 5.38473840260243], [5.384738402602431, 3.5898256017349417, 5.3847384026024345], [5.384738402602436, 5.384738402602435, 3.589825601734939]] cell=[[7.1796512034698905, 9.5626712638785e-17, -6.159891355103644e-17], [9.5626712638785e-17, 7.17965120346989, 1.1161347749589607e-16], [-6.159891355103644e-17, 1.1161347749589607e-16, 7.1796512034698905]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_atom_dict_equilibrated_structure` with `{'atom_dict': {'numbers': [79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79], 'positions': [[0.0, 0.0, 0.0], [0.0, 2.04, 2.04], [2.04, 0.0, 2.04], [2.04, 2.04, 0.0], [0.0, 0.0, 4.08], [0.0, 2.04, 6.12], [2.04, 0.0, 6.12], [2.04, 2.04, 4.08], [0.0, 4.08, 0.0], [0.0, 6.12, 2.04], [2.04, 4.08, 2.04], [2.04, 6.12, 0.0], [0.0, 4.08, 4.08], [0.0, 6.12, 6.12], [2.04, 4.08, 6.12], [2.04, 6.12, 4.08], [4.08, 0.0, 0.0], [4.08, 2.04, 2.04], [6.12, 0.0, 2.04], [6.12, 2.04, 0.0], [4.08, 0.0, 4.08], [4.08, 2.04, 6.12], [6.12, 0.0, 6.12], [6.12, 2.04, 4.08], [4.08, 4.08, 0.0], [4.08, 6.12, 2.04], [6.12, 4.08, 2.04], [6.12, 6.12, 0.0], [4.08, 4.08, 4.08], [4.08, 6.12, 6.12], [6.12, 4.08, 6.12], [6.12, 6.12, 4.08]], 'cell': [[8.16, 0.0, 0.0], [0.0, 8.16, 0.0], [0.0, 0.0, 8.16]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m Step Time Energy fmax\n", + "\u001B[0m Step Time Energy fmax\n", "LBFGS: 0 00:21:46 0.083403 0.308859\n", "LBFGS: 1 00:21:46 0.079361 0.301843\n", "LBFGS: 2 00:21:46 -0.004187 0.012561\n", "LBFGS: 3 00:21:46 -0.004324 0.000480\n", "LBFGS: 4 00:21:46 -0.004325 0.000001\n", - "\u001b[33;1m\u001b[1;3mnumbers=[79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79] positions=[[-1.1519732493423534e-14, -4.902671923156848e-15, -3.691244571156717e-15], [-3.3083661695160288e-15, 2.028082836101837, 2.0280828361018366], [2.0280828361018353, -7.266830256967577e-15, 2.028082836101836], [2.028082836101835, 2.0280828361018326, -3.4869213003831076e-15], [-1.1809075014158814e-15, -1.7534273740802401e-15, 4.056165672203671], [-1.2936452033234147e-15, 2.028082836101836, 6.084248508305483], [2.0280828361018344, 1.0859220153152102e-15, 6.084248508305481], [2.028082836101836, 2.0280828361018353, 4.056165672203671], [-4.212746448640245e-15, 4.056165672203668, -2.488512553310913e-15], [-2.595176344938955e-15, 6.084248508305482, 2.028082836101836], [2.0280828361018357, 4.056165672203668, 2.028082836101835], [2.028082836101834, 6.084248508305484, -3.88520256151608e-15], [3.0730356068103296e-15, 4.05616567220367, 4.0561656722036705], [-2.5181968161173974e-16, 6.084248508305483, 6.0842485083054845], [2.028082836101837, 4.056165672203671, 6.084248508305483], [2.028082836101835, 6.08424850830548, 4.0561656722036705], [4.056165672203667, -3.1698249517704123e-15, -1.875758814596068e-15], [4.056165672203672, 2.0280828361018353, 2.0280828361018357], [6.084248508305481, -4.234210017286284e-15, 2.028082836101836], [6.084248508305482, 2.0280828361018353, -3.3188348477751644e-15], [4.056165672203665, -4.1636148734447415e-15, 4.056165672203671], [4.0561656722036705, 2.0280828361018357, 6.084248508305482], [6.084248508305485, -3.553000959590537e-15, 6.084248508305483], [6.084248508305481, 2.0280828361018344, 4.056165672203671], [4.056165672203667, 4.056165672203669, -3.2761394733216216e-15], [4.05616567220367, 6.084248508305483, 2.028082836101835], [6.084248508305481, 4.056165672203667, 2.0280828361018357], [6.084248508305481, 6.0842485083054845, -4.359711787996257e-15], [4.0561656722036705, 4.056165672203667, 4.05616567220367], [4.056165672203672, 6.084248508305484, 6.084248508305485], [6.084248508305482, 4.0561656722036705, 6.084248508305484], [6.084248508305481, 6.0842485083054845, 4.056165672203671]] cell=[[8.112331344407348, 9.540810667674625e-17, 4.2647505813391163e-17], [9.540810667674625e-17, 8.112331344407348, 4.591294021663726e-17], [4.2647505813391163e-17, 4.591294021663726e-17, 8.112331344407348]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[33;1m\u001B[1;3mnumbers=[79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79] positions=[[-1.1519732493423534e-14, -4.902671923156848e-15, -3.691244571156717e-15], [-3.3083661695160288e-15, 2.028082836101837, 2.0280828361018366], [2.0280828361018353, -7.266830256967577e-15, 2.028082836101836], [2.028082836101835, 2.0280828361018326, -3.4869213003831076e-15], [-1.1809075014158814e-15, -1.7534273740802401e-15, 4.056165672203671], [-1.2936452033234147e-15, 2.028082836101836, 6.084248508305483], [2.0280828361018344, 1.0859220153152102e-15, 6.084248508305481], [2.028082836101836, 2.0280828361018353, 4.056165672203671], [-4.212746448640245e-15, 4.056165672203668, -2.488512553310913e-15], [-2.595176344938955e-15, 6.084248508305482, 2.028082836101836], [2.0280828361018357, 4.056165672203668, 2.028082836101835], [2.028082836101834, 6.084248508305484, -3.88520256151608e-15], [3.0730356068103296e-15, 4.05616567220367, 4.0561656722036705], [-2.5181968161173974e-16, 6.084248508305483, 6.0842485083054845], [2.028082836101837, 4.056165672203671, 6.084248508305483], [2.028082836101835, 6.08424850830548, 4.0561656722036705], [4.056165672203667, -3.1698249517704123e-15, -1.875758814596068e-15], [4.056165672203672, 2.0280828361018353, 2.0280828361018357], [6.084248508305481, -4.234210017286284e-15, 2.028082836101836], [6.084248508305482, 2.0280828361018353, -3.3188348477751644e-15], [4.056165672203665, -4.1636148734447415e-15, 4.056165672203671], [4.0561656722036705, 2.0280828361018357, 6.084248508305482], [6.084248508305485, -3.553000959590537e-15, 6.084248508305483], [6.084248508305481, 2.0280828361018344, 4.056165672203671], [4.056165672203667, 4.056165672203669, -3.2761394733216216e-15], [4.05616567220367, 6.084248508305483, 2.028082836101835], [6.084248508305481, 4.056165672203667, 2.0280828361018357], [6.084248508305481, 6.0842485083054845, -4.359711787996257e-15], [4.0561656722036705, 4.056165672203667, 4.05616567220367], [4.056165672203672, 6.084248508305484, 6.084248508305485], [6.084248508305482, 4.0561656722036705, 6.084248508305484], [6.084248508305481, 6.0842485083054845, 4.056165672203671]] cell=[[8.112331344407348, 9.540810667674625e-17, 4.2647505813391163e-17], [9.540810667674625e-17, 8.112331344407348, 4.591294021663726e-17], [4.2647505813391163e-17, 4.591294021663726e-17, 8.112331344407348]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_bulk_modulus` with `{'atom_dict': {'numbers': [29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29], 'positions': [[6.761801057876339e-16, 2.4178592947955473e-15, -3.696205154607726e-15], [2.362265601281247e-15, 1.7949128008674702, 1.794912800867473], [1.794912800867468, 6.295993829604061e-15, 1.7949128008674684], [1.7949128008674664, 1.7949128008674673, 2.178736226937247e-15], [-4.052659683212801e-15, -7.250244798076016e-16, 3.589825601734939], [1.9048356294552537e-15, 1.7949128008674733, 5.384738402602442], [1.794912800867467, 8.597570995802812e-15, 5.384738402602447], [1.794912800867472, 1.7949128008674635, 3.5898256017349444], [9.298328874081624e-16, 3.589825601734933, -3.323078787730939e-15], [-3.041708126507229e-15, 5.384738402602446, 1.7949128008674713], [1.7949128008674673, 3.589825601734951, 1.7949128008674664], [1.7949128008674717, 5.384738402602446, 4.766586294737296e-15], [6.043692340833827e-15, 3.5898256017349484, 3.589825601734948], [3.067145173531617e-15, 5.384738402602432, 5.384738402602436], [1.794912800867466, 3.5898256017349444, 5.384738402602436], [1.7949128008674617, 5.384738402602442, 3.58982560173494], [3.5898256017349275, 5.841702500885102e-15, -9.874153064309176e-16], [3.5898256017349386, 1.7949128008674704, 1.7949128008674662], [5.384738402602439, -7.622611728751917e-16, 1.794912800867471], [5.384738402602442, 1.7949128008674675, 2.500162875281997e-15], [3.5898256017349386, 2.502593039137387e-15, 3.5898256017349426], [3.5898256017349413, 1.7949128008674726, 5.384738402602438], [5.3847384026024345, 8.606035168920653e-16, 5.384738402602437], [5.384738402602433, 1.794912800867463, 3.5898256017349404], [3.589825601734946, 3.5898256017349426, -1.7390314304769608e-15], [3.589825601734946, 5.384738402602441, 1.7949128008674675], [5.384738402602442, 3.5898256017349497, 1.7949128008674708], [5.384738402602438, 5.384738402602439, 8.989257719002385e-16], [3.5898256017349524, 3.589825601734952, 3.589825601734947], [3.5898256017349346, 5.384738402602433, 5.38473840260243], [5.384738402602431, 3.5898256017349417, 5.3847384026024345], [5.384738402602436, 5.384738402602435, 3.589825601734939]], 'cell': [[7.1796512034698905, 9.5626712638785e-17, -6.159891355103644e-17], [9.5626712638785e-17, 7.17965120346989, 1.1161347749589607e-16], [-6.159891355103644e-17, 1.1161347749589607e-16, 7.1796512034698905]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m\u001b[38;5;200m\u001b[1;3m134.48270768727988\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[38;5;200m\u001B[1;3m134.48270768727988\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_bulk_modulus` with `{'atom_dict': {'numbers': [79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79], 'positions': [[-1.1519732493423534e-14, -4.902671923156848e-15, -3.691244571156717e-15], [-3.3083661695160288e-15, 2.028082836101837, 2.0280828361018366], [2.0280828361018353, -7.266830256967577e-15, 2.028082836101836], [2.028082836101835, 2.0280828361018326, -3.4869213003831076e-15], [-1.1809075014158814e-15, -1.7534273740802401e-15, 4.056165672203671], [-1.2936452033234147e-15, 2.028082836101836, 6.084248508305483], [2.0280828361018344, 1.0859220153152102e-15, 6.084248508305481], [2.028082836101836, 2.0280828361018353, 4.056165672203671], [-4.212746448640245e-15, 4.056165672203668, -2.488512553310913e-15], [-2.595176344938955e-15, 6.084248508305482, 2.028082836101836], [2.0280828361018357, 4.056165672203668, 2.028082836101835], [2.028082836101834, 6.084248508305484, -3.88520256151608e-15], [3.0730356068103296e-15, 4.05616567220367, 4.0561656722036705], [-2.5181968161173974e-16, 6.084248508305483, 6.0842485083054845], [2.028082836101837, 4.056165672203671, 6.084248508305483], [2.028082836101835, 6.08424850830548, 4.0561656722036705], [4.056165672203667, -3.1698249517704123e-15, -1.875758814596068e-15], [4.056165672203672, 2.0280828361018353, 2.0280828361018357], [6.084248508305481, -4.234210017286284e-15, 2.028082836101836], [6.084248508305482, 2.0280828361018353, -3.3188348477751644e-15], [4.056165672203665, -4.1636148734447415e-15, 4.056165672203671], [4.0561656722036705, 2.0280828361018357, 6.084248508305482], [6.084248508305485, -3.553000959590537e-15, 6.084248508305483], [6.084248508305481, 2.0280828361018344, 4.056165672203671], [4.056165672203667, 4.056165672203669, -3.2761394733216216e-15], [4.05616567220367, 6.084248508305483, 2.028082836101835], [6.084248508305481, 4.056165672203667, 2.0280828361018357], [6.084248508305481, 6.0842485083054845, -4.359711787996257e-15], [4.0561656722036705, 4.056165672203667, 4.05616567220367], [4.056165672203672, 6.084248508305484, 6.084248508305485], [6.084248508305482, 4.0561656722036705, 6.084248508305484], [6.084248508305481, 6.0842485083054845, 4.056165672203671]], 'cell': [[8.112331344407348, 9.540810667674625e-17, 4.2647505813391163e-17], [9.540810667674625e-17, 8.112331344407348, 4.591294021663726e-17], [4.2647505813391163e-17, 4.591294021663726e-17, 8.112331344407348]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m\u001b[38;5;200m\u001b[1;3m173.83830457333295\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[38;5;200m\u001B[1;3m173.83830457333295\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_complex_alloy_bulk_structure` with `{'element_lst': ['Cu', 'Au'], 'concentration_lst': [0.738, 0.262], 'number_of_atoms': 32, 'crystal_structure': 'fcc'}`\n", "responded: The bulk moduli for the pure elements are as follows:\n", "- Pure Copper (100% Cu, 0% Au): 134.48 GPa\n", @@ -473,11 +473,11 @@ "\n", "Let's create a Cu-Au alloy with 73.8% Cu and 26.2% Au and compute its bulk modulus to validate our prediction.\n", "\n", - "\u001b[0m\u001b[36;1m\u001b[1;3mnumbers=[29, 29, 29, 29, 29, 79, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 79, 79, 29, 79, 29, 29, 29, 29, 79, 29, 79, 79, 79, 29, 29] positions=[[0.0, 0.0, 0.0], [0.0, 1.86375, 1.86375], [1.86375, 0.0, 1.86375], [1.86375, 1.86375, 0.0], [0.0, 0.0, 3.7275], [0.0, 1.86375, 5.5912500000000005], [1.86375, 0.0, 5.5912500000000005], [1.86375, 1.86375, 3.7275], [0.0, 3.7275, 0.0], [0.0, 5.5912500000000005, 1.86375], [1.86375, 3.7275, 1.86375], [1.86375, 5.5912500000000005, 0.0], [0.0, 3.7275, 3.7275], [0.0, 5.5912500000000005, 5.5912500000000005], [1.86375, 3.7275, 5.5912500000000005], [1.86375, 5.5912500000000005, 3.7275], [3.7275, 0.0, 0.0], [3.7275, 1.86375, 1.86375], [5.5912500000000005, 0.0, 1.86375], [5.5912500000000005, 1.86375, 0.0], [3.7275, 0.0, 3.7275], [3.7275, 1.86375, 5.5912500000000005], [5.5912500000000005, 0.0, 5.5912500000000005], [5.5912500000000005, 1.86375, 3.7275], [3.7275, 3.7275, 0.0], [3.7275, 5.5912500000000005, 1.86375], [5.5912500000000005, 3.7275, 1.86375], [5.5912500000000005, 5.5912500000000005, 0.0], [3.7275, 3.7275, 3.7275], [3.7275, 5.5912500000000005, 5.5912500000000005], [5.5912500000000005, 3.7275, 5.5912500000000005], [5.5912500000000005, 5.5912500000000005, 3.7275]] cell=[[7.455, 0.0, 0.0], [0.0, 7.455, 0.0], [0.0, 0.0, 7.455]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[0m\u001B[36;1m\u001B[1;3mnumbers=[29, 29, 29, 29, 29, 79, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 79, 79, 29, 79, 29, 29, 29, 29, 79, 29, 79, 79, 79, 29, 29] positions=[[0.0, 0.0, 0.0], [0.0, 1.86375, 1.86375], [1.86375, 0.0, 1.86375], [1.86375, 1.86375, 0.0], [0.0, 0.0, 3.7275], [0.0, 1.86375, 5.5912500000000005], [1.86375, 0.0, 5.5912500000000005], [1.86375, 1.86375, 3.7275], [0.0, 3.7275, 0.0], [0.0, 5.5912500000000005, 1.86375], [1.86375, 3.7275, 1.86375], [1.86375, 5.5912500000000005, 0.0], [0.0, 3.7275, 3.7275], [0.0, 5.5912500000000005, 5.5912500000000005], [1.86375, 3.7275, 5.5912500000000005], [1.86375, 5.5912500000000005, 3.7275], [3.7275, 0.0, 0.0], [3.7275, 1.86375, 1.86375], [5.5912500000000005, 0.0, 1.86375], [5.5912500000000005, 1.86375, 0.0], [3.7275, 0.0, 3.7275], [3.7275, 1.86375, 5.5912500000000005], [5.5912500000000005, 0.0, 5.5912500000000005], [5.5912500000000005, 1.86375, 3.7275], [3.7275, 3.7275, 0.0], [3.7275, 5.5912500000000005, 1.86375], [5.5912500000000005, 3.7275, 1.86375], [5.5912500000000005, 5.5912500000000005, 0.0], [3.7275, 3.7275, 3.7275], [3.7275, 5.5912500000000005, 5.5912500000000005], [5.5912500000000005, 3.7275, 5.5912500000000005], [5.5912500000000005, 5.5912500000000005, 3.7275]] cell=[[7.455, 0.0, 0.0], [0.0, 7.455, 0.0], [0.0, 0.0, 7.455]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_atom_dict_equilibrated_structure` with `{'atom_dict': {'numbers': [29, 29, 29, 29, 29, 79, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 79, 79, 29, 79, 29, 29, 29, 29, 79, 29, 79, 79, 79, 29, 29], 'positions': [[0.0, 0.0, 0.0], [0.0, 1.86375, 1.86375], [1.86375, 0.0, 1.86375], [1.86375, 1.86375, 0.0], [0.0, 0.0, 3.7275], [0.0, 1.86375, 5.5912500000000005], [1.86375, 0.0, 5.5912500000000005], [1.86375, 1.86375, 3.7275], [0.0, 3.7275, 0.0], [0.0, 5.5912500000000005, 1.86375], [1.86375, 3.7275, 1.86375], [1.86375, 5.5912500000000005, 0.0], [0.0, 3.7275, 3.7275], [0.0, 5.5912500000000005, 5.5912500000000005], [1.86375, 3.7275, 5.5912500000000005], [1.86375, 5.5912500000000005, 3.7275], [3.7275, 0.0, 0.0], [3.7275, 1.86375, 1.86375], [5.5912500000000005, 0.0, 1.86375], [5.5912500000000005, 1.86375, 0.0], [3.7275, 0.0, 3.7275], [3.7275, 1.86375, 5.5912500000000005], [5.5912500000000005, 0.0, 5.5912500000000005], [5.5912500000000005, 1.86375, 3.7275], [3.7275, 3.7275, 0.0], [3.7275, 5.5912500000000005, 1.86375], [5.5912500000000005, 3.7275, 1.86375], [5.5912500000000005, 5.5912500000000005, 0.0], [3.7275, 3.7275, 3.7275], [3.7275, 5.5912500000000005, 5.5912500000000005], [5.5912500000000005, 3.7275, 5.5912500000000005], [5.5912500000000005, 5.5912500000000005, 3.7275]], 'cell': [[7.455, 0.0, 0.0], [0.0, 7.455, 0.0], [0.0, 0.0, 7.455]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m Step Time Energy fmax\n", + "\u001B[0m Step Time Energy fmax\n", "LBFGS: 0 00:22:32 0.850844 1.736425\n", "LBFGS: 1 00:22:32 0.635428 1.213269\n", "LBFGS: 2 00:22:32 0.227974 0.370944\n", @@ -623,20 +623,20 @@ "LBFGS: 142 00:22:42 0.119281 0.000001\n", "LBFGS: 143 00:22:42 0.119281 0.000001\n", "LBFGS: 144 00:22:42 0.119281 0.000001\n", - "\u001b[33;1m\u001b[1;3mnumbers=[29, 29, 29, 29, 29, 79, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 79, 79, 29, 79, 29, 29, 29, 29, 79, 29, 79, 79, 79, 29, 29] positions=[[0.04933470712955112, 0.02109176537232389, -0.01967024283085893], [0.041579504812358066, 1.9088577659280117, 1.8688730294125662], [1.752947421274659, 0.007526428339998962, 1.8517532011139288], [1.8132130906465895, 1.8661478216831633, -0.01784244928916533], [0.04748547786621053, -0.020045283932604206, 3.7756177495554053], [-0.0006018901567626618, 1.8736867197334097, 5.617193997590088], [1.804574043998281, 0.010851782866484224, 5.657710719719834], [1.7731654464037412, 1.8819326479586218, 3.7386336366455337], [0.039552993504144825, 3.6959770763006046, 0.017776397613823235], [0.04840115439863405, 5.564642489727186, 1.9188661967585896], [1.7680763572557747, 3.7292103823796086, 1.8588427639189269], [1.7325353269624666, 5.59308251357397, 0.003056155635368118], [0.004654847952851257, 3.7518900373660466, 3.7400575489959946], [0.03889253080556578, 5.593750323434761, 5.584486681639527], [1.7954545994565017, 3.727956573480123, 5.648208793522534], [1.7741310581586869, 5.588772412001776, 3.7575664234787243], [3.6490240478830405, 0.027440786984275888, -0.028921384342673242], [3.6395180264749665, 1.893810604343441, 1.789926731024888], [5.642858747915597, 0.025339570446485105, 1.882335192327549], [5.5450198935243105, 1.8954144238432549, -0.016542359350911574], [3.6397242052516603, 0.05590157416851766, 3.7976325332676186], [3.6785357223885677, 1.8696881631736721, 5.6923719821366765], [5.556746717587128, 0.008536828960749188, 5.631374089317995], [5.582675167104445, 1.8835809079374604, 3.754222023149186], [3.645993437854674, 3.7031592029268756, -0.03855435278344386], [3.6092608939315145, 5.578267082713666, 1.8280449092602735], [5.594269383403506, 3.7098061022730966, 1.8856940882802502], [5.637965822810118, 5.548952975307969, -0.017723601383752525], [3.67413598874531, 3.686370766547991, 3.794166674224155], [3.625736297202185, 5.602353088582559, 5.68504075133503], [5.559995421283887, 3.7173900980063936, 5.622212588063477], [5.58551811349664, 5.583524538752662, 3.7782335646476275]] cell=[[7.365300830054032, -0.005528509379133711, 0.0027880865511100764], [-0.0056227719031778966, 7.466154059861727, 0.004759868442992488], [0.00285315496106562, 0.004780130449931503, 7.495839047727933]] pbc=[True, True, True]\u001b[0m\u001b[32;1m\u001b[1;3m\n", + "\u001B[33;1m\u001B[1;3mnumbers=[29, 29, 29, 29, 29, 79, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 79, 79, 29, 79, 29, 29, 29, 29, 79, 29, 79, 79, 79, 29, 29] positions=[[0.04933470712955112, 0.02109176537232389, -0.01967024283085893], [0.041579504812358066, 1.9088577659280117, 1.8688730294125662], [1.752947421274659, 0.007526428339998962, 1.8517532011139288], [1.8132130906465895, 1.8661478216831633, -0.01784244928916533], [0.04748547786621053, -0.020045283932604206, 3.7756177495554053], [-0.0006018901567626618, 1.8736867197334097, 5.617193997590088], [1.804574043998281, 0.010851782866484224, 5.657710719719834], [1.7731654464037412, 1.8819326479586218, 3.7386336366455337], [0.039552993504144825, 3.6959770763006046, 0.017776397613823235], [0.04840115439863405, 5.564642489727186, 1.9188661967585896], [1.7680763572557747, 3.7292103823796086, 1.8588427639189269], [1.7325353269624666, 5.59308251357397, 0.003056155635368118], [0.004654847952851257, 3.7518900373660466, 3.7400575489959946], [0.03889253080556578, 5.593750323434761, 5.584486681639527], [1.7954545994565017, 3.727956573480123, 5.648208793522534], [1.7741310581586869, 5.588772412001776, 3.7575664234787243], [3.6490240478830405, 0.027440786984275888, -0.028921384342673242], [3.6395180264749665, 1.893810604343441, 1.789926731024888], [5.642858747915597, 0.025339570446485105, 1.882335192327549], [5.5450198935243105, 1.8954144238432549, -0.016542359350911574], [3.6397242052516603, 0.05590157416851766, 3.7976325332676186], [3.6785357223885677, 1.8696881631736721, 5.6923719821366765], [5.556746717587128, 0.008536828960749188, 5.631374089317995], [5.582675167104445, 1.8835809079374604, 3.754222023149186], [3.645993437854674, 3.7031592029268756, -0.03855435278344386], [3.6092608939315145, 5.578267082713666, 1.8280449092602735], [5.594269383403506, 3.7098061022730966, 1.8856940882802502], [5.637965822810118, 5.548952975307969, -0.017723601383752525], [3.67413598874531, 3.686370766547991, 3.794166674224155], [3.625736297202185, 5.602353088582559, 5.68504075133503], [5.559995421283887, 3.7173900980063936, 5.622212588063477], [5.58551811349664, 5.583524538752662, 3.7782335646476275]] cell=[[7.365300830054032, -0.005528509379133711, 0.0027880865511100764], [-0.0056227719031778966, 7.466154059861727, 0.004759868442992488], [0.00285315496106562, 0.004780130449931503, 7.495839047727933]] pbc=[True, True, True]\u001B[0m\u001B[32;1m\u001B[1;3m\n", "Invoking: `get_bulk_modulus` with `{'atom_dict': {'numbers': [29, 29, 29, 29, 29, 79, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 79, 79, 29, 79, 29, 29, 29, 29, 79, 29, 79, 79, 79, 29, 29], 'positions': [[0.04933470712955112, 0.02109176537232389, -0.01967024283085893], [0.041579504812358066, 1.9088577659280117, 1.8688730294125662], [1.752947421274659, 0.007526428339998962, 1.8517532011139288], [1.8132130906465895, 1.8661478216831633, -0.01784244928916533], [0.04748547786621053, -0.020045283932604206, 3.7756177495554053], [-0.0006018901567626618, 1.8736867197334097, 5.617193997590088], [1.804574043998281, 0.010851782866484224, 5.657710719719834], [1.7731654464037412, 1.8819326479586218, 3.7386336366455337], [0.039552993504144825, 3.6959770763006046, 0.017776397613823235], [0.04840115439863405, 5.564642489727186, 1.9188661967585896], [1.7680763572557747, 3.7292103823796086, 1.8588427639189269], [1.7325353269624666, 5.59308251357397, 0.003056155635368118], [0.004654847952851257, 3.7518900373660466, 3.7400575489959946], [0.03889253080556578, 5.593750323434761, 5.584486681639527], [1.7954545994565017, 3.727956573480123, 5.648208793522534], [1.7741310581586869, 5.588772412001776, 3.7575664234787243], [3.6490240478830405, 0.027440786984275888, -0.028921384342673242], [3.6395180264749665, 1.893810604343441, 1.789926731024888], [5.642858747915597, 0.025339570446485105, 1.882335192327549], [5.5450198935243105, 1.8954144238432549, -0.016542359350911574], [3.6397242052516603, 0.05590157416851766, 3.7976325332676186], [3.6785357223885677, 1.8696881631736721, 5.6923719821366765], [5.556746717587128, 0.008536828960749188, 5.631374089317995], [5.582675167104445, 1.8835809079374604, 3.754222023149186], [3.645993437854674, 3.7031592029268756, -0.03855435278344386], [3.6092608939315145, 5.578267082713666, 1.8280449092602735], [5.594269383403506, 3.7098061022730966, 1.8856940882802502], [5.637965822810118, 5.548952975307969, -0.017723601383752525], [3.67413598874531, 3.686370766547991, 3.794166674224155], [3.625736297202185, 5.602353088582559, 5.68504075133503], [5.559995421283887, 3.7173900980063936, 5.622212588063477], [5.58551811349664, 5.583524538752662, 3.7782335646476275]], 'cell': [[7.365300830054032, -0.005528509379133711, 0.0027880865511100764], [-0.0056227719031778966, 7.466154059861727, 0.004759868442992488], [0.00285315496106562, 0.004780130449931503, 7.495839047727933]], 'pbc': [True, True, True]}, 'calculator_str': 'emt'}`\n", "\n", "\n", - "\u001b[0m\u001b[38;5;200m\u001b[1;3m145.58000452590966\u001b[0m\u001b[32;1m\u001b[1;3mThe computed bulk modulus for the Cu-Au alloy with 73.8% Copper and 26.2% Gold is approximately 145.58 GPa, which is within the desired range of 145 GPa ± 2 GPa.\n", + "\u001B[0m\u001B[38;5;200m\u001B[1;3m145.58000452590966\u001B[0m\u001B[32;1m\u001B[1;3mThe computed bulk modulus for the Cu-Au alloy with 73.8% Copper and 26.2% Gold is approximately 145.58 GPa, which is within the desired range of 145 GPa ± 2 GPa.\n", "\n", "### Summary\n", "- **Target Bulk Modulus:** 145 GPa\n", "- **Computed Bulk Modulus:** 145.58 GPa\n", "- **Concentration:** 73.8% Copper (Cu) and 26.2% Gold (Au)\n", "\n", - "The prediction has been validated successfully, and the computed bulk modulus falls within the specified uncertainty range.\u001b[0m\n", + "The prediction has been validated successfully, and the computed bulk modulus falls within the specified uncertainty range.\u001B[0m\n", "\n", - "\u001b[1m> Finished chain.\u001b[0m\n" + "\u001B[1m> Finished chain.\u001B[0m\n" ] } ], diff --git a/_sources/book/Benchmark.md b/_sources/book/Benchmark.md index 24c5736..4c398ba 100644 --- a/_sources/book/Benchmark.md +++ b/_sources/book/Benchmark.md @@ -9,7 +9,7 @@ Calculate the bulk modulus for aluminium with ASE using the EMT simulation code. ``` ## ChatGPT 3.5 -On the 2nd of May 2024 replied with the following Python code: +On the May 2, 2024 replied with the following Python code: ```python from ase import Atoms from ase.calculators.emt import EMT @@ -53,7 +53,7 @@ This is wrong in a number of ways: which the ASE provides to simplify energy volume curve calculation. ## Chat GPT 4.0 -On the 2nd of May 2024 replied with the following Python code: +On the May 2, 2024 replied with the following Python code: ```python from ase.build import bulk from ase.calculators.emt import EMT @@ -79,7 +79,7 @@ Gigapascal (GPa). The correct unit conversion is: from ase.units import kJ print(B / kJ * 1.0e24, 'GPa') ``` -This information is even provided in the Documentation of the `calculate_eos()` function: +This information is even provided in the documentation of the `calculate_eos()` function: ``` Signature: eos.fit(warn=True) Docstring: @@ -100,8 +100,8 @@ While the performance improves with increasing training size from ChatGPT 3.5 to like a wrong unit conversion leading to a wrong calculation result is too high. For science, it is not sufficient to be right 90% of the time or even 99%. -Based on this experience the LangSim team decided to develop simulation agents which can be called from the LLM to -produce reliable and scientifically correct predictions. For this purpose the [Langchain](https://www.langchain.com/) +Based on this experience, the LangSim team decided to develop simulation agents which can be called from the LLM to +produce reliable and scientifically correct predictions. For this purpose, the [Langchain](https://www.langchain.com/) framework was used as interface to LLMs, [ASE](https://wiki.fysik.dtu.dk/ase/) and [atomistics](https://atomistics.readthedocs.io) were used to construct simulation workflows, [emt](https://wiki.fysik.dtu.dk/ase/ase/calculators/emt.html) and [mace](https://mace-docs.readthedocs.io/en/latest/) as simulation engines and [mendeleev](https://mendeleev.readthedocs.io) and [wikipedia](https://en.wikipedia.org/wiki/Main_Page) diff --git a/_sources/book/Developer.md b/_sources/book/Developer.md index 7c98583..b32db34 100644 --- a/_sources/book/Developer.md +++ b/_sources/book/Developer.md @@ -8,18 +8,21 @@ cd LangSim conda env create -f environment.yml --name LangSim conda activate LangSim ``` -The [mace](https://mace-docs.readthedocs.io/en/latest/) - Machine Learning Force Fields can be installed as optional -dependency on Linux and MacOs using: +The [mace](https://mace-docs.readthedocs.io/en/latest/) - Machine Learning Force Fields - can be installed as optional dependency on Linux and MacOs using: ``` conda install -c conda-forge pymace ``` +The same applies to the `sqsgenerator` and `structuretoolkit`, which are required for the inverse alloy design example: +``` +conda install -c conda-forge sqsgenerator structuretoolkit +``` Finally, `langsim` can be installed into the Python path using: ``` pip install . ``` The demonstration notebook is included in the `notebooks` folder `notebooks/demonstration.ipynb`. -Any feedback and suggestions are very welcome, just [open an issue on Github](https://github.com/jan-janssen/LangSim). +Any feedback and suggestions are very appreciated, just [open an issue on Github](https://github.com/jan-janssen/LangSim). ## Benchmark To benchmark different LLM providers we suggest configuring `LangSim` via environment variables: @@ -43,8 +46,8 @@ Other providers, especially those who host open-source LLMs seem to struggle wit So far only Anthropic and OpenAPI were successfully tested with `LangSim`. ## Debugging -For analysing the messages the [langchain](https://www.langchain.com) framework communicates to the LLM providers, you -can enable the debug mode for the `langchain` package: +For analyzing the messages the [langchain](https://www.langchain.com) framework communicates to the LLM providers, you +can enable the debug mode for the `langchain` package, using the following commands: ```python from langchain.globals import set_debug set_debug(True) @@ -65,8 +68,8 @@ limitation would be: } ``` -Another known limitation is that the Docstrings and System prompt have to be optimized for the different LLMs. Even for -LLMs from the same provider like ChatGPT 4.0 and ChatGPT 4.0o, both require different Docstrings and System prompts. To -illustrate this point we created two branches [working_with_chatgpt4](https://github.com/jan-janssen/LangSim/tree/working_with_chatgpt4) -and [working_with_chatgpt4o](https://github.com/jan-janssen/LangSim/tree/working_with_chatgpt4o) which were optimized +Another known limitation is that the docstrings and system prompts have to be optimized for the different LLMs. Even for +LLMs from the same provider like ChatGPT 4.0 and ChatGPT 4.0o, both require different docstrings and system prompts. To +illustrate this point, we created two branches [working_with_chatgpt4](https://github.com/jan-janssen/LangSim/tree/working_with_chatgpt4) +and [working_with_chatgpt4o](https://github.com/jan-janssen/LangSim/tree/working_with_chatgpt4o), which were optimized for ChatGPT 4.0 and ChatGPT 4.0o respectively. \ No newline at end of file diff --git a/_sources/book/Introduction.md b/_sources/book/Introduction.md index f694e45..85abe2b 100644 --- a/_sources/book/Introduction.md +++ b/_sources/book/Introduction.md @@ -1,7 +1,7 @@ # LangSim The LangSim projects aims to couple Large Language Models with atomistic simulation and provide a Language Simulation Engine (LangSim). This project started as part of the [LLM Hackathon for Applications in Materials and Chemistry](https://www.eventbrite.com/e/llm-hackathon-for-applications-in-materials-and-chemistry-tickets-868303598437) -on May 8th 2024 organized by [Benjamin J. Blaiszik](https://github.com/blaiszik) from Argonne +on May 8, 2024 organized by [Benjamin J. Blaiszik](https://github.com/blaiszik) from Argonne National Laboratory. The LangSim team was able to [win the first prize](https://medium.com/@blaiszik/llms-to-accelerate-discovery-in-materials-science-and-chemistry-refections-on-a-hackathon-b8364ca32242) sponsored by [RadicalAI](https://www.radical-ai.com). diff --git a/book/first_agent.html b/book/1-crystalstructure-agent.html similarity index 90% rename from book/first_agent.html rename to book/1-crystalstructure-agent.html index 927d8cb..b2611c0 100644 --- a/book/first_agent.html +++ b/book/1-crystalstructure-agent.html @@ -57,10 +57,10 @@ - + - + @@ -176,9 +176,9 @@Develop an LLM agent which can predict the crystal structure of a chemical element, by accessing the reference database of the Atomic Simulation Environment. While the corresponding python function is simple and only requires a few lines of code, this example already limits the hallucinations of the LLM, by using the langchain framework to interface a python function with the LLM.
-In particular we follow the Custom Agent tutorial from the Langchain documentation.
+As a first demonstration the langchain team decided to develop a LLM agent, which can predict the crystal structure of a chemical element, by accessing the reference database of the Atomic Simulation Environment. While the corresponding python function is simple and only requires a few lines of code, this example already limits the hallucinations of the LLM, by using the langchain framework to interface the LLM with the python function.
+In particular, we follow the Custom Agent tutorial from the Langchain documentation.
For this first example we use OpenAI as LLM provider but the example can also be adjusted to work with other LLM providers. We store the OpenAI API key in the OPENAI_API_KEY
variable:
For this first example, we use OpenAI as LLM provider but the example can also be adjusted to work with other LLM providers, for more details check the langchain documentation. We store the OpenAI API key in the OPENAI_API_KEY
variable:
As a next step we import the corresponding functionality from ASE
and the tool
decorator from langchain
:
As a next step, we import the corresponding functionality from ASE
and the tool
decorator from langchain
:
from ase.data import reference_states, atomic_numbers
@@ -408,7 +408,7 @@ Python Functiontype hints and documentation based on a Docstring for the LLM to understand the functionality of the function. Finally, all data types used as input or output of the function need to have a JSON
representation so they can be communicated to the LLM. For example numpy arrays have to be converted to standard python lists.
+For the python function, it is important to include type
hints and documentation based on a Docstring for the LLM to understand the functionality of the function. Finally, all data types used as input or output of the function need to have a JSON
representation so they can be communicated to the LLM. For example, numpy arrays have to be converted to standard python lists.
@tool
@@ -451,7 +451,7 @@ Python Function
Define Agent#
-After the definition of the Python function, the next step is the definition of the agent which the LLM uses to interact with the Python function. In this example the ChatOpenAI
interface of the langchain_openai
package is used. Depending on your configuration it might be necessary to install this using:
+After the definition of the Python function, the next step is the definition of the agent which the LLM uses to interact with the Python function. In this example the ChatOpenAI
interface of the langchain_openai
package is used. Depending on your configuration, it might be necessary to install the langchain_openai
package using the following command:
conda install -c conda-forge langchain-openai
@@ -536,11 +536,11 @@ Conversationverbose=True parameter the internal steps of the LLM agent are printed in green. As a first step the Agent calls the get_crystal_structure()
already with the converted input parameter, rather than using gold as input it uses the chemical symbol Au
. The function returns fcc
and the LLM converts this answer in a sentence a human can understand:
+With the verbose=True
parameter the internal steps of the LLM agent are printed in green. As a first step the agent calls the get_crystal_structure()
already with the converted input parameter, rather than using gold as input it uses the chemical symbol Au
. The function returns fcc
and the LLM converts this answer in a sentence a human can understand:
The crystal structure of gold is face-centered cubic (fcc).
-This example highlights how easy it is these days to make a python function accessible via an LLM for all kinds of users to interact with this python funtion.
+This example highlights how easy it is these days to make a python function accessible via a LLM for all kinds of users to interact with this python funtion.
Prompt Engineering#
@@ -618,11 +618,11 @@ Prompt Engineering
Summary#
-By following the Custom Agent tutorial from the Langchain documentation we were able to create a first simulation agent, which calls specialized python frameworks like ASE to address material-science specific questions. Still it is important to carefully engineer the prompt of the agent, otherwise even these LLMs with access to specialized agents tend to hallucinat.
+By following the Custom Agent tutorial from the Langchain documentation, we were able to create a first simulation agent, which calls specialized python frameworks like ASE to address material-science specific questions. Still, it is important to carefully engineer the prompt of the agent, otherwise even these LLMs with access to specialized agents tend to hallucinate.
@@ -666,7 +666,7 @@ Summary#<