diff --git a/data/.azure/component_detection.yml b/data/.azure/component_detection.yml new file mode 100644 index 0000000000000000000000000000000000000000..20b1643a9242aa2d5d91aac8d5b266f393ea8f27 --- /dev/null +++ b/data/.azure/component_detection.yml @@ -0,0 +1,34 @@ +trigger: +- main + +pool: + vmImage: 'ubuntu-latest' + +schedules: # This cron expression schedules the pipeline to run every Tuesday at 9am GMT +- cron: '0 9 * * 2' + displayName: Weekly CG run + always: true + branches: + include: + - main + +steps: +- script: | + export PipReportOverrideBehavior="SourceCodeScan" + echo $PipReportOverrideBehavior + pip install --upgrade pip + pip --version + which pip + pip install uv + uv venv .venv --python 3.10 && source .venv/bin/activate + uv pip compile pyproject.toml -o requirements.txt + # too.uv.sources information is ignored by the pip compile command, manually add the individual URLs to the wheels for torch. + # See https://github.com/astral-sh/uv/issues/8846 + sed -i 's|torch==2.2.1+cu118|torch @ https://download.pytorch.org/whl/cu118/torch-2.2.1%2Bcu118-cp310-cp310-linux_x86_64.whl#sha256=438668ad1eec3a7d1a0473ebf8b60f4557e51548d6be0497d32cc6c3a26a1945|g' requirements.txt + sed -i 's|torchaudio==2.2.1+cu118|torchaudio @ https://download.pytorch.org/whl/cu118/torchaudio-2.2.1%2Bcu118-cp310-cp310-linux_x86_64.whl#sha256=734db8030b3c5ff6bb4135b0d0a9eec79690900c5b5edd259f230b02d6fbcb04|g' requirements.txt + sed -i 's|torchvision==0.17.1+cu118|torchvision @ https://download.pytorch.org/whl/cu118/torchvision-0.17.1%2Bcu118-cp310-cp310-linux_x86_64.whl#sha256=dfe27be6328d85300ba9c2f3862993841c41a0daa4b4ba99c22e9fd509a21e2f|g' requirements.txt + displayName: 'Export dependencies' + +- task: ComponentGovernanceComponentDetection@0 + env: + PipReportOverrideBehavior: SourceCodeScan diff --git a/data/.lfsconfig b/data/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..2cf1bce1b17fca62c76192fcf521fd3bb171249b --- /dev/null +++ b/data/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + fetchexclude = * diff --git a/data/CODE_OF_CONDUCT.md b/data/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000000000000000000000000000000..f9ba8cf65f3e3104dd061c178066ec8247811f33 --- /dev/null +++ b/data/CODE_OF_CONDUCT.md @@ -0,0 +1,9 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/data/CONTRIBUTING.md b/data/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..fdbeb569ddb8a990643a341dfec4fa24413a4cbb --- /dev/null +++ b/data/CONTRIBUTING.md @@ -0,0 +1,15 @@ +# Contributing + +This project welcomes contributions and suggestions. +Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, +and actually do, grant us the rights to use your contribution. +For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). + +When you submit a pull request, a CLA-bot will automatically determine whether you need +to provide a CLA and decorate the PR appropriately (e.g., label, comment). +Simply follow the instructions provided by the bot. +You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \ No newline at end of file diff --git a/data/LICENSE b/data/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/data/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/data/MODEL_CARD.md b/data/MODEL_CARD.md new file mode 100644 index 0000000000000000000000000000000000000000..7a7cfc1bc328386e5f460036593a32ed374b92d0 --- /dev/null +++ b/data/MODEL_CARD.md @@ -0,0 +1,176 @@ +--- +license: mit +license_link: https://opensource.org/license/mit + +arxiv: 2312.03687 +language: +- en +tags: +- materials-science +- generative-ai +- materials-discovery +--- + +# MatterGen + +<!-- Provide a quick summary of what the model is/does. --> + +MatterGen is a generative model for inorganic materials design. + +## Model Details + +### Model Description + +<!-- Provide a longer summary of what this model is. --> + +MatterGen is a generative model for inorganic materials design. It is a diffusion model which jointly predicts a material’s atomic fractional coordinates, elements, as well as unit cell lattice vectors. Besides unconditional generation of material candidates, MatterGen can also be trained or fine-tuned for conditional generation based on target property values, e.g., bulk modulus, chemical system, or magnetic density. + +- **Developed by:** Materials Design Team, Microsoft Research AI for Science +- **Model type:** Diffusion model +- **License:** MIT + +### Model Sources + +<!-- Provide the basic links for the model. --> + +- **Repository:** https://github.com/microsoft/mattergen +- **Paper:** https://arxiv.org/abs/2312.03687 + +## Uses + +<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. --> + +### Direct Use + +<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. --> + +1. Generate inorganic materials candidates without property condition. +2. Fine-tune the base model on user-provided data with property-labeled materials. +3. Generate inorganic materials candidates with target property, e.g., bulk modulus, chemical system, magnetic density, or user-defined target properties after fine-tuning. + + +### Out-of-Scope Use + +<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. --> + +* Generate materials with more than 20 atoms inside the unit cell. +* Generate organic crystals or non-crystalline materials. +* Generate crystals containing noble gas elements, radioactive elements, or elements with atomic number greater than 84 – these elements were removed from the training data. + +## Bias, Risks, and Limitations + +<!-- This section is meant to convey both technical and sociotechnical limitations. --> + +MatterGen was only trained on and evaluated on up to 20 atoms inside the unit cell; more atoms are currently not supported. MatterGen’s training data is materials below 0.1 eV/atoms below the reference convex hull. Therefore, it is expected that the fraction of generated materials on or below the convex hull is significantly lower than the fraction of materials within 0.1 eV/atom above the convex hull. + + +### Recommendations + +<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. --> + +The performance on property-guided generation heavily depends on the quality and quantity of the property labels used to train MatterGen. For extreme property values where there are few training structures with similar values, the performance may degrade. + +For fine-tuning the model on a new property, use a sufficient amount of labeled property data for training, i.e., at least several thousands of labeled structures. Also ensure good coverage of property values in the range of values which are intended for property-guided generation. + +## How to Get Started with the Model + +Clone the [repository](https://github.com/microsoft/mattergen) and follow the README instructions. + +## Training Details + +### Training Data + +<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. --> + +MatterGen was trained on crystalline materials from the following data sources: +1. MP (https://next-gen.materialsproject.org/; v2022.10.28, Creative Commons Attribution 4.0 International License), an open-access resource containing DFT-relaxed crystal structures obtained from a variety of sources, but largely based upon experimentally-known crystals. +2. The Alexandria dataset (https://alexandria.icams.rub.de/; Creative Commons Attribution 4.0 International License), an open-access resource containing DFT-relaxed crystal structures from a variety of sources, including a large quantity of hypothetical crystal structures generated by ML methods or other algorithmic means. +To train MatterGen, we select only structures with up to 20 atoms and whose energy above hull is below 0.1 eV/atom. Further, we remove structures that contain noble gas elements, elements with atomic number higher than 84 (which includes most radioactive elements), or the radioactive elements “Tc” and “Pm” from the training data. For more information, see paper, Supplementary C.1. + +### Training Procedure + +<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. --> + +#### Preprocessing + +We relax structures from the above data sources with DFT and select only those structures whose energy above the combined convex hull is below 0.1 eV/atom. MatterGen is trained solely on primitive structures. We further select only structures with up to 20 atoms inside the unit cell. We use the Niggli reduction to preprocess the unit cell lattices, followed by the polar decomposition to ensure the lattice matrices are symmetric matrices. See the paper for more detailed information. + +#### Training Hyperparameters + +* Starting learning rate 1e-4, reduces successively by a factor of 0.6 when training loss does not reduce within 100 epochs, up to 1e-6. +* Batch size 512 +* float32 precision + +#### Speeds, Sizes, Times + +<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. --> + +* MatterGen contains 46.8M parameters +* One training epoch of around 600K training samples takes around 6 minutes on 8 NVIDIA A100 GPUs +* Sampling 1,000 structures takes around two hours using a single NVIDIA V100 GPU + + +## Evaluation + +<!-- This section describes the evaluation protocols and provides the results. --> + +### Testing Data, Factors & Metrics + + +#### Metrics + +<!-- These are the evaluation metrics being used, ideally with a description of why. --> + +MatterGen was evaluated on unconditional generation across the following metrics: +* The percentage of stable, novel, and unique (S.U.N.) structures among 1,024 generated samples. + - Stable means a structure’s energy is less than 0.1 eV/atom above the reference convex hull + - Novel means a structure does not match any structure in our reference dataset with the disordered structure matcher presented in the paper. + - Unique means that there is no other structure among the generated ones which matches a given structure. +* The average root mean square distance (RMSD) of generated structures and their DFT-relaxed local energy minima, measured in Angstrom. + + +### Results + +MatterGen achieves 38.57 % S.U.N. rate among generated structures, and the average RMSD of its samples is 0.021 Angstrom. For more details see Section 2.2 of the MatterGen paper. +We also evaluate MatterGen on property-conditioned generation. +• For generation conditioned on chemical system, MatterGen produces 83 % S.U.N. structures on well-explored chemical systems, 65 % on partially explored systems, and 49 % on unexplored chemical systems. For more details, see Section 2.3 of the MatterGen paper. +• Conditioning on a bulk modulus value of 400 GPa, MatterGen produces 106 S.U.N. structures with > 400 GPa bulk modulus given a budget of 180 DFT property calculations. For more details, see Section 2.4 of the MatterGen paper. +• Conditioning on magnetic density of > 0.2 Angstrom-3, MatterGen produces 18 S.U.N. structures complying with the condition given a budget of 180 DFT property calculations. For more details, see Section 2.4 of the MatterGen paper. + +#### Summary + +MatterGen is able to produce novel, unique, and stable material candidates both with and without property conditions. For property-guided generation, MatterGen is able to produce S.U.N. structures with extreme property values such as 400 GPa bulk modulus, where there are only two such structures in the labeled reference set. MatterGen outperforms both classical as well as recent deep generative model baselines. For more details on the performance of MatterGen, see the paper. + +## Technical Specifications + +### Model Architecture and Objective + +The model architecture is based on GemNet (Gasteiger et al. 2021). + +## Citation + +<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. --> + +**BibTeX:** +```bibtex +@article{zeni2023mattergen, + title={Mattergen: a generative model for inorganic materials design}, + author={Zeni, Claudio and Pinsler, Robert and Z{\"u}gner, Daniel and Fowler, Andrew and Horton, Matthew and Fu, Xiang and Shysheya, Sasha and Crabb{\'e}, Jonathan and Sun, Lixin and Smith, Jake and others}, + journal={arXiv preprint arXiv:2312.03687}, + year={2023} +} +``` + +**APA:** + +Zeni, C., Pinsler, R., Zügner, D., Fowler, A., Horton, M., Fu, X., ... & Xie, T. (2023). Mattergen: a generative model for inorganic materials design. arXiv preprint arXiv:2312.03687. + + +## Model Card Authors + +Daniel Zügner (dzuegner@microsoft.com) + +## Model Card Contact + +Daniel Zügner (dzuegner@microsoft.com) +Tian Xie (tianxie@microsoft.com) \ No newline at end of file diff --git a/data/NOTICE b/data/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..dc28ea145c4ec166105bb8bf25559f9541dc82b3 --- /dev/null +++ b/data/NOTICE @@ -0,0 +1,10443 @@ +NOTICES AND INFORMATION +Do Not Translate or Localize + +This software incorporates material from third parties. +Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, +or you may send a check or money order for US $5.00, including the product name, +the open source component name, platform, and version number, to: + +Source Code Compliance Team +Microsoft Corporation +One Microsoft Way +Redmond, WA 98052 +USA + +Notwithstanding any other terms, you may reverse engineer this software to the extent +required to debug changes to any libraries licensed under the GNU Lesser General Public License. + +--------------------------------------------------------- + +aiohappyeyeballs 2.4.4 - 0BSD AND BSD-3-Clause AND LicenseRef-scancode-unknown-license-reference AND PSF-2.0 AND Python-2.0 + + +Copyright (c) 1995-2001 Corporation for National Research Initiatives +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherlands +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation + +0BSD AND BSD-3-Clause AND LicenseRef-scancode-unknown-license-reference AND PSF-2.0 AND Python-2.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +absl-py 2.1.0 - Apache-2.0 + + +Copyright 2017 The Abseil Authors +Copyright 2018 The Abseil Authors +Copyright 2021 The Abseil Authors + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +aiohttp 3.11.11 - Apache-2.0 + + +Copyright Fedor Indutny, 2018 +Copyright aio-libs contributors +copyright f project contributors + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +aiosignal 1.3.2 - Apache-2.0 + + +copyright 2013-2019, aiosignal contributors +Copyright 2013-2019 Nikolay Kim and Andrew Svetlov + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +arrow 1.3.0 - Apache-2.0 + + +Copyright 2023 Chris Smith +copyright 2023, Chris Smith + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +asttokens 3.0.0 - Apache-2.0 + + +copyright 2023, Grist Labs +Copyright 2016 Grist Labs, Inc. +Copyright 2023, Grist Labs, Inc. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +async-timeout 5.0.1 - Apache-2.0 + + +Copyright 2016-2020 aio-libs collaboration + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +bcrypt 4.2.1 - Apache-2.0 + + +Copyright 2013-2024 + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +bleach 6.2.0 - Apache-2.0 + + +Copyright (c) 2014-2017, Mozilla Foundation +Copyright (c) 2006-2013 James Graham and other contributors +copyright 2012-2015, James Socol 2015-2017, Mozilla Foundation + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +clarabel 0.9.0 - Apache-2.0 + + +(c) Paul Goulart +Copyright 2022 University of Oxford Control Group + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +cython 3.0.11 - Apache-2.0 + + +(c) Copyright CNRI +(c) Real 17.0 Imag +Copyright (c) 2005 Carl Friedrich Bolz +Copyright (c) 1995 Sun Microsystems, Inc. +Copyright (c) 2010-2011, IPython Development Team + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +docker-pycreds 0.4.0 - Apache-2.0 + + + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +fire 0.7.0 - Apache-2.0 + + +Copyright 2013 Google LLC. +Copyright 2015 Google LLC. +Copyright 2017 Google Inc. +Copyright 2018 Google LLC. +Copyright (c) 2018 Google Inc. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +frozenlist 1.5.0 - Apache-2.0 + + +copyright 2013, frozenlist contributors +Copyright 2013-2019 Nikolay Kim and Andrew Svetlov + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +lazy-model 0.2.0 - Apache-2.0 + + +Copyright 2022 Roman + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +msgpack 1.1.0 - Apache-2.0 + + +Copyright (c) 2009 Naoki INADA +Copyright (c) 2008-2010 FURUHASHI Sadayuki +Copyright (c) 2008-2011 INADA Naoki <songofacandy@gmail.com> + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +multidict 6.1.0 - Apache-2.0 + + +Copyright 2016 Andrew Svetlov and aio-libs contributors +copyright 2016, Andrew Svetlov and aio-libs contributors + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +osqp 0.6.7.post3 - Apache-2.0 + + +Copyright (c) 2012, Timothy A. Davis +Copyright (c) 2013, Timothy A. Davis +Copyright (c) Timothy A. Davis, Patrick R. Amestoy, and Iain S. Duff +(c) Bartolomeo Stellato, Goran Banjac University of Oxford - Stanford University +Copyright (c), 1996-2015, Timothy A. Davis, Patrick R. Amestoy, and Iain S. Duff +Copyright (c) 1996-2013 by Timothy A. Davis, Patrick R. Amestoy, and Iain S. Duff +Copyright (c) 2004 by Timothy A. Davis, Patrick Amestoy, Iain S. Duff, John K. Reid +(c) Bartolomeo Stellato, Goran Banjac print University of Oxford - Stanford University + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +overrides 7.7.0 - Apache-2.0 + + +Copyright 2016 Keunhong Lee +Copyright 2019 Mikko Korpela + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +petname 2.6 - Apache-2.0 + + +Copyright 2014 Dustin Kirkland <dustin.kirkland@gmail.com> +Copyright (c) 2013 Casey Marshall <casey.marshall@gmail.com> +Copyright (c) 2019 Dustin Kirkland <dustin.kirkland@gmail.com> + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +propcache 0.2.1 - Apache-2.0 + + +copyright f'2016, Andrew Svetlov, project +Copyright 2016-2021, Andrew Svetlov and aio-libs team + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pyarrow 18.1.0 - Apache-2.0 + + +Copyright 2011 Kitware, Inc. +Copyright 2012 Cloudera Inc. +Copyright Contributors to the pythoncapi_compat project. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pydeck 0.9.1 - Apache-2.0 + + +Copyright (c) 2015, Mapbox +Copyright (c) 2016, Mapbox +copyright 2011 Google Inc. +Copyright 2020 Daniel Wirtz +Copyright (c) 2008 Apple Inc. +Copyright (c) 2014 Adam Krebs +Copyright (c) 2016-17 Karl Cheng +Copyright (c) 2016 Jorik Tangelder +Copyright 2009 The Closure Library +Copyright (c) 2014-2017, PhosphorJS +Copyright (c) 2014-2018, PhosphorJS +Copyright (c) 2014-2019, PhosphorJS +Copyright (c) Microsoft Corporation +(c) gr Halfwidth and Fullwidth Forms +Copyright 2022 Foursquare Labs, Inc. +Copyright (c) Uber Technologies, Inc. +(c) 2013 Daniel Wirtz <dcode@dcode.io> +Copyright (c) Jupyter Development Team +(c) 2015 Adam Krebs, Jimmy Yuen Ho Wong +(c) Dean McNamee <dean@gmail.com> , 2012 +Copyright (c) 2018-2019 HERE Europe B.V. +Copyright (c) 2015 Uber Technologies, Inc. +Copyright (c) 2017 Uber Technologies, Inc. +Copyright (c) 2019 Uber Technologies, Inc. +Copyright 2009 The Closure Library Authors +Copyright (c) 2016, AJ ONeal <aj@daplie.com> +Copyright (c) 2017, Jupyter Development Team +Copyright 2013 Daniel Wirtz <dcode@dcode.io> +Copyright (c) 2015-2017 Uber Technologies, Inc. +Copyright (c) 2014-2016, Jupyter Development Team +Copyright (c) 2014-2017, Jupyter Development Team +Copyright (c) 2015 - 2017 Uber Technologies, Inc. +Copyright (c) 2015 - 2018 Uber Technologies, Inc. +Copyright (c) 2015 - 2019 Uber Technologies, Inc. +Copyright 2018-2019, 2022 Uber Technologies, Inc. +Copyright OpenJS Foundation and other contributors +Copyright 2020 vis.gl, a Series of LF Projects, LLC +Copyright (c) 2013 Stephen Oney, http://jsep.from.so +Copyright (c) 2010-2015 Jeremy Ashkenas, DocumentCloud +Copyright (c) 2019, Michael Fogleman, Vladimir Agafonkin +Copyright (c) 2016-2017 Mohamad Moneimne and Contributors +Copyright (c) 2012-2016, Jon Atkins <github@jonatkins.com> +Copyright (c) 2016-2021, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) +(c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Backbone +(c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors Underscore + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pymongo 4.10.1 - Apache-2.0 + + +Copyright 2015 MongoDB, Inc. +Copyright 2016 MongoDB, Inc. +Copyright 2017 MongoDB, Inc. +Copyright 2018 MongoDB, Inc. +Copyright 2009-2015 MongoDB, Inc. +Copyright 2010-2015 MongoDB, Inc. +Copyright 2011-2015 MongoDB, Inc. +Copyright 2013-2016 MongoDB, Inc. +Copyright 2014-2015 MongoDB, Inc. +Copyright 2014-2016 MongoDB, Inc. +Copyright 2009-present MongoDB, Inc. +Copyright 2010-present MongoDB, Inc. +Copyright 2011-present MongoDB, Inc. +Copyright 2012-present MongoDB, Inc. +Copyright 2013-present MongoDB, Inc. +Copyright 2014-present MongoDB, Inc. +Copyright 2015-present MongoDB, Inc. +Copyright 2016-present MongoDB, Inc. +Copyright 2017-present MongoDB, Inc. +Copyright 2018-present MongoDB, Inc. +Copyright 2019-present MongoDB, Inc. +Copyright 2020-present MongoDB, Inc. +Copyright 2021-present MongoDB, Inc. +Copyright 2022-Present MongoDB, Inc. +Copyright 2022-present MongoDB, Inc. +Copyright 2023-Present MongoDB, Inc. +Copyright 2023-present MongoDB, Inc. +Copyright 2024-Present MongoDB, Inc. +Copyright 2024-present MongoDB, Inc. +Copyright 2007-2011 by the Sphinx team +Copyright (c) 2007-2010 Michael G Schwern +Copyright (c) 2006-2013 Alexander Chemeris +copyright MongoDB, Inc. 2008-present. MongoDB, Mongo + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pynacl 1.5.0 - Apache-2.0 + + +(c) 2013-2019, Frank Denis +Copyright 2013-2018 .format +Copyright 2009 Colin Percival +Copyright (c) 1994 X Consortium +Copyright (c) 2015 Thomas Pornin +Copyright 2013 Alexander Peslyak +Copyright (c) 2013-2021 Frank Denis +Copyright (c) 2013-2019 The libsodium +Copyright 2012,2013 Alexander Peslyak +Copyright 2005,2007,2009 Colin Percival +Copyright (c) 2019 Reini Urban <rurban@cpan.org> +Copyright (c) 2011 Free Software Foundation, Inc. +Copyright (c) 2014 Free Software Foundation, Inc. +Copyright (c) 2021 Free Software Foundation, Inc. +Copyright (c) 2017 David Seifert <soap@gentoo.org> +Copyright 1992-2021 Free Software Foundation, Inc. +Copyright (c) 2008 Alan Woodland <ajw05@aber.ac.uk> +Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> +Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl> +Copyright (c) 1994-2020 Free Software Foundation, Inc. +Copyright (c) 1996-2013 Free Software Foundation, Inc. +Copyright (c) 1996-2015 Free Software Foundation, Inc. +Copyright (c) 1996-2020 Free Software Foundation, Inc. +Copyright (c) 1997-2020 Free Software Foundation, Inc. +Copyright (c) 1999-2013 Free Software Foundation, Inc. +Copyright (c) 1999-2020 Free Software Foundation, Inc. +Copyright (c) 2001-2020 Free Software Foundation, Inc. +Copyright (c) 2002-2020 Free Software Foundation, Inc. +Copyright (c) 2003-2020 Free Software Foundation, Inc. +Copyright (c) 2004-2015 Free Software Foundation, Inc. +Copyright (c) 2004-2020 Free Software Foundation, Inc. +Copyright (c) 2006-2020 Free Software Foundation, Inc. +Copyright (c) 2008-2013 Free Software Foundation, Inc. +Copyright (c) 2009-2020 Free Software Foundation, Inc. +Copyright (c) 2010-2015 Free Software Foundation, Inc. +Copyright (c) 2011-2020 Free Software Foundation, Inc. +Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG> +Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> +Copyright 2013 Donald Stufft and individual contributors +Copyright 2014 Donald Stufft and individual contributors +Copyright 2016 Donald Stufft and individual contributors +Copyright 2017 Donald Stufft and individual contributors +Copyright 2018 Donald Stufft and individual contributors +Copyright 2020 Donald Stufft and individual contributors +copyright 2013, Donald Stufft and Individual Contributors +Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +Copyright (c) 2010 Diego Elio Petteno <flameeyes@gmail.com> +Copyright (c) 2004, 2011-2015 Free Software Foundation, Inc. +Copyright 2013-2017 Donald Stufft and individual contributors +Copyright 2013-2018 Donald Stufft and individual contributors +Copyright 2013-2019 Donald Stufft and individual contributors +Copyright 2016-2019 Donald Stufft and individual contributors +Copyright (c) 1996-2001, 2003-2015 Free Software Foundation, Inc. +Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au> +Copyright (c) 2015 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com> +Copyright (c) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, Inc. +Copyright (c) 2004-2005, 2007-2008, 2011-2015 Free Software Foundation, Inc. +Copyright (c) 2004-2005, 2007-2009, 2011-2015 Free Software Foundation, Inc. +Copyright (c) 2004-2005, 2007, 2009, 2011-2015 Free Software Foundation, Inc. +Copyright (c) 2014, 2015, 2016 Philip Withnall <philip.withnall@collabora.co.uk> + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +python-dateutil 2.9.0.post0 - Apache-2.0 + + +copyright 2019, dateutil +Copyright 2017- dateutil contributors +Copyright (c) 2015- - dateutil contributors +Copyright 2017- Paul Ganssle <paul@ganssle.io> +Copyright (c) 2015- - Paul Ganssle <paul@ganssle.io> +Copyright (c) 2014-2016 - Yaron de Leeuw <me@jarondl.net> +Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net> +Copyright (c) 2012-2014 - Tomi Pievilainen <tomi.pievilainen@iki.fi> + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pytorch-lightning 2.0.6 - Apache-2.0 + + +Copyright Lightning AI. +Copyright The Lightning AI team +Copyright (c) 2018- time.strftime +Copyright (c) 2022- time.strftime +Copyright 2018-2021 William Falcon +Copyright 2020 The PyTorch Lightning team and Microsoft Corporation + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +qdldl 0.1.7.post5 - Apache-2.0 + + +Copyright (c) 2012, Timothy A. Davis +Copyright (c) 2013, Timothy A. Davis +Copyright 2020 Paul Goulat, Bartolomeo Stellato, Goran Banjac +Copyright (c) Timothy A. Davis, Patrick R. Amestoy, and Iain S. Duff +Copyright (c), 1996-2015, Timothy A. Davis, Patrick R. Amestoy, and Iain S. Duff +Copyright (c) 1996-2013 by Timothy A. Davis, Patrick R. Amestoy, and Iain S. Duff +Copyright (c) 2004 by Timothy A. Davis, Patrick Amestoy, Iain S. Duff, John K. Reid + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +requests 2.32.3 - Apache-2.0 + + +Copyright Kenneth Reitz +Copyright 2019 Kenneth Reitz +copyright (c) 2012 by Kenneth Reitz +copyright (c) 2017 by Kenneth Reitz + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +s3transfer 0.10.4 - Apache-2.0 + + +Copyright 2016 Amazon.com, Inc. or its affiliates +Copyright 2017 Amazon.com, Inc. or its affiliates +Copyright 2018 Amazon.com, Inc. or its affiliates +Copyright 2019 Amazon.com, Inc. or its affiliates +Copyright 2021 Amazon.com, Inc. or its affiliates + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +streamlit 1.41.1 - Apache-2.0 + + +(c) Zeno Rocha +(c) Kyle Simpson +(c) Sindre Sorhus +(c) 2020 Denis Pushkarev +(c) http://www.esri.com> +Copyright 2009 The Closure +Copyright 2020 Daniel Wirtz +(c) 2017-2021 Joachim Wester +(c) 2017-2022 Joachim Wester +Copyright (c) 2014-2018 Khan +(c) 2009-2016 Michael Leibman +Copyright (c) 2018 Jed Watson +Steven Levithan (c) 2007-2017 +Steven Levithan (c) 2008-2017 +Steven Levithan (c) 2009-2017 +Steven Levithan (c) 2010-2017 +Steven Levithan (c) 2012-2017 +(c) Cure53 and other contributors +Copyright (c) 2016 Jorik Tangelder +Copyright 2018 John Madhavan-Reese +Copyright (c) Microsoft Corporation +(c) 2013 Daniel Wirtz <dcode@dcode.io> +Copyright (c) 2014-2015, Jon Schlinkert +Copyright (c) 2009-2010 Design Science, Inc. +Copyright (c) Facebook, Inc. and its affiliates +Copyright (c) JS Foundation and other contributors +Copyright OpenJS Foundation and other contributors +Copyright jQuery Foundation and other contributors +Copyright (c) 2016 Federico Zivolo and contributors +Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> +Copyright (c) 2008-Present, IPython Development Team +(c) 2009-2010, Design Science, Inc. <www.mathjax.org> +Copyright (c) 2002-2022 - ProphICy Semiconductor, Inc. +Copyright (c) 2012-2017 Kirollos Risk (http://kiro.me) +Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> +Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. +Copyright (c) 2014-2018 Khan Academy <www.khanacademy.org> +copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc +(c) 2019 Josh Johnson https://github.com/jshjohnson/Choices +Copyright (c) 2010 Three Dub Media - http://threedubmedia.com +Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors +Copyright (c) 2017 Benjamin Van Ryseghem <benjamin@vanryseghem.com> +Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu> +(c) http://www.esri.com> ESRI ,'ortoInstaMaps type:raster,'tiles' https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857 + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +tenacity 9.0.0 - Apache-2.0 + + +Copyright 2013 Ray +Copyright 2013-2014 Ray +Copyright 2017 Elisey Zanko +Copyright 2016 Joshua Harlow +Copyright 2016 Julien Danjou +Copyright 2016 Etienne Bersac +Copyright 2016-2018 Julien Danjou +Copyright 2016-2021 Julien Danjou + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +tornado 6.4.2 - Apache-2.0 + + +Copyright 2009 Facebook +Copyright 2011 Facebook +Copyright 2012 Facebook +Copyright 2014 Facebook +Copyright 2015 The Tornado Authors + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +tzdata 2024.2 - Apache-2.0 + + +Copyright (c) 2020, Paul Ganssle +copyright 2020, Python Software Foundation + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +websocket-client 1.8.0 - Apache-2.0 + + +Copyright 2024 engn33r + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +yarl 1.18.3 - Apache-2.0 + + +copyright f'2016, Andrew Svetlov, project +Copyright 2016-2021, Andrew Svetlov and aio-libs team + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +packaging 24.2 - Apache-2.0 AND BSD-2-Clause + + +Copyright (c) 2017-present Ofek Lev <oss@ofek.dev> +Copyright (c) Donald Stufft and individual contributors + +Apache-2.0 AND BSD-2-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +prometheus-client 0.21.1 - Apache-2.0 AND BSD-2-Clause + + +Copyright 2015 The Prometheus Authors +Copyright (c) 2005-2016, Michele Simionato + +Apache-2.0 AND BSD-2-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +fonttools 4.55.3 - Apache-2.0 AND BSD-3-Clause AND MIT AND OFL-1.1 + + +Copyright 2017 +Copyright 2018 +Copyright c 2015 +COPYRIGHT STRING. +(c) 2024 Unicode(r), Inc. +Copyright 2011 Google Inc. +Copyright 2013 Google Inc. +Copyright 2015 Google Inc. +Copyright 2016 Google Inc. +Copyright 2019 Google Inc. +Copyright 2023 Google Inc. +(c) 2010 by Pablo Impallari +Copyright 2013 Google, Inc. +Copyright (c) 2000 BeOpen.com +Copyright 2017 by Jens Kutilek +Copyright 2021 Behdad Esfahbod +Copyright 2023 Behdad Esfahbod +Copyright (c) 2015 by FontTools +Copyright 2015-2021 Google LLC. +Copyright (c ) 2015 by FontTools +Copyright 2008 The Bungee Project +Copyright 2021 The Qahiri Project +Copyright (c) 2009 Type Supply LLC +Copyright (c) 2017 Just van Rossum +(c) 2002 Adobe Systems Incorporated +Copyright (c) 2010 by Pablo Impallari +Copyright (c) 2015-2019 Belleve Invis +Copyright 2010-2020 The Amiri Project +Copyright (c) 2013-2014 Lennart Regebro +Copyright (c) 2015-2019 The Mada Project +Copyright 2015 Adobe System Incorporated +Copyright (c) 2004-2022 SIL International +Copyright 2014 Adobe Systems Incorporated +Copyright (c) 2018 Adobe systems Co., Ltd. +(c) 2014-2021 Adobe (http://www.adobe.com/) +(c) 2014 - 2023 Adobe (http://www.adobe.com/) +Copyright (c) 2002 Adobe Systems Incorporated +Portions copyright (c) 1990 by Elsevier, Inc. +(c) 2010 by Pablo Impallari. www.impallari.com +Copyright (c) 2012-2019 The Libertinus Project +copyright (c) 2005-2016, The RoboFab Developers +Copyright (c) 2001-2010 by the STI Pub Companies +Copyright (c) 2001-2011 by the STI Pub Companies +Copyright 2010 - 2012 Adobe Systems Incorporated +Portions copyright (c) 2009-2012 by Khaled Hosny +copyright 2020, Just van Rossum, Behdad Esfahbod +Copyright 2002-2019 Adobe (http://www.adobe.com/) +Copyright 2014-2021 Adobe (http://www.adobe.com/) +Copyright 2015-2021 The Aref Ruqaa Project Authors +Copyright 1998, Just van Rossum <just@letterror.com> +Portions copyright (c) 1998-2003 by MicroPress, Inc. +(c) Copyright 1994-1997 Summer Institute of Linguistics +Copyright (c) 2010 by Pablo Impallari. www.impallari.com +Copyright (c) 2015-2020 Belleve Invis (belleve@typeof.net) +Copyright c 1997, 2009, 2011 American Mathematical Society +(c) 2010, Pablo Impallari (www.impallari.com impallari@gmail.com) +Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam +(c) 2010 - 2012 Adobe Systems Incorporated (http://www.adobe.com/) +Copyright (c) 1995-2001 Corporation for National Research Initiatives +Copyright (c) 1999-2004 Just van Rossum, LettError (just@letterror.com) +Copyright 2014, 2015 Adobe Systems Incorporated (http://www.adobe.com/) +Copyright (c) 2010, Pablo Impallari (www.impallari.com impallari@gmail.com) +Copyright (c) 2014, 2015 Adobe Systems Incorporated (http://www.adobe.com/) +Copyright 2014, 2015, 2016 Adobe Systems Incorporated (http://www.adobe.com/) +Copyright (c) 1997, 2009, 2011 American Mathematical Society http://www.ams.org +Copyright 2015-2021 The Aref Ruqaa Project Authors (https://github.com/aliftype/aref-ruqaa) +Copyright 2017 The Roboto Flex Project Authors (https://github.com/TypeNetwork/Roboto-Flex) +Copyright 2017 The Roboto Flex Project Authors (https://github.com/TypeNetwork/Roboto-Flex)Roboto + +Apache-2.0 AND BSD-3-Clause AND MIT AND OFL-1.1 + +--------------------------------------------------------- + +--------------------------------------------------------- + +grpcio 1.69.0 - Apache-2.0 AND BSD-3-Clause AND MPL-2.0 + + +Copyright 2015 gRPC +Copyright 2016 gRPC +Copyright 2017 gRPC +Copyright 2018 gRPC +Copyright 2019 gRPC +Copyright 2020 gRPC +Copyright 2021 gRPC +Copyright 2022 gRPC +Copyright 2023 gRPC +Copyright 2024 gRPC +Copyright 2005 Nokia +(c) 2006 Entrust, Inc. +Copyright 2019 The gRPC +Copyright 2020 The gRPC +Copyright 2021 The gRPC +Copyright 2021 the gRPC +Copyright 2023 The gRPC +Copyright 2024 The gRPC +IsAlpha (c) IsDigit (c) +IsLower (c) IsUpper (c) +Copyright 2015-2016 gRPC +Copyright 2022 Google LLC +Copyright 2005 Google Inc. +Copyright 2008 Google Inc. +Copyright 2009 Google Inc. +Copyright 2010 Google Inc. +Copyright 2015 Google Inc. +Copyright 2016 Brian Smith +Copyright 2016 Google Inc. +Copyright 2017 Google Inc. +Copyright 2018 Google LLC. +Copyright 2019 Google LLC. +Copyright 2020 Google Inc. +Copyright 2021 Google Inc. +Copyright 2023 Google LLC. +Copyright 2024 Google LLC. +Copyright 2005, Google Inc. +Copyright 2006, Google Inc. +Copyright 2007, Google Inc. +Copyright 2008, Google Inc. +Copyright 2009, Google Inc. +Copyright 2010, Google Inc. +Copyright 2013, Google Inc. +Copyright 2015, Google Inc. +Copyright 2016, Google Inc. +Copyright 2018, Google Inc. +Copyright 2018, Google LLC. +Copyright 2019, Google Inc. +Copyright 2019, Google LLC. +Copyright 2021 gRPC Authors +Copyright 2022 gRPC Authors +Copyright 2023 gRPC Authors +(c) 1999 Entrust.net Limited +(c) 2009 Entrust, Inc. - for +(c) 2012 Entrust, Inc. - for +(c) 2015 Entrust, Inc. - for +Copyright (c) 2020, Arm Ltd. +Copyright (c) 2003 Mark Adler +Copyright (c) 2018 Mark Adler +Copyright (c) 2021 Permission +Copyright (c) 2011, RTFM, Inc. +Copyright (c) 2015, Intel Inc. +Copyright (c) 2023, Google LLC +Copyright (c) 2024, Google LLC +Copyright 1995-2023 Mark Adler +Copyright 2004 The RE2 Authors +Copyright 2005 Dominick Meglio +Copyright 2005 The RE2 Authors +Copyright 2006 The RE2 Authors +Copyright 2007 The RE2 Authors +Copyright 2008 The RE2 Authors +Copyright 2009 The RE2 Authors +Copyright 2010 The RE2 Authors +Copyright 2016 The RE2 Authors +Copyright 2018 The RE2 Authors +Copyright (c) 2014, Google Inc. +Copyright (c) 2015, Google Inc. +Copyright (c) 2016, Google Inc. +Copyright (c) 2017, Google Inc. +Copyright (c) 2018, Google Inc. +Copyright (c) 2019, Google Inc. +Copyright (c) 2020, Google Inc. +Copyright (c) 2021, Google Inc. +Copyright (c) 2022, Google Inc. +Copyright (c) 2023, Google Inc. +Copyright (c) 2024, Google Inc. +Copyright 2003-2009 Google Inc. +Copyright 2003-2010 Google Inc. +Copyright 2018 The gRPC Authors +Copyright 2019 The gRPC Authors +Copyright 2020 The gRPC Authors +Copyright 2021 The gRPC Authors +Copyright 2022 The gRPC Authors +Copyright 2023 The gRPC Authors +Copyright 2024 The gRPC Authors +Copyright (c) 2021 by Brad House +Copyright (c) 1990-2000 Info-ZIP. +Copyright 2005 by Dominick Meglio +Copyright 2017 The Abseil Authors +Copyright 2018 The Abseil Authors +Copyright 2019 The Abseil Authors +Copyright 2020 The Abseil Authors +Copyright 2021 The Abseil Authors +Copyright 2022 The Abseil Authors +Copyright 2023 The Abseil Authors +Copyright 2024 The Abseil Authors +Copyright (c) 1995-2003 Mark Adler +Copyright (c) 1995-2008 Mark Adler +Copyright (c) 1995-2017 Mark Adler +Copyright (c) 1995-2019 Mark Adler +Copyright (c) 1995-2022 Mark Adler +Copyright (c) 1995-2023 Mark Adler +Copyright (c) 2002-2013 Mark Adler +Copyright (c) 2003-2010 Mark Adler +Copyright (c) 2004-2017 Mark Adler +Copyright (c) 2004-2019 Mark Adler +Copyright (c) 2003, 2012 Mark Adler +Copyright (c) 2004, 2010 Mark Adler +Copyright (c) 2011, 2016 Mark Adler +Copyright (c) 2012-2020 Yann Collet +Copyright 1999-2005 The RE2 Authors +Copyright 2001-2010 The RE2 Authors +Copyright 2002-2009 The RE2 Authors +Copyright 2003-2009 The RE2 Authors +Copyright 2006-2007 The RE2 Authors +Copyright 2006-2008 The RE2 Authors +Copyright 2010 The Chromium Authors +Copyright 2011 The Chromium Authors +Copyright 2014 The Chromium Authors +Copyright 2015 The Chromium Authors +Copyright 2016 The Chromium Authors +Copyright 2017 The Chromium Authors +Copyright 2018 The Chromium Authors +Copyright 2019 The Chromium Authors +Copyright 2021 The Chromium Authors +Copyright 2022 The Chromium Authors +Copyright 2023 The Chromium Authors +Copyright (c) 2007-2008 Even Rouault +Copyright (c) 2017, the HRSS authors +Copyright (c) 2004 by Daniel Stenberg +Copyright (c) 2005 by Dominick Meglio +Copyright (c) 2008 by Daniel Stenberg +Copyright (c) 2012, Intel Corporation +Copyright (c) 2014, Intel Corporation +Copyright 2002 Sun Microsystems, Inc. +Copyright (c) 1998-2005 Gilles Vollant +Copyright (c) 1999 The OpenSSL Project +Copyright (c) 2000 The OpenSSL Project +Copyright (c) 2001 The OpenSSL Project +Copyright (c) 2003 The OpenSSL Project +Copyright (c) 2004 The OpenSSL Project +Copyright (c) 2005 The OpenSSL Project +Copyright (c) 2006 The OpenSSL Project +Copyright (c) 2008 The OpenSSL Project +Copyright (c) 2010 The OpenSSL Project +Copyright (c) 2011 The OpenSSL Project +Copyright (c) 2012 The OpenSSL Project +Copyright (c) 2013 The OpenSSL Project +Copyright (c) 2014 The OpenSSL Project +Copyright (c) 2015 The OpenSSL Project +Copyright (c) 2019 by Andrew Selivanov +Copyright (c) 2012 The Chromium Authors +Copyright (c) 1995-2003, 2010 Mark Adler +Copyright (c) 1995-2005, 2010 Mark Adler +Copyright (c) 1995-2011, 2016 Mark Adler +Copyright (c) 1995-2017 Jean-loup Gailly +Copyright (c) 1995-2018 Jean-loup Gailly +Copyright (c) 1995-2021 Jean-loup Gailly +holder is Tim Hudson (tjh@cryptsoft.com) +Copyright (c) 2002 by Lucent Technologies +Copyright (c) 2003, 2012, 2013 Mark Adler +Copyright (c) 2004, 2005, 2012 Mark Adler +Copyright (c) 2004, 2008, 2012 Mark Adler +Copyright (c) 2004-2009 by Daniel Stenberg +Copyright (c) 2004-2010 by Daniel Stenberg +Copyright (c) 2004-2011 by Daniel Stenberg +Copyright (c) 2004-2017 by Daniel Stenberg +Copyright (c) 2005 - 2010, Daniel Stenberg +Copyright (c) 2005-2013 by Daniel Stenberg +Copyright (c) 2007-2013 by Daniel Stenberg +Copyright (c) 2008-2013 by Daniel Stenberg +Copyright (c) 2009-2013 by Daniel Stenberg +Copyright (c) 2010-2012 by Daniel Stenberg +Copyright (c) 2010-2013 by Daniel Stenberg +Copyright 2017 The OpenSSL Project Authors +Copyright (c) 1998-2000 The OpenSSL Project +Copyright (c) 1998-2001 The OpenSSL Project +Copyright (c) 1998-2002 The OpenSSL Project +Copyright (c) 1998-2003 The OpenSSL Project +Copyright (c) 1998-2004 The OpenSSL Project +Copyright (c) 1998-2005 The OpenSSL Project +Copyright (c) 1998-2006 The OpenSSL Project +Copyright (c) 1998-2007 The OpenSSL Project +Copyright (c) 1998-2011 The OpenSSL Project +Copyright (c) 1999-2002 The OpenSSL Project +Copyright (c) 1999-2003 The OpenSSL Project +Copyright (c) 1999-2004 The OpenSSL Project +Copyright (c) 1999-2005 The OpenSSL Project +Copyright (c) 1999-2007 The OpenSSL Project +Copyright (c) 1999-2008 The OpenSSL Project +Copyright (c) 2000-2002 The OpenSSL Project +Copyright (c) 2000-2003 The OpenSSL Project +Copyright (c) 2000-2005 The OpenSSL Project +Copyright (c) 2001-2011 The OpenSSL Project +Copyright (c) 2002-2006 The OpenSSL Project +Copyright (c) 2005, 2013 by Dominick Meglio +Copyright (c) 2006, Network Resonance, Inc. +Copyright (c) 2006,2007 The OpenSSL Project +Copyright (c) 2004 - 2011 by Daniel Stenberg +Copyright (c) 2004 - 2012 by Daniel Stenberg +Copyright (c) 2004 - 2013 by Daniel Stenberg +Copyright (c) 2009 - 2013 by Daniel Stenberg +Copyright (c) 2009 - 2021 by Daniel Stenberg +Copyright (c) 2017 - 2018 by Christian Ammer +Copyright Amazon.com, Inc. or its affiliates +Copyright (c) 2005, 2012, 2018, 2023 Mark Adler +Copyright (c) 2007, 2008, 2012, 2018 Mark Adler +Copyright 1995-2016 The OpenSSL Project Authors +Copyright 1995-2017 The OpenSSL Project Authors +Copyright 2000-2016 The OpenSSL Project Authors +Copyright 2006-2017 The OpenSSL Project Authors +Copyright 2006-2019 The OpenSSL Project Authors +Copyright 2006-2021 The OpenSSL Project Authors +Copyright 2007-2016 The OpenSSL Project Authors +Copyright 2012-2016 The OpenSSL Project Authors +Copyright 2013-2016 The OpenSSL Project Authors +Copyright 2014-2016 The OpenSSL Project Authors +Copyright 2014-2020 The OpenSSL Project Authors +Copyright 2015-2016 The OpenSSL Project Authors +Copyright (c) 2010 Jeremy Lal <kapouer@melix.org> +Copyright (c) 2012 Marko Kreen <markokr@gmail.com> +Copyright (c) 2018 The Android Open Source Project +Copyright 2020 by <danny.sonnenschein@platynum.ch> +Copyright 1995-2023 Jean-loup Gailly and Mark Adler +Copyright (c) 1995-2006, 2011, 2016 Jean-loup Gailly +Copyright (c) 1995-2016 Jean-loup Gailly, Mark Adler +Copyright (c) 1995-2022 Jean-loup Gailly, Mark Adler +Copyright (c) 1995, 1996, 1997, and 1998 WIDE Project +Copyright (c) 2003, 2005, 2008, 2010, 2012 Mark Adler +Copyright (c) 2004, 2008, 2012, 2016, 2019 Mark Adler +Copyright (c) 1995-1997 Eric Young (eay@cryptsoft.com) +Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) +(c) 2006 Entrust, Inc. Label Entrust Root Certification +Copyright (c) 1995-2023 Jean-loup Gailly and Mark Adler +Copyright (c) 1996,1999 by Internet Software Consortium +Copyright (c) 1996-1999 by Internet Software Consortium +Copyright (c) 2004 by Internet Systems Consortium, Inc. +Copyright (c) 2009 by Jakub Hrozek <jhrozek@redhat.com> +Copyright (c) 2022, Robert Nagy <robert.nagy@gmail.com> +(c) MaxCasefoldGroup raise unicode.Error 'casefold group +Copyright (c) 2012 by Gilles Chehade <gilles@openbsd.org> +Copyright (c) 1995-2006, 2010, 2011, 2016 Jean-loup Gailly +Copyright (c) 2017 by John Schember <john@nachtimwald.com> +Copyright (c) 2018 by John Schember <john@nachtimwald.com> +Copyright 1998 by the Massachusetts Institute of Technology +Copyright 2000 by the Massachusetts Institute of Technology +Copyright (c) 2009-2010 Mathias Svensson http://result42.com +Copyright (c) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler +Copyright 1998, 2011 by the Massachusetts Institute of Technology +Copyright (c) 1987-2001 The Regents of the University of California +Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll +Copyright (c) 1997 Christian Michelsen Research AS Advanced Computing +Copyright (c) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler +Copyright 1998, 2011, 2013 by the Massachusetts Institute of Technology +Copyright (c) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson +Copyright (c) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant +(c) 1999 Entrust.net Limited Label Entrust.net Premium 2048 Secure Server CA Serial +Copyright (c) 1998-2010 Gilles Vollant (minizip) http://www.winimage.com/zLibDll/minizip.html + +Apache-2.0 AND BSD-3-Clause AND MPL-2.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +json5 0.10.0 - Apache-2.0 AND MIT + + +Copyright 2014 Dirk Pranke +Copyright 2014 Google Inc. +Copyright 2015 Google Inc. +Copyright 2017 Google Inc. +Copyright 2019 Google Inc. +Copyright (c) 2014 Milo Yip +Copyright (c) 2017 Wes McKinney +Copyright (c) Microsoft Corporation + +Apache-2.0 AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +types-python-dateutil 2.9.0.20241206 - Apache-2.0 AND MIT + + +Copyright (c) 2015 Jukka Lehtosalo and contributors + +Apache-2.0 AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +contextlib2 21.6.0 - Apache-2.0 AND Python-2.0 + + +copyright u'2021, Nick Coghlan +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Python Software Foundation + +Apache-2.0 AND Python-2.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +watchdog 6.0.0 - Apache-2.0 AND Python-2.0 + + +Copyright 2012-2014 Google, Inc. +Copyright 2012-2018 Google, Inc. +Copyright 2011-2012 Yesudeep Mangalapilly +Copyright 2014-2018 Thomas Amland & contributors +Copyright 2010-2011 Malthe Borch <mborch@gmail.com> +copyright COPYRIGHT The version info for the project +Copyright 2018-2024 Mickael Schoentgen & contributors +Copyright 2011-2012 Yesudeep Mangalapilly <yesudeep@gmail.com> +Copyright 2011-2024 Yesudeep Mangalapilly, Mickael Schoentgen & contributors + +Apache-2.0 AND Python-2.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +sniffio 1.3.1 - Apache-2.0 OR (Apache-2.0 AND MIT) + + + +Apache-2.0 OR (Apache-2.0 AND MIT) + +--------------------------------------------------------- + +--------------------------------------------------------- + +cryptography 44.0.0 - Apache-2.0 OR BSD-3-Clause OR (Apache-2.0 AND BSD-3-Clause) + + +Copyright 2013-2024 +Copyright 2015 The Go Authors +Copyright (c) Individual contributors +Copyright (c) 2005-2020, NumPy Developers +copyright 2013-2024, Individual Contributors + +Apache-2.0 OR BSD-3-Clause OR (Apache-2.0 AND BSD-3-Clause) + +--------------------------------------------------------- + +--------------------------------------------------------- + +isodate 0.7.2 - BSD-2-Clause + + +Copyright (c) 2009, Gerhard Weis +Copyright (c) 2009-2018, Gerhard Weis and contributors +Copyright (c) 2021, Hugo van Kemenade and contributors + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +nest-asyncio 1.6.0 - BSD-2-Clause + + +Copyright (c) 2018-2020, Ewald de Wit + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pygments 2.19.1 - BSD-2-Clause + + + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +sympy 1.13.3 - BSD-2-Clause + + +(c) A. B +(c) A . B +(c) Fix Qasm +Dagger (c), True +Copyright 2016, latex2sympy +copyright SymPy Development +Copyright (c) 2009-2023, PyDy +Copyright (c) 2014 Matthew Rocklin +copyright 2015, SymPy Development Team +Copyright (c) 2006-2014 SymPy developers +Copyright (c) 2001, 2002 Vasil Yaroshevich +Copyright (c) 2006-2023 SymPy Development Team +Copyright (c) 2008 Jens Rasch <jyr2000@gmail.com> +Copyright (c) 2006-2018 SymPy Development Team, 2013-2023 Sergey B Kirpichev +(c) Copyright 2000-2003 Symbolic Computation Laboratory, University of Western Ontario, London, Canada N6A + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +terminado 0.18.1 - BSD-2-Clause + + +copyright 2014, Thomas Kluyver +Copyright (c) Jupyter Development Team +Copyright (c) 2012-2013, Christopher Jeffrey +Copyright (c) 2014-, Jupyter development team +Copyright (c) 2014, Ramalingam Saravanan <sarava@sarava.net> + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +webencodings 0.5.1 - BSD-2-Clause + + +Copyright 2012 by Simon Sapin + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +wrapt 1.17.0 - BSD-2-Clause + + +Copyright (c) 2013-2023, Graham Dumpleton + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +babel 2.16.0 - BSD-2-Clause AND BSD-3-Clause + + +copr Coptegr Crir +copyright in Babel +copr Kopteschr Tsch +copr Koptschr Creer +copr Koptyskr Creer +copr Koptischr Creer +Foobar. Copyright (c) +Copyright 2013 by Lennart +Copyright (c) 2006 Ufsoft.org +Copyright of Edgewall Software +copyright 2024, The Babel Team +Copyright (c) 2007 FooBar, Inc. +Copyright (c) 2007 ORGANIZATION +Copyright (c) 2007 THE PACKAGE'S +Copyright (c) (year)d Foo Company +Copyright (c) 1990-2003 Foo Company +Copyright (c) 1990-2003 ORGANIZATION +Copyright (c) 2010 by Armin Ronacher +Copyright (c) 2004-2024 Unicode, Inc. +Copyright (c) 2013-2024 by the Babel Team +copyright (c) 2013-2024 by the Babel Team +copyright (c) 2015-2024 by the Babel Team +Copyright (c) time.strftime Y FooBar, Inc. +Copyright (c) 2007 - 2011 by Edgewall Software +Copyright 2010 by Armin Ronacher. :license Flask Design +Copyright (c) 2007-2011 Edgewall Software, 2013-2024 the Babel team +POT for my really cool PROJECT project. Copyright (c) 1990-2003 ORGANIZATION + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +click 8.1.8 - BSD-2-Clause AND BSD-3-Clause + + +Copyright 2014 Pallets +copyright 2014 Pallets +Copyright 2001-2006 Gregory P. Ward +Copyright 2002-2006 Python Software Foundation + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +comm 0.2.2 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2022, Jupyter +Copyright (c) IPython Development Team + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +cycler 0.12.1 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2015, matplotlib project + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +decorator 5.1.1 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2005-2018, Michele Simionato +Copyright (c) 2005-2020, Michele Simionato +Copyright (c) 2005-2021, Michele Simionato + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +dill 0.3.9 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2011 by science+computing +copyright d, The Uncertainty Quantification Foundation +Copyright (c) 2008-2010 Marius Gedminas <marius@pov.lt> +Copyright (c) 2009 PiCloud, Inc. <http://www.picloud.com> +Copyright (c) 2010 Stefano Rivera <stefano@rivera.za.net> +Copyright (c) 2004-2016 California Institute of Technology +Copyright (c) 2008-2015 California Institute of Technology +Copyright (c) 2008-2016 California Institute of Technology +Copyright (c) 2012, Regents of the University of California +Copyright (c) 2024 The Uncertainty Quantification Foundation +Copyright (c) 2016-2024 The Uncertainty Quantification Foundation +Copyright (c) 2018-2024 The Uncertainty Quantification Foundation +Copyright (c) 2019-2024 The Uncertainty Quantification Foundation +Copyright (c) 2021-2024 The Uncertainty Quantification Foundation +Copyright (c) 2022-2024 The Uncertainty Quantification Foundation +Copyright (c) 2023-2024 The Uncertainty Quantification Foundation + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +fastjsonschema 2.21.1 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2018, Michal Horejsek + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +h5py 3.12.1 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2009 Darren Dale +Copyright (c) 2015, Daniel Greenfeld +Copyright 2006-2007 by The HDF Group +Copyright (c) 2009-2022, Marcel Hellkamp +Copyright (c) 2006-2008 Alexander Chemeris +Copyright (c) 2002, 2003, 2004 Francesc Altet +Copyright 2001-2013 Python Software Foundation +Copyright (c) 2005, 2006, 2007 Carabos Coop. V. +copyright 2014, Andrew Collette and contributors +Copyright (c) 2008 Andrew Collette http://h5py.org +Copyright (c) 2009 Andrew Collette http://h5py.org +Copyright (c) 2008 Andrew Collette and contributors +Copyright 2008-2013 Andrew Collette and contributors +Copyright 2008-2019 Andrew Collette and contributors +Copyright 2008-2020 Andrew Collette and contributors +Copyright (c) 2008-2009 Andrew Collette http://h5py.org +Copyright (c) 2000-2007 Marc Alexander Lehmann <schmorp@schmorp.de> +Copyright (c) 2000-2008 Marc Alexander Lehmann <schmorp@schmorp.de> +Copyright 1998-2006 by the Board of Trustees of the University of Illinois +Copyright (c) 2008-2013 Andrew Collette and contributors http://www.h5py.org + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +idna 3.10 - BSD-2-Clause AND BSD-3-Clause + + +(c) 2019 Unicode(r), Inc. +Copyright (c) 2013-2024, Kim Davies and contributors + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +ipykernel 6.29.5 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) IPython Development Team +copyright 2015, IPython Development Team +Copyright (c) 2015, IPython Development Team +Copyright (c) 2012 The IPython Development Team +Copyright (c) 2008-2011 The IPython Development Team +Copyright (c) 2010-2011 The IPython Development Team + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +ipywidgets 8.1.5 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) Vidar Tonaas Fauske +Copyright (c) IPython Development Team +Copyright (c) Jupyter Development Team +Copyright (c) 2015 Project Jupyter Contributors + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +jinja2 3.1.5 - BSD-2-Clause AND BSD-3-Clause + + +Copyright 2007 Pallets +copyright 2007 Pallets +(c) Copyright 2008 by http://domain.invalid/> + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +joblib 1.4.2 - BSD-2-Clause AND BSD-3-Clause + + +Copyright 2009 Brian Quinlan +Copyright 2017, Thomas Moreau +Copyright 2010, Gael Varoquaux +Copyright 2012, Olivier Grisel +(c) 2008-2021, Joblib developers +Copyright (c) 2008 Gael Varoquaux +Copyright (c) 2009 Gael Varoquaux +Copyright (c) 2010 Gael Varoquaux +Copyright (c) 2008-2021, The joblib +Copyright (c) 2010-2011 Gael Varoquaux +Copyright 2007-2022 by the Sphinx team +copyright 2008-2021, Joblib developers +(c) JS Foundation and other contributors +Copyright JS Foundation and other contributors +copyright https://docs.python.org/3/copyright.html +Copyright (c) 2012, Regents of the University of California +Copyright (c) 2012-now, CloudPickle developers and contributors +Copyright (c) 2009 PiCloud, Inc. <https://web.archive.org/web/20140626004012/http://www.picloud.com/> +(c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors Underscore + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +jsonlines 4.0.0 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2016, wouter bolsterlee + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +jsonpointer 3.0.0 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2011 Stefan Kogl <stefan@skoegl.net> + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyter-lsp 2.2.5 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) Microsoft +Copyright (c) 2016 Chad Smith +Copyright 2018 Palantir Technologies, Inc. +Copyright (c) 2022, jupyter-lsp contributors +Copyright (c) 2012-2019 David Anthoff, Zac Nugent and other contributors (https://github.com/JuliaLang/Julia.tmbundle/contributors, https://github.com/julia-vscode/julia-vscode/contributors) + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +kiwisolver 1.4.8 - BSD-2-Clause AND BSD-3-Clause + + +copyright 2018-2024, Nucleic team +Copyright (c) 2001. Addison-Wesley +Copyright (c) 2019-2021 Martin Ankerl +Copyright (c) 2001 by Andrei Alexandrescu +Copyright (c) 2013-2024, Nucleic Development Team +Copyright (c) 2019-2024, Nucleic Development Team +Copyright (c) 2020-2024, Nucleic Development Team +Copyright (c) 2021-2024, Nucleic Development Team +Copyright (c) 2023-2024, Nucleic Development Team +Copyright (c) 2014-2024,, Nucleic Development Team +Copyright 2000, 2004, 2005Adobe Systems Incorporated +Copyright (c) 2019-2021 Martin Ankerl <martin.ankerl@gmail.com> + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +markdown 3.7 - BSD-2-Clause AND BSD-3-Clause + + +(c) 2004 Foo Corporation +Copyright 2004 Manfred Stienstra +Copyright The Python Markdown Project +Copyright (c) 1999-2007 by Fredrik Lundh +Copyright 2004, 2005, 2006 Yuri Takhteyev +Copyright 2007-2019 The Python Markdown Project +Copyright 2007-2021 The Python Markdown Project +Copyright 2007-2022 The Python Markdown Project +Copyright 2007-2023 The Python Markdown Project +Copyright 2007-2024 The Python Markdown Project +Copyright 2008-2014 The Python Markdown Project +Copyright 2008-2024 The Python Markdown Project +Copyright 2011-2014 The Python Markdown Project +Copyright 2013-2014 The Python Markdown Project +Copyright 2015-2018 The Python Markdown Project +Copyright 2007, 2008 The Python Markdown Project +Copyright 2008 Jack Miller (https://codezen.org/) +Copyright Waylan Limberg (http://achinghead.com/) +The Python-Markdown Project Copyright (c) 2010-2023 +Copyright 2008 Waylan Limberg (http://achinghead.com) +Copyright 2009 Waylan Limberg (http://achinghead.com) +Copyright 2011 Waylan Limberg (http://achinghead.com) +Copyright 2011 Waylan Limberg (http://achinghead.com/) +Copyright Tiago Serafim (https://www.tiagoserafim.com/) +Copyright 2011 Brian Neal (https://deathofagremmie.com/) +Copyright 2007-2008 Waylan Limberg (http://achinghead.com) +Copyright (c) 2004, 2007 Chad Miller <http://web.chad.org/> +Copyright 2006-2008 Waylan Limberg (http://achinghead.com/) +Copyright 2007-2008 Waylan Limberg (http://achinghead.com/) +Copyright (c) 2003 John Gruber <https://daringfireball.net/> +Copyright 2007-2008 Waylan Limberg (http://achinghead.com/) and Seemant Kulleen (http://www.kulleen.org/) + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +markupsafe 3.0.2 - BSD-2-Clause AND BSD-3-Clause + + +Copyright 2010 Pallets +copyright 2010 Pallets + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +matplotlib-inline 0.1.7 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) IPython Development Team +Copyright (c) 2019-2022, IPython Development Team + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +mpmath 1.3.0 - BSD-2-Clause AND BSD-3-Clause + + +Copyright 2013 Timo Hartmann (thartmann15 at gmail.com) +Copyright (c) 2005-2021 Fredrik Johansson and mpmath contributors + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +multiprocess 0.70.17 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2006-2008, R Oudkerk +Copyright (c) 2008-2016 California Institute of Technology +Copyright (c) 2024 The Uncertainty Quantification Foundation +Copyright (c) 2016-2024 The Uncertainty Quantification Foundation +Copyright (c) 2018-2024 The Uncertainty Quantification Foundation +Copyright (c) 2022-2024 The Uncertainty Quantification Foundation + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +nbformat 5.10.4 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) IPython Development Team +Copyright (c) Jupyter Development Team +copyright 2015, Jupyter Development Team +Copyright (c) 2015-, Jupyter Development Team +Copyright (c) 2013 The IPython Development Team +Copyright (c) 2001-2015, IPython Development Team +Copyright (c) 2008-2011 The IPython Development Team + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +networkx 3.4.2 - BSD-2-Clause AND BSD-3-Clause + + +(c) Fcc Bcc +Copyright (c) 2015 - Thomson Licensing, SAS +Copyright 2011 Alex Levenson <alex@isnotinvain.com> +Copyright 2011 Reya Group <http://www.reyagroup.com> +Copyright 2011 Diederik van Liere <diederik.vanliere@rotman.utoronto.ca> +Copyright (c) 2004-2024 NetworkX Developers Aric Hagberg <hagberg@lanl.gov> Dan Schult <dschult@colgate.edu> +Copyright (c) 2004-2024, NetworkX Developers Aric Hagberg <hagberg@lanl.gov> Dan Schult <dschult@colgate.edu> + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +numpy 1.26.4 - BSD-2-Clause AND BSD-3-Clause + + +(c) Jussi Pakkanen +Copyright (c) 2017 +(c) Convert Chebyshev +(c) Multiply a Hermite +(c) Multiply a Laguerre +(c) Multiply a Legendre +(c) Multiply a Chebyshev +Copyright (c) 2010 - 2019 +Copyright (c) 2018, Meson +Copyright (c) 2022, Intel +Copyright 2019 Red Hat, Inc. +Copyright Absoft Corporation +(c), True, True, False, False +Copyright 2002 Pearu Peterson +Copyright 2014 Jussi Pakkanen +(c), False, False, False, True +(c), False, False, True, False +Copyright (c) 2012 Google Inc. +Copyright (c) 2017 Dylan Baker +Copyright 2017 Niklas Claesson +Copyright (c) 2014 Ryan Juckett +Copyright (c) 2013 THE PACKAGE'S +Copyright 2011 by Enthought, Inc +Copyright 2020 Intel Corporation +Copyright 2022 Intel Corporation +Copyright (c) 2011 Enthought, Inc +Copyright (c) 2015 Pauli Virtanen +Copyright (c) 2019 Kevin Sheppard +Copyright 1999 2011 Pearu Peterson +Copyright 2001-2005 Pearu Peterson +Copyright (c) 2019 NumPy Developers +Copyright (c) 2007 Cybozu Labs, Inc. +Copyright (c) 2017 Intel Corporation +Copyright (c) 2018 Intel Corporation +Copyright (c) 2020 Intel Corporation +Copyright (c) 2021 Intel Corporation +Copyright (c) 2022 Intel Corporation +Copyright (c) 2023 Intel Corporation +Copyright (c) 2023, NumPy Developers +Copyright (c) 2011 by Enthought, Inc. +Copyright (c) 2014 Mathjax Consortium +Copyright (c) 2015 Melissa E. O'Neill +Copyright (c) 2015-2017 Martin Hensel +Copyright (c) 2017 Arseny Maslennikov +Copyright (c) 2018 Melissa E. O'Neill +Copyright 1996-2023 Intel Corporation +copyright 2008-2022, NumPy Developers +copyright 2017-2018, NumPy Developers +Copyright 2007-2018 by the Sphinx team +Copyright (c) 2021 The Meson Developers +Copyright 2011 present NumPy Developers +Copyright (c) 2021 Microsoft Corporation +Copyright 2010-2012, D. E. Shaw Research +Copyright (c) 2005-2015, NumPy Developers +Copyright (c) 2005-2017, NumPy Developers +Copyright (c) 2005-2021, NumPy Developers +Copyright (c) 2005-2023, NumPy Developers +Copyright (c) 2017-2018 Intel Corporation +Copyright (c) 2020-2021 Intel Corporation +Copyright (c) 2020-2023 Intel Corporation +Copyright (c) 2021-2022 Intel Corporation +Copyright (c) 2022-2023 Intel Corporation +Copyright 2013 The Meson development team +Copyright 2015 The Meson development team +Copyright 2016 The Meson development team +Copyright 2017 The Meson development team +Copyright 2018 The Meson development team +Copyright 2019 The Meson development team +Copyright 2019 The meson development team +Copyright 2020 The Meson development team +Copyright 2021 The Meson development team +Copyright 2022 The Meson development team +Copyright 2012-2020 Meson development team +Copyright (c) 1993 by Sun Microsystems, Inc. +Copyright (c) 2011-2014, The OpenBLAS Project +Copyright (c) 2009-2017 The MathJax Consortium +Copyright (c) 2010-2017 The MathJax Consortium +Copyright (c) 2011-2015 The MathJax Consortium +Copyright (c) 2011-2017 The MathJax Consortium +Copyright (c) 2013-2017 The MathJax Consortium +Copyright (c) 2014-2017 The MathJax Consortium +Copyright (c) 2015-2017 The MathJax Consortium +Copyright (c) 2016-2017 The MathJax Consortium +Copyright 2012-2016 The Meson development team +Copyright 2012-2017 The Meson development team +Copyright 2012-2019 The Meson development team +Copyright 2012-2020 The Meson development team +Copyright 2012-2021 The Meson development team +Copyright 2012-2022 The Meson development team +Copyright 2012-2023 The Meson development team +Copyright 2013-2014 The Meson development team +Copyright 2013-2016 The Meson development team +Copyright 2013-2017 The Meson development team +Copyright 2013-2018 The Meson development team +Copyright 2013-2019 The Meson development team +Copyright 2013-2020 The Meson development team +Copyright 2013-2021 The Meson development team +Copyright 2013-2023 The Meson development team +Copyright 2014-2016 The Meson development team +Copyright 2014-2017 The Meson development team +Copyright 2014-2019 The Meson development team +Copyright 2014-2021 The Meson development team +Copyright 2015-2016 The Meson development team +Copyright 2015-2022 The Meson development team +Copyright 2016-2017 The Meson development team +Copyright 2016-2018 The Meson development team +Copyright 2016-2021 The Meson development team +Copyright 2016-2022 The Meson development team +Copyright 2017-2021 The Meson development team +Copyright 2019-2022 The meson development team +Copyright 2021 The Meson development team from +Copyright 2022 Mark Bolhuis <mark@bolhuis.dev> +Copyright (c) 2008 Ian Bicking and Contributors +Copyright 2017, 2019 The Meson development team +Copyright (c) 2005-2018 NVIDIA Corporation Built +Copyright (c) 2010 The Android Open Source Project +Copyright (c) 2021 2022, Scientific Python project +Copyright 2015 Robert Kern <robert.kern@gmail.com> +Copyright (c) 2002-2017 Free Software Foundation, Inc. +Copyright (c) 2010-2019 Free Software Foundation, Inc. +Copyright 2014 Melissa O'Neill <oneill@pcg-random.org> +Copyright (c) Donald Stufft and individual contributors +Copyright (c) 2007, 2011 David Schultz <das@FreeBSD.ORG> +Copyright (c) 2006-2013 The University of Colorado Denver +Copyright Absoft Corporation 1994-2002 Absoft Pro FORTRAN +Copyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin@mit.edu +Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org) +Copyright (c) 2000-2013 The University of California Berkeley +Copyright (c) 2019 Takao Fujiwara <takao.fujiwara1@gmail.com> +Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com> +Copyright (c) 2016 - 2019 Kim Walisch, <kim.walisch@gmail.com> +Copyright (c) 2021 Intel Corporation project 'existing project +Copyright 2016-2021 Matthew Brett, Isuru Fernando, Matti Picus +Copyright (c) 2015-2021 Matthias Klumpp <matthias@tenstral.net> +Copyright (c) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura +Copyright (c) 2004-2018 Max-Planck-Society author Martin Reinecke +Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG> +Copyright 2021 The Meson development team SPDX-license-identifier +Copyright (c) 2004, 2006 The Linux Foundation and its contributors +Copyright 1999, 2000, 2001 Regents of the University of California +Copyright (c) 2007 Free Software Foundation, Inc. <http://fsf.org/> +Copyright (c) 2009 Free Software Foundation, Inc. <http://fsf.org/> +Copyright (c) 2006, University of Georgia and Pierre G.F. Gerard-Marchant +Copyright Absoft Corporation 1994-1998 mV2 Cray Research, Inc. 1994-1996 CF90 +Copyright 2011 present NumPy Developers. https://numpy.org/doc/stable/f2py/index.html +Copyright (c) 2010 by Mark Wiebe (mwwiebe@gmail.com) The University of British Columbia +Copyright (c) 2011 by Mark Wiebe (mwwiebe@gmail.com) The University of British Columbia +Copyright (c) 2010-2011 by Mark Wiebe (mwwiebe@gmail.com) The University of British Columbia +Copyright (c) 2009-2019 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors +Copyright (c) 1992-2013 The University of Tennessee and The University of Tennessee Research Foundation +Copyright (c) 2022 Intel Corporation SPDX-License-Identifier BSD-3-Clause Authors Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> +Copyright (c) 2022 Intel Corporation SPDX-License-Identifier BSD-3-Clause Authors Liu Zhuan <zhuan.liu@intel.com> Tang Xi <xi.tang@intel.com> +Copyright (c) 2021 Serge Sans Paille SPDX-License-Identifier BSD-3-Clause Authors Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> Serge Sans Paille <serge.guelton@telecom-bretagne.eu> +Copyright (c) 2021 Serge Sans Paille SPDX-License-Identifier BSD-3-Clause Authors Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> Serge Sans Paille <serge.guelton@telecom-bretagne.eu> Liu Zhuan <zhuan.liu@intel.com> + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +omegaconf 2.3.0 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2018, Omry Yadan + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +pandas 2.2.3 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2009', join +Copyright (c) 1994 David Burren +Copyright (c) 2014, Al Sweigart +Copyright (c) 2011 Valentin Ochs +Copyright (c) 2017 Anthony Sottile +Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2015-2019 Jared Hobbs +Copyright (c) 2017-2018 Arm Limited +Copyright (c) 1999-2019, Arm Limited +Copyright (c) 2002 Michael Ringgaard +Copyright (c) 2003-2011 David Schultz +Copyright (c) 2008 Stephen L. Moshier +Copyright (c) 2010-2019 Keith Goodman +Copyright (c) 2011 by Enthought, Inc. +Copyright 2017- dateutil contributors +Copyright (c) 2003-2009 Bruce D. Evans +Copyright (c) 2001-2008 Ville Laurikari +Copyright (c) 2003-2009 Steven G. Kargl +Copyright (c) 1993,2004 Sun Microsystems +Copyright (c) 2012, Lambda Foundry, Inc. +Copyright (c) 2014, Electronic Arts Inc. +Copyright (c) 2019 Bottleneck Developers +Copyright (c) 1994 Sun Microsystems, Inc. +Copyright (c) 2005-2011, NumPy Developers +Copyright (c) 2005-2023, NumPy Developers +Copyright (c) 2012, PyData Development Team +Copyright (c) 2015- - dateutil contributors +Copyright (c) 2016, PyData Development Team +Copyright (c) 2020, PyData Development Team +Copyright (c) 2023, PyData Development Team +Copyright (c) 2011-2012, Lambda Foundry, Inc. +Copyright 2017- Paul Ganssle <paul@ganssle.io> +Copyright (c) 2011-2012, PyData Development Team +Copyright (c) 2011-2023, Open source contributors +Copyright (c) 2008 The Android Open Source Project +Copyright (c) 2008-2011 AQR Capital Management, LLC +Copyright (c) 2015- - Paul Ganssle <paul@ganssle.io> +Copyright (c) 2007 Nick Galbreath nickg at modp dot com +Copyright (c) Donald Stufft and individual contributors +Copyright (c) 2014-2016 - Yaron de Leeuw <me@jarondl.net> +Copyright (c) 2019 Hadley Wickham RStudio and Evan Miller +Copyright (c) 2008- Attractive Chaos <attractor@live.co.uk> +Copyright 2005, 2006, 2007 Nick Galbreath nickg at modp dot com +Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net> +Copyright (c) 1988-1993 The Regents of the University of California +Copyright (c) 2011-2013, ESN Social Software AB and Jonas Tarnstrom +Copyright (c) 2012-2014 - Tomi Pievilainen <tomi.pievilainen@iki.fi> +Copyright (c) 1995-2001 Corporation for National Research Initiatives +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherlands +Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team +copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +pandocfilters 1.5.1 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2013 John MacFarlane +Copyright (c) 2013, John MacFarlane + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +portalocker 2.10.1 - BSD-2-Clause AND BSD-3-Clause + + +Copyright 2022 Rick van Hattem +Copyright (c) 2010 Kenneth Reitz +Copyright 2010 by Armin Ronacher +Copyright (c) 2012 Rick van Hattem +Copyright (c) 2010 by Armin Ronacher +Copyright 2010 by Armin Ronacher. :license Flask Design + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +pox 0.3.5 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2010 Gael Varoquaux +copyright d, The Uncertainty Quantification Foundation +Copyright (c) 1997-2016 California Institute of Technology +Copyright (c) 2004-2016 California Institute of Technology +Copyright (c) 2013-2016 California Institute of Technology +Copyright (c) 2024 The Uncertainty Quantification Foundation +Copyright (c) 2016-2024 The Uncertainty Quantification Foundation +Copyright (c) 2018-2024 The Uncertainty Quantification Foundation +Copyright (c) 2022-2024 The Uncertainty Quantification Foundation + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +ppft 1.7.6.9 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2005-2012 Vitalii Vanovschi +Copyright (c) 2005-2012, Vitalii Vanovschi +copyright d, The Uncertainty Quantification Foundation +Copyright (c) 2012-2016 California Institute of Technology +Copyright (c) 2015-2016 California Institute of Technology +Copyright (c) 2024 The Uncertainty Quantification Foundation +Copyright (c) 2016-2024 The Uncertainty Quantification Foundation +Copyright (c) 2018-2024 The Uncertainty Quantification Foundation +Copyright (c) 2022-2024 The Uncertainty Quantification Foundation + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +prompt-toolkit 3.0.48 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2014, Jonathan Slenders + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +pycparser 2.22 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2008-2022, Eli Bendersky +Copyright (c) 2001-2017 David M. Beazley (Dabeaz LLC) +David Beazley (http://www.dabeaz.com) Copyright (c) 2017 + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +python-dotenv 1.0.1 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2014, Saurabh Kumar + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +pyzmq 26.2.0 - BSD-2-Clause AND BSD-3-Clause + + +(c) PyZMQ Developers +(c) iMatix Corporation +Copyright 2009 Facebook +copyright of Boris Feld +copyright of Chris Laws +Copyright 2009, Facebook +copyright of Frank Wiles +copyright of Julian Taylor +copyright of Thomas Kluyver +Copyright 2010, Justin Riley +copyright of Brian E. Granger +copyright of Min Ragan-Kelley +Copyright (c) PyZMQ Developers +Copyright (c) 2010 Justin Riley +Copyright (c) 2010 Brian Granger +Copyright (c) 2010 Lisandro Dalcin +Copyright (c) Stef van der Struijk +Copyright (c) 2010 The IPython Team +Copyright (c) 2022 PyZMQ Developers +Copyright 2010, Andrew Gwozdziewycz +Copyright (c) 2011- PyZMQ Developers +Copyright (c) 2011-2012 Travis Cline +Copyright (c) PyZMQ Development Team +Copyright (c) 2012 Godefroid Chapelle +Copyright (c) 2007-2010 iMatix Corporation +Copyright (c) 2010 Brian Granger, Fernando Perez +Copyright (c) 2010-2011 IPython Development Team +Copyright 2010, Nikolaus Rath <Nikolaus@rath.org> +Copyright (c) 2010 Brian Granger, Min Ragan-Kelley +copyright Brian E. Granger & Min Ragan-Kelley. OMQ +Copyright (c) 2010 Brian E. Granger & Min Ragan-Kelley +Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley +Copyright 2010, Brian E. Granger 2010, Min Ragan-Kelley +Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley +Copyright (c) 2017-2019 SUSE LINUX GmbH, Nuernberg, Germany +Copyright (c) 2003-2007 Robey Pointer <robeypointer@gmail.com> +Copyright 2007-2010, iMatix Corporation 2013 Brian Granger, Min Ragan-Kelley +Copyright 2010-2011, Miguel Landaeta <miguel@miguel.cc> 2011-2014, Julian Taylor +Copyright 2003-2007, Robey Pointer <robeypointer@gmail.com> , 2010-2011, IPython Development Team +Copyright 2010-2012, Brian Granger 2010-2013, Min Ragan-Kelley 2013 Felipe Cruz 2014 PyZMQ Developers +Copyright 2010-2011, Brian E. Granger 2010, Andrew Gwozdziewycz 2010, Fernando Perez 2011, 2013, Min Ragan-Kelley + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +seaborn 0.13.2 - BSD-2-Clause AND BSD-3-Clause + + +copyright f'2012- time.strftime +Copyright (c) 2013 Eddy Petrisor +Copyright (c) 2012 Alexei Boronine +Copyright 2004-2005 by Enthought, Inc. +Copyright (c) 2012-2023, Michael L. Waskom +Copyright (c) 2010 ActiveState Software Inc. +Copyright (c) 2005-2010 ActiveState Software Inc. +Copyright , https://mwaskom.github.io/' Michael Waskom +Copyright (c) Donald Stufft and individual contributors +Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers +Copyright (c) 2008 Stefan van der Walt <stefan@mentat.za.net> , Pauli Virtanen <pav@iki.fi> +Copyright (c) 2015 Min RK, Florian Rathgeber, Michael McNeil Forbes 2019 Casper da Costa-Luis + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +send2trash 1.8.3 - BSD-2-Clause AND BSD-3-Clause + + +Copyright 2017 Virgil Dupras +Copyright (c) 2017, Virgil Dupras +Copyright 2013 Hardcoded Software (http://www.hardcoded.net) + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +shapely 2.0.6 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2008, by Attractive Chaos <attractor@live.co.uk> +Copyright (c) 2007, Sean C. Gillies. 2019, Casper van der Wel. 2007-2022, Shapely Contributors + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +spglib 2.5.0 - BSD-2-Clause AND BSD-3-Clause + + +copyright 2009, Atsushi Togo +Copyright (c) 2008 Atsushi Togo +Copyright (c) 2010 Atsushi Togo +Copyright (c) 2011 Atsushi Togo +Copyright (c) 2012 Atsushi Togo +Copyright (c) 2015 Atsushi Togo +Copyright (c) 2016 Atsushi Togo +Copyright (c) 2017 Atsushi Togo +Copyright (c) 2023 Atsushi Togo +Copyright (c) 2024, Spglib team +Copyright (c) 2005 Atsushi Togo togo.atsushi@gmail.com +Copyright (c) 2008 Atsushi Togo togo.atsushi@gmail.com + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +threadpoolctl 3.5.0 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2017, Intel Corporation +(Copyright (c) 2017, Intel Corporation) +Copyright (c) 2019, threadpoolctl contributors + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +tinycss2 1.4.0 - BSD-2-Clause AND BSD-3-Clause + + +copyright Simon Sapin and contributors +Copyright (c) 2013-2020, Simon Sapin and contributors + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +traitlets 5.14.3 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) Enthought, Inc. +Copyright (c) 2010 Doug Hellmann +Copyright (c) IPython Development Team +Copyright (c) Jupyter Development Team +Copyright 2007-2015 by the Sphinx team +copyright 2015, The IPython Development Team +Copyright (c) 2001-, IPython Development Team + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +uncertainties 3.2.2 - BSD-2-Clause AND BSD-3-Clause + + +(c) 2010-2024, Eric O. LEBIGOT +(c) 2009-2016 by Eric O. LEBIGOT +(c) 2009-2024 by Eric O. LEBIGOT +(c) 2010-2016 by Eric O. LEBIGOT +Copyright (c) 2010-2020, Eric O. LEBIGOT (EOL) +copyright f'2010- date.today .year, Eric O. LEBIGOT + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +werkzeug 3.1.3 - BSD-2-Clause AND BSD-3-Clause + + +Copyright 2007 Pallets +copyright 2007 Pallets + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +widgetsnbextension 4.0.13 - BSD-2-Clause AND BSD-3-Clause + + +Copyright (c) 2014 Dan Le +Copyright (c) 2014 Adam Krebs +Copyright (c) 2019 Leon Gersen +Copyright (c) Vidar Tonaas Fauske +Copyright (c) 2014-2017, PhosphorJS +Copyright (c) 2014-2019, PhosphorJS +Copyright (c) Microsoft Corporation +Copyright (c) IPython Development Team +Copyright (c) Jupyter Development Team +(c) 2015 Adam Krebs, Jimmy Yuen Ho Wong +Copyright (c) 2014-2017, Jon Schlinkert +Copyright (c) 2015 Project Jupyter Contributors +Copyright (c) 2019 Project Jupyter Contributors +Copyright (c) 2014-2017, PhosphorJS Contributors +Copyright OpenJS Foundation and other contributors +Copyright (c) 2010-2015 Jeremy Ashkenas, DocumentCloud +(c) 2010-2019 Jeremy Ashkenas and DocumentCloud Backbone +(c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Backbone + +BSD-2-Clause AND BSD-3-Clause + +--------------------------------------------------------- + +--------------------------------------------------------- + +gitdb 4.0.12 - BSD-2-Clause AND BSD-3-Clause AND GPL-1.0-or-later + + +Copyright (c) 2010, 2011 Sebastian Thiel and contributors +Copyright (c) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors + +BSD-2-Clause AND BSD-3-Clause AND GPL-1.0-or-later + +--------------------------------------------------------- + +--------------------------------------------------------- + +python-json-logger 3.2.1 - BSD-2-Clause AND BSD-3-Clause AND ISC AND Python-2.0 + + +Copyright (c) 2011, Zakaria Zajac +Copyright (c) 2021, Timothee Mazzucotelli + +BSD-2-Clause AND BSD-3-Clause AND ISC AND Python-2.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +antlr4-python3-runtime 4.9.3 - BSD-3-Clause + + +Copyright (c) 2012-2017 The ANTLR Project + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +contourpy 1.3.1 - BSD-3-Clause + + +copyright 2021-2024, ContourPy +Copyright (c) 2021-2024, ContourPy Developers + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +fsspec 2024.12.0 - BSD-3-Clause + + +copyright 2018, Martin Durant +Copyright (c) 2018, Martin Durant + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +gitpython 3.1.44 - BSD-3-Clause + + +Copyright (c) 2008, 2009 Michael Trier and contributors +Copyright (c) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +Copyright (c) 2008, 2009 Michael Trier and contributors, 2010-2015 Sebastian Thiel + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +httpcore 1.0.7 - BSD-3-Clause + + +Copyright (c) 2020, Encode OSS Ltd (https://www.encode.io/) + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +httpx 0.28.1 - BSD-3-Clause + + +Copyright (c) 2019, Encode OSS Ltd (https://www.encode.io/) + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +ipython 8.31.0 - BSD-3-Clause + + +(c) Python and NumPy +Copyright (c) 2000 Thomas Heller +Copyright (c) 2010 Doug Hellmann +Portions (c) 2009 by Robert Kern +copyright 2007 by Armin Ronacher +Copyright (c) 2014, Jonathan Slenders +Copyright (c) 2015, Jonathan Slenders +Copyright (c) IPython Development Team +copyright The IPython Development Team +Copyright (c) 2012 IPython Development Team +Copyright (c) 2008, IPython Development Team +Copyright (c) 2011, IPython Development Team +Copyright (c) 2012, IPython Development Team +Copyright (c) 2008 Pauli Virtanen <pav@iki.fi> +Copyright (c) 2008 The IPython Development Team +Copyright (c) 2011 The IPython Development Team +Copyright (c) 2012 The IPython Development Team +Copyright (c) 2013 The IPython Development Team +Copyright (c) 2018 The IPython Development Team +Copyright (c) 2004-2021 Holger Krekel and others +Copyright (c) 2011, the IPython Development Team +Copyright (c) 2012, the IPython Development Team +Copyright (c) 2012- The IPython Development Team +Copyright (c) 2013, the IPython Development Team +Copyright (c) 2008-2011, IPython Development Team +Copyright (c) 2010-2011, IPython Development Team +Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> +Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> +Copyright (c) 2008-2011 The IPython Development Team +Copyright (c) 2008-2012 The IPython Development Team +Copyright (c) 2008-Present, IPython Development Team +Copyright (c) 2009-2011 The IPython Development Team +Copyright (c) 2010-2011 The IPython Development Team +Copyright (c) 2001 Nathaniel Gray <n8gray@caltech.edu> +Copyright (c) 2001 Fernando Perez <fperez@colorado.edu> +Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> +Copyright (c) 2005 Fernando Perez. <fperez@colorado.edu> +Copyright (c) 2016 The IPython Team <ipython-dev@scipy.org> +Copyright (c) 2001-2004 Fernando Perez <fperez@colorado.edu> +Copyright (c) 2001-2005 Fernando Perez <fperez@colorado.edu> +Copyright (c) 2001-2006 Fernando Perez <fperez@colorado.edu> +Copyright (c) 2005-2006 Fernando Perez <fperez@colorado.edu> +Copyright (c) 2001 Python Software Foundation, www.python.org +Copyright (c) 2001-2007 Fernando Perez. <fperez@colorado.edu> +Copyright (c) 2002-2006 Fernando Perez. <fperez@colorado.edu> +Copyright (c) 2005-2006 Fernando Perez. <fperez@colorado.edu> +Copyright (c) 2001, Fernando Perez <fernando.perez@colorado.edu> +Copyright (c) 2005 Jorgen Stenarson <jorgen.stenarson@bostream.nu> +Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu> +Copyright (c) 2005-2006 Fernando Perez. <Fernando.Perez@colorado.edu> +Copyright (c) 2005 Fernando Perez <fperez@colorado.edu> Brian E Granger <ellisonbg@gmail.com> Benjamin Ragan-Kelley <benjaminrk@gmail.com> + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyter-client 8.6.3 - BSD-3-Clause + + +Copyright (c) 2011- PyZMQ Developers +Copyright (c) Jupyter Development Team +copyright 2015, Jupyter Development Team +Edits Copyright (c) 2010 The IPython Team +Copyright (c) The Jupyter Development Team +Copyright (c) 2015-, Jupyter Development Team +Copyright (c) 2010-2011 IPython Development Team +Copyright (c) 2001-2015, IPython Development Team +Copyright (c) 2003-2007 Robey Pointer <robeypointer@gmail.com> + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyter-core 5.7.2 - BSD-3-Clause + + +Copyright (c) IPython Development Team +Copyright (c) Jupyter Development Team +copyright 2015, Jupyter Development Team +Copyright (c) 2015-, Jupyter Development Team + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyter-events 0.11.0 - BSD-3-Clause + + +copyright 2019, Project Jupyter +Copyright (c) Jupyter Development Team +Copyright (c) 2022-, Jupyter Development Team + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyter-server 2.15.0 - BSD-3-Clause + + +Copyright (c) 2017 ORGANIZATION +Copyright 2011-2019 Twitter, Inc. +Copyright (c) Jupyter Development Team +Copyright (c) 2015-, Jupyter Development Team +Copyright (c) 2001-2015, IPython Development Team +copyright 2020, Jupyter Team, https://jupyter.org + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyter-server-terminals 0.5.3 - BSD-3-Clause + + +Copyright (c) Jupyter Development Team +Copyright (c) 2021-, Jupyter Development Team +copyright 2021, Jupyter Team, https://jupyter.org + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +mistune 3.1.0 - BSD-3-Clause + + +(c) html' (c) AE D +copyright 2019, Hsiaoming Yang +Copyright (c) 2014, Hsiaoming Yang + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +nbclient 0.10.2 - BSD-3-Clause + + +Copyright (c) IPython Development Team +Copyright (c) Jupyter Development Team +Copyright (c) 2020-, Jupyter Development Team + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +nbconvert 7.16.5 - BSD-3-Clause + + +Copyright 2011-2016 Twitter, Inc. +Copyright (c) IPython Development Team +Copyright (c) Jupyter Development Team +copyright 2015- s, Jupyter Development Team +Copyright (c) 2017, Jupyter Development Team +Copyright (c) 2015-, Jupyter Development Team +Copyright (c) 2014 The IPython Development Team +Copyright (c) 2013, the IPython Development Team +Copyright (c) 2014-2017, PhosphorJS Contributors +Copyright (c) 2016, the IPython Development Team +Copyright (c) 2001-2015, IPython Development Team +Copyright (c) 2014-2016, Jupyter Development Team +Copyright (c) 2014-2017, Jupyter Development Team +(c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> Adapted from GitHub + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +notebook 7.3.2 - BSD-3-Clause + + +(c) b.Vg +(c) Sindre Sorhus +copyright Koen Bok +(c) 2011 Gary Court +Copyright 2021 Mapbox +Copyright (c) 2017, Vega +Copyright (c) Felix Bohm +Copyright 2011 Gary Court +Copyright (c) 2017, Mapbox +Copyright (c) Font Awesome +Copyright 2019 Ron Buckton +Copyright 2020 Google LLC. +Copyright Gaetan Renaudeau +Copyright (c) 2015 Treasure +Copyright 2021 Mike Bostock +(c) 2017-2021 Joachim Wester +(c) 2017-2022 Joachim Wester +Copyright (c) 2014 Alex Bell +Copyright (c) 2017 Braintree +Copyright 2001 Robert Penner +Copyright 2015 Ricky Reusser +Copyright 2015, Mike Bostock +Copyright (c) 2011 Gary Court +Copyright (c) 2015 JD Ballard +Copyright (c) 2015 Josh Junon +Copyright (c) 2018 Chris Holt +Copyright (c) 2015 Dan Abramov +Copyright (c) 2015 David Clark +Copyright (c) 2023 Fadi Khadra +Copyright (c) 2014 Athan Reines +Copyright (c) 2015 Athan Reines +(c) http://www.w3.org/1999/xhtml +Copyright (c) 2013, Jason Davies +Copyright (c) 2014. Athan Reines +Copyright (c) 2015 Dmitry Ivanov +Copyright (c) 2015. Athan Reines +Copyright (c) 2017 Martin Hansen +Copyright 2010-2015 Mike Bostock +Copyright 2010-2020 Mike Bostock +Copyright 2010-2021 Mike Bostock +Copyright 2010-2022 Mike Bostock +Copyright 2010-2023 Mike Bostock +Copyright 2013-2021 Mike Bostock +Copyright 2015-2016 Mike Bostock +Copyright 2016-2021 Mike Bostock +(c) Cure53 and other contributors +Copyright (c) 2012 Heather Arthur +Copyright (c) 2013 James Halliday +Copyright (c) 2015 Shusaku Uesugi +Copyright 2018 Vladimir Agafonkin +Copyright (c) 2011 Fabrice Bellard +Copyright 2008-2012 Charles Karney +copyright (c) 2019 Denis Pushkarev +Copyright (c) 2016 Adele Delamarche +Copyright (c) 2017 Dmitry Soshnikov +Copyright (c) 2018 Tamino Martinius +Copyright (c) Microsoft Corporation +Copyright 2012-2019 Michael Bostock +(c) 2016-present Alexander Kuznetsov +Athan Reines. kgryte@gmail.com. 2014 +Athan Reines. kgryte@gmail.com. 2015 +Copyright (c) 2014-2015 Athan Reines +Copyright (c) 2017 Evgeny Poberezkin +Copyright (c) 2020 Evgeny Poberezkin +Copyright 2018-2021 Observable, Inc. +Copyright (c) 2015-2023 Martin Hensel +Copyright (c) 2015-present Evan Jacobs +Copyright (c) 2016 Alexander Kuznetsov +Copyright (c) 2020 by Marijn Haverbeke +Copyright (c) Jupyter Development Team +Copyright (c) 2014 The xterm.js authors +Copyright (c) 2014-2017, Jon Schlinkert +Copyright (c) 2016 typestyle Permission +Copyright (c) 2021 @markedjs Permission +Copyright (c) Font Awesome Font Awesome +Copyright (c) 2016-present Sultan Tarimo +Copyright (c) 2014 - 2022 Knut Sveidqvist +Copyright (c) 2015-2021 Evgeny Poberezkin +Copyright (c) 2013-present, Facebook, Inc. +Copyright (c) 2014-present, Facebook, Inc. +Copyright (c) 2019 iVis@Bilkent Permission +(c) 2021-2023 Jupyter Notebook Contributors +Copyright (c) Guillaume Potier. Distributed +Copyright (c) 2014-2023, Lumino Contributors +Copyright (c) 2013, 2014, 2020 Joachim Wester +Copyright (c) 2014 The cheeriojs contributors +Copyright (c) 2015-, Jupyter Development Team +Copyright (c) 2018-present, iamkun Permission +Copyright (c) 2021 Kiel University and others +copyright JupyterLab development team. import +Copyright (c) 2015 Unshift.io, Arnout Kazemier +Copyright (c) 2017 Kiel University and others. +Copyright JS Foundation and other contributors +Copyright (c) 2013, 2014, 2015 P'unk Avenue LLC +Copyright (c) Facebook, Inc. and its affiliates +Copyright 2013 Andrey Sitnik <andrey@sitnik.ru> +Copyright 2017 Andrey Sitnik <andrey@sitnik.ru> +Copyright 2023 Dr.-Ing. Mario Heiderich, Cure53 +Copyright (c) 2014-2017, PhosphorJS Contributors +Copyright (c) 2014-2019, PhosphorJS Contributors +Copyright (c) 2001-2015, IPython Development Team +Copyright (c) 2012-2018 Aseem Kishore, and others +Copyright (c) 2016-2018, The Cytoscape Consortium +Copyright (c) 2016-2023, The Cytoscape Consortium +Copyright (c) Isaac Z. Schlueter and Contributors +Copyright Joyent, Inc. and other Node contributors +Copyright (c) 2012 Mathias Bynens <mathias@qiwi.be> +Copyright (c) 2013 Mathias Bynens <mathias@qiwi.be> +Copyright (c) 2015, Dan Flettre <fletd01@yahoo.com> +Copyright (c) 2012 Kris Kowal <kris.kowal@cixar.com> +Copyright 2016 Interactive Data Lab and contributors +Copyright (c) 2013 Roman Shtylman <shtylman@gmail.com> +Copyright (c) 2013 Thaddee Tyl <thaddee.tyl@gmail.com> +Copyright (c) 2019 - present, iVis@Bilkent. Permission +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) +Copyright (c) 2014, 2016, 2017, 2019, 2021 Simon Lydell +Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com> +Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com> +Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com> +Copyright (c) 2021 Titus Wormer <tituswormer@gmail.com> +Copyright (c) 2011 Heather Arthur <fayearthur@gmail.com> +Copyright (c) 2012 Yusuke Suzuki <utatane.tea@gmail.com> +Copyright i-Vis Research Group, Bilkent University, 2007 +Copyright (c) 2004, John Gruber http://daringfireball.net +Copyright (c) 2019-present Fabio Spampinato, Andrew Maney +Copyright 2010, 2011, Chris Winberry <chris@winberry.net> +Copyright (c) 2011 Ariya Hidayat <ariya.hidayat@gmail.com> +Copyright (c) 2012 Ariya Hidayat <ariya.hidayat@gmail.com> +Copyright (c) 2013 Ariya Hidayat <ariya.hidayat@gmail.com> +Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com> +Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io) +Copyright (c) 2010-2020 Robert Kieffer and other contributors +Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com> +Copyright (c) 2012 Arpad Borsos <arpad.borsos@googlemail.com> +Copyright (c) 2015, University of Washington Interactive Data Lab +Copyright (c) 2016, University of Washington Interactive Data Lab +Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com) +Copyright (c) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl> +Marked Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/) +Copyright (c) 2012 James Halliday, Josh Duff, and other contributors +Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) +Copyright (c) 2014-present Sebastian McKenzie and other contributors +Copyright (c) 2018 by Marijn Haverbeke <marijnh@gmail.com> and others +Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov +Copyright (c) 2015-2023, University of Washington Interactive Data Lab +Copyright (c) Julien Crouzet and Florian Schwingenschlogl. Distributed +Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/) +Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/) +Copyright (c) 2017-present Dmitry Soshnikov <dmitry.soshnikov@gmail.com> +Copyright jQuery Foundation and other contributors <https://jquery.org/> +Copyright OpenJS Foundation and other contributors <https://openjsf.org/> +Copyright (c) 2018-2021 by Marijn Haverbeke <marijnh@gmail.com> and others +Copyright (c) 2016 by Marijn Haverbeke <marijn@haverbeke.berlin> and others +Copyright (c) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others +Copyright (c) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin> and others +Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js) +Copyright (c) 2018, The xterm.js authors (https://github.com/xtermjs/xterm.js) +Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js) +Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com) +Copyright (c) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others +Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js) +Copyright 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University +Copyright (c) 2014 - Kevin Jahns <kevin.jahns@rwth-aachen.de> - Chair of Computer Science +Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) https://github.com/chjj/term.js +Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed) https://github.com/markedjs/marked +Copyright (c) 2011-2015 Jan Lehnardt <jan@apache.org> & Marc Bachmann <https://github.com/marcbachmann> +copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +notebook-shim 0.2.4 - BSD-3-Clause + + +Copyright (c) 2022 Project Jupyter Contributors + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pathos 0.3.3 - BSD-3-Clause + + +(c) 1998-2004 +(c) 1998-2005 +Copyright (c) 2016 California Institute of Technology +copyright d, The Uncertainty Quantification Foundation +Copyright (c) 1997-2016 California Institute of Technology +Copyright (c) 2004-2016 California Institute of Technology +Copyright (c) 2008-2016 California Institute of Technology +Copyright (c) 2015-2016 California Institute of Technology +Copyright (c) 2024 The Uncertainty Quantification Foundation +Copyright (c) 2016-2024 The Uncertainty Quantification Foundation +Copyright (c) 2018-2024 The Uncertainty Quantification Foundation +Copyright (c) 2022-2024 The Uncertainty Quantification Foundation +Copyright (c) 2023-2024 The Uncertainty Quantification Foundation + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +protobuf 3.20.3 - BSD-3-Clause + + +Copyright 2007 Google Inc. +Copyright 2008 Google Inc. + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +psutil 6.1.1 - BSD-3-Clause + + +copyright 2009- s, s +Copyright (c) 2009, Giampaolo +Copyright (c) 2017, Arnon Yaari +Copyright (c) 2015, Ryo ONODERA. +Copyright (c) 2009 Giampaolo Rodola +Copyright (c) 2009, Giampaolo Rodola +Copyright 2007-2011 by the Sphinx team +Copyright (c) 2009, Giampaolo Rodola Jeff Tang +Copyright (c) 2009, Giampaolo Rodola karthikrev +Copyright (c) 2009, Jay Loden, Giampaolo Rodola +Copyright (c) 2009, Giampaolo Rodola Landry Breuil +Copyright (c) 2009, Giampaolo Rodola Himanshu Shekhar +Copyright (c) 2009, Giampaolo Rodola Oleksii Shevchuk +Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola +Copyright (c) 2009, Jay Loden, Giampaolo Rodola Landry Breuil (OpenBSD implementation), Ryo Onodera (NetBSD implementation) + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +scipy 1.15.0 - BSD-3-Clause + + +(c) 2024 +(c) B Whether +(c) 2003, C. Bond +Copyright 2021 The +(c) Date July, 1988 +Copyright 2018 Nico +Gamma (c) Gamma (c) +(c) Compute Hessian H +Csp spcreator (c) Dsp +Csp spcreator (c) Gsp +copyright Cephes Math +2020 Intel Corporation +2022 Intel Corporation +Copyright (c) 2021 The +Copyright John Maddock +Copyright Albert Steppi +Copyright Gautam Sewani +(c) 2011 import warnings +Copyright 2018 Ulf Adams +Copyright Catch2 Authors +copyright Xiaogang Zhang +copyrighted by Alan Genz +Copyright (c) 2024 HiGHS. +Copyright 2006 Johan Rade +Copyright 2012 K R Walker +Copyright Paul A. Bristow +copyright by Renee Touzin +Copyright 2018 Peter Dimov +Copyright 2020 Evan Miller +Copyright 2020 Peter Dimov +Copyright Evan Miller 2020 +Copyright Rene Rivera 2020 +Copyright Ryan Elandt 2023 +Copyright Thomas Mang 2010 +Copyright Thomas Mang 2011 +Copyright Thomas Mang 2012 +Copyright ohn Maddock 2012 +Csp self.spcreator (c) Dsp +copyright 2024, Consortium +(c) 2011 import numpy as np +(c) 2012 import numpy as np +(c) 2014 import numpy as np +Copyright 2000 by Alan Genz +Copyright 2006 John Maddock +Copyright 2007 John Maddock +Copyright 2008 John Maddock +Copyright 2013 John Maddock +Copyright 2014 John Maddock +Copyright 2017 John Maddock +Copyright 2020 Matt Borland +Copyright 2024 Matt Borland +Copyright Evan Miller, 2020 +Copyright Hubert Holin 2001 +Copyright John Maddock 2005 +Copyright John Maddock 2006 +Copyright John Maddock 2007 +Copyright John Maddock 2008 +Copyright John Maddock 2009 +Copyright John Maddock 2010 +Copyright John Maddock 2011 +Copyright John Maddock 2012 +Copyright John Maddock 2013 +Copyright John Maddock 2014 +Copyright John Maddock 2015 +Copyright John Maddock 2016 +Copyright John Maddock 2017 +Copyright John Maddock 2018 +Copyright John Maddock 2019 +Copyright John Maddock 2020 +Copyright John Maddock 2021 +Copyright John Maddock 2023 +Copyright John Maddock 2024 +Copyright Matt Borland 2021 +Copyright Matt Borland 2022 +Copyright Matt Borland 2023 +Copyright Matt Borland 2024 +Copyright Paul Bristow 2007 +Copyright Paul Bristow 2013 +Copyright Paul Bristow 2014 +copyright John Maddock 2008 +Copyright (c) Piers Lawrence +Copyright 2008 Gautam Sewani +Copyright 2013 Andrea Gavana +Copyright 2013 Niall Douglas +Copyright 2017 Nick Thompson +Copyright 2018 Nick Thompson +Copyright 2019 Nick Thompson +Copyright Gautam Sewani 2008 +Copyright Jeremy Murphy 2016 +Copyright John Maddock, 2017 +Copyright John Maddock, 2020 +Copyright John Maddock, 2021 +Copyright John Maddock, 2022 +Copyright John Maddock, 2023 +Copyright Matt Borland, 2021 +Copyright Matt Borland, 2022 +Copyright Matt Borland, 2023 +Copyright Matt Borland, 2024 +Copyright Nick Thompson 2017 +Copyright Nick Thompson 2018 +Copyright Nick Thompson 2019 +Copyright Nick Thompson 2020 +Copyright Nick Thompson 2024 +Copyright Paul A. 2007, 2010 +Copyright Yosef Meller, 2009 +(c) Copyright Johan Rade 2006 +Copyright (c) 2006 Johan Rade +Copyright (c) 2013 Kenneth L. +Copyright (c) 2013, Alan Genz +Copyright (c) 2014 Eric Moore +Copyright (c) 2019 Peter Bell +Copyright (c) 2022 Consortium +Copyright (c) 2024 Consortium +Copyright (c) jmc 2007 - 2010 +Copyright 2002 Gary Strangman +Copyright 2002 Pearu Peterson +Copyright 2013 Nikhar Agrawal +Copyright 2014 Anton Bikineev +Copyright 2014, Eric W. Moore +Copyright Christian Lorentzen +Copyright John Maddock 2006-7 +Copyright John Maddock 2007-8 +Copyright Madhur Chauhan 2020 +Copyright Nakhar Agrawal 2013 +Copyright Nick Thompson, 2017 +Copyright Nick Thompson, 2018 +Copyright Nick Thompson, 2019 +Copyright Nick Thompson, 2020 +Copyright Nick Thompson, 2021 +Copyright Nick Thompson, 2023 +Copyright Nick Thompson, 2024 +Copyright Paul A Bristow 2010 +Copyright Xiaogang Zhang 2006 +(c) Copyright Evan Miller 2020 +Copyright (c) 2008 Damian Eads +Copyright (c) 2012 Google Inc. +Copyright (c) 2020 Evan Miller +Copyright 1999 Travis Oliphant +Copyright 2005 Travis Oliphant +Copyright 2010 Paul A. Bristow +Copyright 2011 Paul A. Bristow +Copyright 2012 Paul A. Bristow +Copyright 2013 Paul A. Bristow +Copyright 2015 Paul A. Bristow +Copyright 2019 Paul A. Bristow +Copyright 2020, Madhur Chauhan +Copyright 2021 Alexander Grund +Copyright 2021 Andrey Semashev +Copyright 2021 Paul A. Bristow +Copyright John Maddock 2006-15 +Copyright John Maddock 2008-11 +Copyright John Z. Maddock 2016 +Copyright John Z. Maddock 2017 +Copyright Paul A. Bristow 2006 +Copyright Paul A. Bristow 2007 +Copyright Paul A. Bristow 2008 +Copyright Paul A. Bristow 2009 +Copyright Paul A. Bristow 2010 +Copyright Paul A. Bristow 2011 +Copyright Paul A. Bristow 2012 +Copyright Paul A. Bristow 2013 +Copyright Paul A. Bristow 2014 +Copyright Paul A. Bristow 2015 +Copyright Paul A. Bristow 2016 +Copyright Paul A. Bristow 2017 +Copyright Paul A. Bristow 2018 +Copyright Paul A. Bristow 2019 +Copyright Paul A. Bristow 2021 +Copyright Paul a. Bristow 2010 +copyrighted by Enthought, Inc. +(c) Copyright Hubert Holin 2001 +(c) Copyright Hubert Holin 2003 +(c) Copyright John Maddock 2005 +(c) Copyright John Maddock 2006 +(c) Copyright John Maddock 2007 +(c) Copyright John Maddock 2008 +(c) Copyright John Maddock 2009 +(c) Copyright John Maddock 2010 +(c) Copyright John Maddock 2013 +(c) Copyright John Maddock 2014 +(c) Copyright John Maddock 2015 +(c) Copyright John Maddock 2017 +(c) Copyright John Maddock 2018 +(c) Copyright John Maddock 2020 +(c) Copyright John Maddock 2021 +(c) Copyright John Maddock 2022 +(c) Copyright John Maddock 2023 +(c) Copyright John Maddock 2024 +(c) Copyright Matt Borland 2020 +(c) Copyright Matt Borland 2021 +(c) Copyright Matt Borland 2022 +(c) Copyright Matt Borland 2023 +(c) Copyright Matt Borland 2024 +Copyright (c) 2006 John Maddock +Copyright (c) 2007 John Maddock +Copyright (c) 2007, Damian Eads +Copyright (c) 2009 John Maddock +Copyright (c) 2011 John Maddock +Copyright (c) 2012 John Maddock +Copyright (c) 2014 John Maddock +Copyright (c) 2015 John Maddock +Copyright (c) 2016 Adrian Veres +Copyright (c) 2017 John Maddock +Copyright (c) 2020 John Maddock +Copyright (c) 2021 Matt Borland +Copyright (c) 2021 Orson Peters +Copyright (c) 2022 John Maddock +Copyright (c) 2024 Matt Borland +Copyright (c) Tyler Reddy, 2016 +Copyright 2020-2021 Peter Dimov +Copyright Benjamin Sobotta 2012 +Copyright Jeremy W. Murphy 2015 +Copyright Paul A. Bristow, 2019 +Copyright Peter Dimov 2015-2021 +Copyright Takuma Yoshimura 2024 +copyright (c) 2022, Robert Kern +(c) Copyright Bruno Lalande 2008 +(c) Copyright Jeremy Murphy 2015 +(c) Copyright John Maddock, 2024 +(c) Copyright Nick Thompson 2017 +(c) Copyright Nick Thompson 2018 +(c) Copyright Nick Thompson 2019 +(c) Copyright Nick Thompson 2020 +(c) Copyright Nick Thompson 2021 +(c) Copyright Nick Thompson 2023 +Copyright (C) 2023 Adam Lugowski +Copyright (c) 2017 Nick Thompson +Copyright (c) 2018 Nick Thompson +Copyright (c) 2019 Nick Thompson +Copyright (c) 2020 Marco Gorelli +Copyright (c) 2020 Nick Thompson +Copyright (c) 2021 Nick Thompson +Copyright (c) 2022 Adam Lugowski +Copyright (c) 2023 Adam Lugowski +Copyright (c) 2023 Nick Thompson +Copyright (c) 2024 Nick Thompson +Copyright 1991 Dieter Kraft, FHM +Copyright 1997-2008 by Agner Fog +Copyright 2002-2008 by Agner Fog +Copyright 2002-2014 by Agner Fog +Copyright 2004-2008 by Agner Fog +Copyright 2004-2013 by Agner Fog +Copyright 2020 Intel Corporation +Copyright 2022 Intel Corporation +Copyright 2022 James E. King III +Copyright Anne M. Archibald 2008 +Copyright John Maddock 2005-2006 +Copyright John Maddock 2005-2008 +Copyright John Maddock 2011-2021 +Copyright Nicholas Thompson 2017 +Copyright Nicholas Thompson 2018 +Copyright Nikhar Agrawal 2013-14 +Copyright Paul A. Bristow 2006-7 +(c) Copyright Anton Bikineev 2014 +(c) Copyright James Folberth 2022 +(c) Copyright John Maddock 2006-7 +(c) Copyright John Maddock 2006-8 +(c) Copyright Nick Thompson, 2018 +(c) Copyright Nick Thompson, 2019 +(c) Copyright Victor Ananyev 2021 +Copyright (c) 2006 Xiaogang Zhang +Copyright (c) 2006-7 John Maddock +Copyright (c) 2009, Motorola, Inc +Copyright (c) 2013 Anton Bikineev +Copyright (c) 2013 Pauli Virtanen +Copyright (c) 2014 Anton Bikineev +Copyright (c) 2016-2018 ERGO-Code +Copyright (c) 2016-2019 ERGO-Code +Copyright (c) 2018-2019 ERGO-Code +Copyright John Maddock 2006, 2007 +Copyright John Maddock 2006, 2010 +Copyright John Maddock 2006, 2011 +Copyright John Maddock 2006, 2012 +Copyright John Maddock 2007, 2014 +Copyright John Maddock 2008, 2012 +Copyright John Maddock 2010, 2012 +Copyright Nicholas McKibben, 2022 +Copyright Paul Bristow 2006, 2007 +Copyright Paul Bristow 2007, 2011 +(c) Copyright Antony Polukhin 2022 +(c) Copyright Paul A. Bristow 2006 +(c) Copyright Paul A. Bristow 2011 +Copyright (c) 2002 Travis Oliphant +Copyright (c) 2006-2008 Johan Rade +Copyright (c) 2010, Robert Parrish +Copyright (c) 2011 Francois Mauger +Copyright (c) 2011 Paul A. Bristow +Copyright (c) 2012 Paul A. Bristow +Copyright (c) 2018, Quansight-Labs +Copyright (c) 2019 Paul A. Bristow +Copyright (c) 2019-2020 Peter Bell +Copyright (c) Pauli Virtanen, 2010 +Copyright 2015 Jon Lund Steffensen +Copyright 2017 Two Blue Cubes Ltd. +Copyright John Maddock 2009 - 2012 +Copyright Thijs van den Berg, 2008 +Copyright (c) 1993-2019 C.B. Barber +Copyright (c) 2014-2022 Jarryd Beck +Copyright (c) 2024 SciPy developers +Copyright (c) Benjamin Sobotta 2012 +Copyright 2002 H Lohninger, TU Wein +Copyright Paul A. Bristow 2006-2011 +(c) Copyright Hubert Holin 2003-2005 +(c) Copyright John Maddock 2005-2006 +(c) Copyright John Maddock 2005-2021 +Copyright (c) 2007 Cybozu Labs, Inc. +Copyright (c) 2020 Michael Feldmeier +Copyright (c) Damian Eads, 2007-2008 +Copyright 2011, 2012 Paul A. Bristow +Copyright 2013 Christopher Kormanyos +Copyright 2014 Christopher Kormanyos +Copyright 2015 Jeremy William Murphy +Copyright Christopher Kormanyos 2012 +Copyright Christopher Kormanyos 2013 +Copyright Christopher Kormanyos 2014 +Copyright Christopher Kormanyos 2016 +Copyright Christopher Kormanyos 2020 +Copyright Christopher Kormanyos 2021 +Copyright Christopher Kormanyos 2024 +Copyright Matthew Pulver 2018 - 2019 +Copyright Paul A. Bristow 2006, 2007 +Copyright Paul A. Bristow 2006, 2017 +Copyright Paul A. Bristow 2007, 2009 +Copyright Paul A. Bristow 2007, 2010 +Copyright Paul A. Bristow 2007, 2012 +Copyright Paul A. Bristow 2008, 2009 +Copyright Paul A. Bristow 2008, 2010 +Copyright Paul A. Bristow 2008, 2014 +Copyright Paul A. Bristow 2009, 2011 +Copyright Paul A. Bristow 2010, 2013 +Copyright Paul A. Bristow 2010, 2015 +Copyright Paul A. Bristow 2011, 2012 +Copyright Paul A. Bristow 2014, 2015 +Copyright Paul A. Bristow 2015, 2018 +Copyright Paul A. Bristow 2016, 2017 +Copyright Paul A. Bristow 2016, 2018 +Copyright Paul A. Bristow 2017, 2018 +(c) Copyright Daryle Walker 2001-2002 +(c) Copyright John Maddock 2006, 2015 +Copyright (c) 2007 - Sebastien Fabbro +Copyright (c) 2007, 2008, Damian Eads +Copyright (c) 2007, 2013 John Maddock +Copyright (c) 2014 Mathjax Consortium +Copyright (c) 2015-2017 Martin Hensel +Copyright (c) 2016-2017 Felix Lenders +Copyright (c) 2019 Max-Planck-Society +Copyright (c) 2020-2023 Adam Lugowski +Copyright (c) 2022-2023 Adam Lugowski +Copyright Paul A. Bristow 2009 - 2019 +copyright Paul A. Bristow 2006 - 2010 +(c) Copyright Daryle Walker 2001, 2006 +(c) Copyright John Maddock 2008 - 2022 +(c) Copyright Matt Borland 2021 - 2022 +(c) Rasmus Munk Larsen, Stanford, 2004 +Copyright (c) 2012, Jaydeep P. Bardhan +Copyright (c) 2012, Matthew G. Knepley +Copyright (c) 2014, Janani Padmanabhan +Copyright (c) 2021 - 2022 Matt Borland +Copyright (c) 2022 Two Blue Cubes Ltd. +Copyright 2004-2005 by Enthought, Inc. +Copyright John Maddock 2005-2006, 2011 +Copyright John Maddock 2006-7, 2013-20 +Copyright (c) 1994 by Xerox Corporation +Copyright (c) 1996-2008 Rice University +Copyright (c) 2010 Thomas P. Robitaille +Copyright (c) 2011 ashelly.myopenid.com +Copyright 2013 John Maddock Distributed +Copyright 2013 Paul Bristow Distributed +Copyright 2014 Paul Bristow Distributed +Copyright 2015 John Maddock Distributed +Copyright 2017 John Maddock Distributed +Copyright 2018 John Maddock Distributed +Copyright 2019 John Maddock Distributed +Copyright 2020 Matt Borland Distributed +Copyright 2021 Matt Borland Distributed +Copyright 2022 Matt Borland Distributed +Copyright 2023 Matt Borland Distributed +Copyright 2024 Matt Borland Distributed +Copyright Paul A. Bristow 2007, 2013-14 +(c) Copyright Jeremy William Murphy 2015 +(c) Copyright Jeremy William Murphy 2016 +Copyright (c) 2001, 2002 Enthought, Inc. +Copyright (c) 2003, 2007-14 Matteo Frigo +Copyright (c) 2003-2005 Peter J. Verveer +Copyright (c) 2013 Christopher Kormanyos +Copyright 2002-2016 The SciPy Developers +Copyright 2008 John Maddock. Distributed +Copyright 2010 John Maddock. Distributed +Copyright 2011 John Maddock. Distributed +Copyright 2012 John Maddock. Distributed +Copyright 2013 John Maddock. Distributed +Copyright 2014 John Maddock. Distributed +Copyright 2015 John Maddock. Distributed +Copyright 2017 John Maddock. Distributed +Copyright 2017 Nick Thompson Distributed +Copyright 2019 John Maddock. Distributed +Copyright 2024. Matt Borland Distributed +Copyright (c) 1998-2007, Timothy A. Davis +Copyright (c) 2005-2022, NumPy Developers +Copyright 2008 Bruno Lalande. Distributed +Copyright 2017, Nick Thompson Distributed +Copyright 2019, Nick Thompson Distributed +Copyright (c) 2005-2015, Michele Simionato +Copyright (c) 2010-2018 Max-Planck-Society +Copyright (c) 2010-2019 Max-Planck-Society +Copyright (c) 2010-2022 Max-Planck-Society +Copyright 1984, 1995 by Stephen L. Moshier +Copyright 1984, 1996 by Stephen L. Moshier +Copyright 2020 Madhur Chauhan. Distributed +Copyright 2021 Nick Thompson, John Maddock +Copyright Christopher Kormanyos 2012, 2013 +Copyright Nick Thompson, John Maddock 2020 +Copyright Paul A. Bristow 2006, 2007, 2012 +Copyright Paul A. Bristow 2006, 2012, 2017 +Copyright Paul A. Bristow 2007, 2008, 2010 +Copyright Paul A. Bristow 2007, 2009, 2010 +Copyright Paul A. Bristow 2007, 2009, 2012 +Copyright Paul A. Bristow 2007, 2010, 2011 +Copyright Paul A. Bristow 2007, 2010, 2012 +Copyright Paul A. Bristow 2008, 2009, 2014 +Copyright Paul A. Bristow 2016, 2017, 2018 +(c) Copyright Eric Ford & Hubert Holin 2001 +(c) Copyright Eric Ford 2001 & Hubert Holin +(c) Rasmus Munk Larsen, Stanford University +Copyright (c) 1993-2019 The Geometry Center +Copyright (c) 1998-2000 Theodore C. Belding +Copyright (c) 2024 Matt Borland Distributed +Copyright 1984 - 1994 by Stephen L. Moshier +Copyright 1985 by Stephen L. Moshier Direct +Copyright Christopher Kormanyos 2002 - 2011 +Copyright Nick Thompson, John Maddock, 2020 +Copyright Nick Thompson, Matt Borland, 2022 +Copyright Nick Thompson, Matt Borland, 2023 +(c) Rasmus Munk Larsen, Stanford, 1999, 2004 +Copyright (c) 2001-2011 - Scilab Enterprises +Copyright 2016, 2017 Peter Dimov Distributed +copyright 2008 Paul A. Bristow, John Maddock +Copyright (c) 2009 Pauli Virtanen Distributed +Copyright (c) 2011-2014, The OpenBLAS Project +Copyright (c) 2024 Tan Ping Liang, Peter Bell +Copyright Johan Rade and Paul A. Bristow 2011 +Copyright John Maddock 2006, 2007, 2012, 2014 +Copyright Paul A. Bristow & John Maddock 2009 +(c) Copyright Nick Thompson, John Maddock 2023 +Copyright (c) 2009-2017 The MathJax Consortium +Copyright (c) 2010-2017 The MathJax Consortium +Copyright (c) 2011-2015 The MathJax Consortium +Copyright (c) 2011-2017 The MathJax Consortium +Copyright (c) 2013-2017 The MathJax Consortium +Copyright (c) 2014-2017 The MathJax Consortium +Copyright (c) 2015-2017 The MathJax Consortium +Copyright (c) 2016-2017 The MathJax Consortium +Copyright J.S. Roy (js@jeannot.org), 2002-2005 +(c) Copyright Christopher Kormanyos 1999 - 2021 +Copyright (c) 2008 Ian Bicking and Contributors +Copyright (c) 2009, Pauli Virtanen <pav@iki.fi> +Copyright (c) 2015, Pauli Virtanen <pav@iki.fi> +Copyright 2005, 2013 Daryle Walker. Distributed +Copyright 2006 John Maddock and Paul A. Bristow +Copyright John Maddock and Paul A. Bristow 2007 +Copyright John Maddock and Paul A. Bristow 2010 +Copyright (c) 2008 Paul A. Bristow, John Maddock +Copyright 1984, 1987, 1995 by Stephen L. Moshier +Copyright 1984, 1987, 2000 by Stephen L. Moshier +Copyright 1984, 1995, 2000 by Stephen L. Moshier +Copyright 1985, 1987, 2000 by Stephen L. Moshier +Copyright 2024 Christopher Kormanyos Distributed +Copyright Paul A. Bristow 2006, 2007, 2009, 2010 +Copyright Paul A. Bristow 2007, 2009, 2010, 2012 +Copyright Paul A. Bristow 2007, 2010, 2012, 2014 +Copyright Paul A. Bristow 2007, 2010, 2014, 2016 +Copyright Paul A. Bristow 2008, 2009, 2012, 2016 +Copyright Rene Ferdinand Rivera Morell 2023-2024 +(c) Copyright Matt Borland and Nick Thompson 2022 +(c) Copyright Nick Thompson and Matt Borland 2020 +(c) Rasmus Munk Larsen, Stanford University, 2000 +(c) Rasmus Munk Larsen, Stanford University, 2004 +Copyright 1984, 1987 by Stephen L. Moshier Direct +Copyright 1984, 1991 by Stephen L. Moshier Direct +Copyright 1985, 1987 by Stephen L. Moshier Direct +Copyright 2007, 2010 Paul A. Bristow. Distributed +Copyright 2013, 2013 John Maddock, Anton Bikineev +Copyright 2019 - 2021 Alexander Grund Distributed +Copyright (c) 2010 David Fong and Michael Saunders +Copyright (c) 2006, Systems Optimization Laboratory +Copyright (c) 2007, John Travers <jtravs@gmail.com> +Copyright (c) 2010 - Jordi Gutierrez Hermoso Octave +Copyright Christopher Kormanyos 2013-14, 2020, 2024 +Copyright Paul A. Bristow & John Maddock 2009, 2010 +Copyright (c) 2006 Xiaogang Zhang, 2015 John Maddock +Copyright (c) 2006, The Regents of the University of +Copyright 1999, 2005, 2013 Hubert Holin. Distributed +Copyright 2006 John Maddock and Paul A. Bristow 2011 +Copyright 2015 Ontario Institute for Cancer Research +(c) Copyright Hubert Holin and Daryle Walker 2001-2002 +(c) Rasmus Munk Larsen, Stanford University, 2000,2004 +Copyright (C) 2022 Adam Lugowski. All rights reserved. +Copyright (C) 2023 Adam Lugowski. All rights reserved. +Copyright (c) 2002-2017 Free Software Foundation, Inc. +Copyright (c) 2010-2019 Free Software Foundation, Inc. +Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch> +Copyright 1984, 1987, 1988, 2000 by Stephen L. Moshier +Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier +Copyright 1984, 1987, 1989, 2000 by Stephen L. Moshier +Copyright 1984, 1987, 1992, 2000 by Stephen L. Moshier +(c) Rasmus Munk Larsen, Stanford University, 1999, 2004 +(c) Rasmus Munk Larsen, Stanford University, 2000, 2004 +Copyright (c) 2021 Orson Peters <orsonpeters@gmail.com> +Copyright (c) Donald Stufft and individual contributors +Copyright 1984, 1987, 1988 by Stephen L. Moshier Direct +Copyright 1984, 1987, 1989 by Stephen L. Moshier Direct +Copyright 1984, 1987, 1993 by Stephen L. Moshier Direct +Copyright 1985, 1987, 1989 by Stephen L. Moshier Direct +Copyright 2007, 2010, 2012 Paul A. Bristow. Distributed +copyright f'2008- date.today .year, The SciPy community +Copyright (c) 2012 Massachusetts Institute of Technology +Copyright (c) John Maddock & Paul A. Bristow 2007 - 2012 +Copyright 2002 H Lohninger, TU Wein H.Lohninger Teach/Me +Copyright 2014 Marco Guazzone (marco.guazzone@gmail.com) +(c) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469 +Copyright (c) 2006-2013 The University of Colorado Denver +Copyright 2006 Hubert Holin and John Maddock. Distributed +Copyright (c) 2006-2007, Robert Hetland <hetland@tamu.edu> +Copyright (c) 2021-2024, Tom M. Ragonneau and Zaikun Zhang +(c) 1995 Ernst Stadlober, Institut fuer Statistitk, TU Graz +Copyright (C) 2022-2023 Adam Lugowski. All rights reserved. +Copyright (c) 2000-2022 Wolfgang Hoermann and Josef Leydold +Copyright (c) 2005, Rasmus Munk Larsen, Stanford University +Copyright 2008, 2009 John Maddock, Paul A. Bristow and M.A. +Copyright 2011 Paul A. Bristow and Thomas Mang. Distributed +Copyright Daryle Walker, Hubert Holin and John Maddock 2006 +Copyright (c) 2002-2005, Jean-Sebastien Roy (js@jeannot.org) +Copyright (c) 2004-2005, Jean-Sebastien Roy (js@jeannot.org) +Copyright 1984, 1987, 1988, 1992, 2000 by Stephen L. Moshier +Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier +Copyright 2006 John Maddock and Paul A. Bristow. Distributed +Copyright 2007 John Maddock and Paul A. Bristow. Distributed +Copyright 2008 John Maddock and Paul A. Bristow. Distributed +Copyright 2010 John Maddock and Paul A. Bristow. Distributed +Copyright 2012 John Maddock and Paul A. Bristow. Distributed +Copyright 2014 John Maddock and Paul A. Bristow. Distributed +Copyright 2015 John Maddock and Paul A. Bristow. Distributed +Copyright (c) 2000-2013 The University of California Berkeley +Copyright 1984, 1987, 1988, 1992 by Stephen L. Moshier Direct +Copyright 1984, 1987, 1989, 1992 by Stephen L. Moshier Direct +Copyright (c) 1999, 2000, 2001 North Carolina State University +Copyright (c) 2010 David Fong and Michael Saunders Distributed +Copyright (c) Tyler Reddy, Richard Gowers, and Max Linke, 2016 +Copyright 2016-2021 Matthew Brett, Isuru Fernando, Matti Picus +Copyright (c) 2004 David M. Cooke <cookedm@physics.mcmaster.ca> +Copyright (c) 2004 Joel de Guzman http://spirit.sourceforge.net +Copyright (c) John Maddock and Paul A. Bristow 2009, 2010, 2012 +Copyright Daryle Walker, Hubert Holin, John Maddock 2006 - 2007 +Copyright John Maddock & Paul A. Bristow 2007, 2009, 2010, 2012 +(c) 2000 W. Hoermann & J. Leydold, Institut f. Statistik, WU Wien +(c) 2007 W. Hoermann & J. Leydold, Institut f. Statistik, WU Wien +Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology +Copyright (c) 2008, 2009, 2010, 2012 Paul A. Bristow, John Maddock +Copyright 2006, 2007 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2009 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2010 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2011 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2012 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2013 John Maddock and Paul A. Bristow. Distributed +Copyright 2007, 2010 John Maddock and Paul A. Bristow. Distributed +Copyright 2007, 2013 John Maddock and Paul A. Bristow. Distributed +Copyright 2008, 2009 John Maddock and Paul A. Bristow. Distributed +Copyright 2008, 2012 John Maddock and Paul A. Bristow. Distributed +Copyright 2010, 2012 John Maddock and Paul A. Bristow. Distributed +Copyright (c) 2001-2002 Enthought, Inc. 2003-2024, SciPy Developers +Copyright (c) 2007 Free Software Foundation, Inc. <http://fsf.org/> +Copyright (c) 2009 Free Software Foundation, Inc. <http://fsf.org/> +Copyright 2006 - 2010 John Maddock and Paul A. Bristow. Distributed +Copyright 2006 - 2012 John Maddock and Paul A. Bristow. Distributed +Copyright 2006 - 2013 John Maddock and Paul A. Bristow. Distributed +copyright 2014 Christopher Kormanyos, John Maddock, Paul A. Bristow +Copyright (c) 1996, 1997, 1998, 1999, 2000 Gerard Jungman, Brian Gough +Copyright 2006, 2007, 2010 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2007, 2012 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2010, 2011 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2010, 2012 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2010, 2015 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2012, 2015 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2012, 2017 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2015, 2018 John Maddock and Paul A. Bristow. Distributed +Copyright 2007, 2012, 2014 John Maddock and Paul A. Bristow. Distributed +Copyright (c) 1998-2000 Theodore C. Belding University of Michigan Center +Copyright (2022) National Technology & Engineering Solutions of Sandia, LLC +Copyright 2006 John Maddock, Paul A. Bristow and Xiaogang Zhang. Distributed +Copyright (c) 2021-04-21 Stefan van der Walt https://github.com/stefanv/lloyd +copyright A. Volgenant/Amsterdam School of Economics, University of Amsterdam +Copyright 2006, 2007, 2008, 2010 John Maddock and Paul A. Bristow. Distributed +Copyright 2006, 2010, 2013, 2014 John Maddock and Paul A. Bristow. Distributed +Copyright 2012 Benjamin Sobotta, John Maddock and Paul A. Bristow. Distributed +Copyright Thomas Dybdahl Ahle, Nick Thompson, Matt Borland, John Maddock, 2023 +Copyright 2023 Thomas Dybdahl Alhe, Nicholas Thompson, Matt Borland Distributed +Copyright 1998-2006 Liam Quinn. / Glyphs <http://www.unicode.org/charts/> of the +Copyright 2014 Christopher Kormanyos, John Maddock and Paul A. Bristow. Distributed +Copyright 1987-, A. Volgenant/Amsterdam School of Economics, University of Amsterdam +Copyright 2006, 2008, 2011 John Maddock, Johan Rade and Paul A. Bristow. Distributed +Copyright 2016 John Maddock, Paul A. Bristow, Thomas Luu, Nicholas Thompson. Distributed +Copyright 2013, 2014 Nikhar Agrawal, Christopher Kormanyos, John Maddock, Paul A. Bristow +Copyright 2008, 2010, 2012, 2013, 2014, 2015 John Maddock and Paul A. Bristow. Distributed +Copyright (c) 2018 Sylvain Gubian <sylvain.gubian@pmi.com> , Yang Xiang <yang.xiang@pmi.com> +Copyright 2006, 2013 John Maddock, Paul A. Bristow, Xiaogang Zhang and Christopher Kormanyos +Copyright (c) Tyler Reddy, Ross Hemsley, Edd Edmondson, Nikolai Nowaczyk, Joe Pitt-Francis, 2015 +Copyright 2013, 2014 Nikhar Agrawal, Christopher Kormanyos, John Maddock, Paul A. Bristow. Distributed +Copyright (c) 1992-2013 The University of Tennessee and The University of Tennessee Research Foundation +Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2015, 2016 John Maddock and Paul A. Bristow. Distributed +Copyright (c) 2003, The Regents of the University of California, through Lawrence Berkeley National Laboratory +Copyright (c) 2006, The Regents of the University of California, through Lawrence Berkeley National Laboratory +Copyright (c) 2017, The Chancellor, Masters and Scholars of the University of Oxford, and the Chebfun Developers +Copyright (c) 2008 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2009 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2010 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2003-2009, The Regents of the University of California, through Lawrence Berkeley National Laboratory +Copyright (c) 2000-2010 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2000-2022 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2008-2010 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2009-2010 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2009-2011 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2009-2012 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2011-2012 Wolfgang Hoermann and Josef Leydold Institute for Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2000-2006 Wolfgang Hoermann and Josef Leydold Dept. for Statistics, University of Economics, Vienna, Austria +Copyright (c) 2000-2006, 2010 Wolfgang Hoermann and Josef Leydold Department of Statistics and Mathematics, WU Wien, Austria +Copyright (c) 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Rade +copyright 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Rade, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker and Xiaogang Zhang + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +sentinels 1.0.0 - BSD-3-Clause + + +Copyright (c) 2011, Rotem Yaari <vmalloc@gmail.com> + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +setproctitle 1.3.4 - BSD-3-Clause + + +Copyright (c) 2000-2009, PostgreSQL Global Development Group +Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> +Copyright (c) 2009-2021 Daniele Varrazzo <daniele.varrazzo@gmail.com> +Copyright (c) 2010-2021 Daniele Varrazzo <daniele.varrazzo@gmail.com> +Copyright (c) 2011-2021 Daniele Varrazzo <daniele.varrazzo@gmail.com> +Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group +Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group +Copyright (c) 2009-2021, Daniele Varrazzo <daniele.varrazzo@gmail.com> +Portions Copyright (c) 1994, The Regents of the University of California + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +smmap 5.0.2 - BSD-3-Clause + + +Copyright (c) 2010, 2011 Sebastian Thiel and contributors + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +symfc 1.2.1 - BSD-3-Clause + + +Copyright (c) 2023, symfc project + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +webcolors 24.11.1 - BSD-3-Clause + + +copyright James Bennett and contributors +Copyright (c) James Bennett, and contributors + +Copyright (c) <year> <owner> . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +mp-api 0.43.0 - BSD-3-Clause AND BSD-3-Clause-LBNL + + +copyright 2022, The Materials Project +Copyright (c) 2017, The Regents of the University of California, through Lawrence Berkeley National Laboratory + +BSD-3-Clause AND BSD-3-Clause-LBNL + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyterlab-widgets 3.0.13 - BSD-3-Clause AND CC0-1.0 AND ISC AND MIT + + +Copyright (c) Felix Bohm +Copyright (c) 2014 Alex Bell +Copyright (c) 2019 Leon Gersen +Copyright 2010-2015 Mike Bostock +Copyright 2010-2021 Mike Bostock +Copyright 2010-2022 Mike Bostock +Copyright (c) 2014 Jameson Little +Copyright (c) Jupyter Development Team +Copyright (c) 2014-2017, Jon Schlinkert +Copyright (c) 2014 The cheeriojs contributors +Copyright JS Foundation and other contributors +Copyright (c) 2013, 2014, 2015 P'unk Avenue LLC +Copyright (c) 2015 Project Jupyter Contributors +Copyright (c) 2019 Project Jupyter Contributors +Copyright 2013 Andrey Sitnik <andrey@sitnik.ru> +Copyright 2017 Andrey Sitnik <andrey@sitnik.ru> +Copyright (c) 2014-2017, PhosphorJS Contributors +Copyright (c) Isaac Z. Schlueter and Contributors +Copyright OpenJS Foundation and other contributors +Copyright (c) 2010-2019 Jeremy Ashkenas, DocumentCloud +Copyright (c) 2013 Roman Shtylman <shtylman@gmail.com> +Copyright 2010, 2011, Chris Winberry <chris@winberry.net> +Copyright (c) 2012 James Halliday, Josh Duff, and other contributors +Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov +Copyright JS Foundation and other contributors, https://js.foundation +Copyright OpenJS Foundation and other contributors, https://openjsf.org +Copyright OpenJS Foundation and other contributors <https://openjsf.org/> +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +(c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Backbone +Copyright (c) 2009-2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> +Copyright (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors + +BSD-3-Clause AND CC0-1.0 AND ISC AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +altair 5.5.0 - BSD-3-Clause AND MIT + + +Copyright (c) 2015-2023, Vega-Altair Developers + +BSD-3-Clause AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyterlab 4.3.4 - BSD-3-Clause AND MIT + + +(c) Yqn (c) +(c) C Ofn (c) +(c) Sindre Sorhus +copyright Koen Bok +(c) 2011 Gary Court +Copyright 2021 Mapbox +(c) 2019 Denis Pushkarev +Copyright (c) 2017, Vega +Copyright (c) Felix Bohm +Copyright (c) 2016 podhmo +Copyright 2011 Gary Court +Copyright (c) 2017, Mapbox +Copyright (c) Font Awesome +Copyright 2019 Ron Buckton +Copyright Gaetan Renaudeau +Copyright (c) 2015 Treasure +Copyright 2021 Mike Bostock +(c) 2017-2021 Joachim Wester +(c) 2017-2022 Joachim Wester +Copyright (c) 2014 Alex Bell +Copyright (c) 2017 Braintree +Copyright 2001 Robert Penner +Copyright 2015 Ricky Reusser +Copyright 2015, Mike Bostock +Copyright (c) 2015 JD Ballard +Copyright (c) 2015 Josh Junon +Copyright (c) 2018 Chris Holt +Copyright (c) 2015 Dan Abramov +Copyright (c) 2015 David Clark +Copyright (c) 2022 Fadi Khadra +Copyright Node.js contributors +Copyright (c) 2014 Athan Reines +Copyright (c) 2015 Athan Reines +Copyright (c) Bloomberg Finance +Copyright (c) 2015 Dmitry Ivanov +Copyright (c) 2017 Martin Hansen +Copyright 2010-2021 Mike Bostock +Copyright 2010-2022 Mike Bostock +Copyright 2010-2023 Mike Bostock +Copyright 2013-2021 Mike Bostock +Copyright 2015-2016 Mike Bostock +Copyright 2016-2021 Mike Bostock +(c) Cure53 and other contributors +Copyright (c) 2012 Heather Arthur +Copyright (c) 2013 James Halliday +Copyright (c) 2015 Shusaku Uesugi +Copyright (c) 2011 Fabrice Bellard +Copyright (c) 2015, Rebecca Turner +Copyright 2008-2012 Charles Karney +Copyright (c) 2016 Adele Delamarche +Copyright (c) 2017 Dmitry Soshnikov +Copyright (c) 2018 Tamino Martinius +Copyright (c) Microsoft Corporation +Copyright 2012-2019 Michael Bostock +(c) 2016-present Alexander Kuznetsov +Copyright (c) 2014-2015 Athan Reines +Copyright (c) 2017 Evgeny Poberezkin +Copyright (c) 2020 Evgeny Poberezkin +Copyright 2018-2021 Observable, Inc. +Copyright (c) 2015-2021 Martin Hensel +Copyright (c) 2015-present Evan Jacobs +Copyright (c) 2016 Alexander Kuznetsov +Copyright (c) Jupyter Development Team +Copyright (c) 2014 The xterm.js authors +Copyright (c) 2014-2016, Jon Schlinkert +Copyright (c) 2014-2017, Jon Schlinkert +Copyright (c) 2015-2018, Jon Schlinkert +Copyright (c) 2016 typestyle Permission +Copyright (c) 2021 @markedjs Permission +Copyright (c) Font Awesome Font Awesome +Copyright (c) 2016-present Sultan Tarimo +Copyright (c) 2014 - 2022 Knut Sveidqvist +Copyright (c) 2015-2021 Evgeny Poberezkin +Copyright (c) 2014-present, Jon Schlinkert +Copyright (c) 2015-present, Jon Schlinkert +Copyright (c) 2019 iVis@Bilkent Permission +Copyright (c) 2013, 2014, 2020 Joachim Wester +Copyright (c) 2014 The cheeriojs contributors +Copyright (c) 2018-present, iamkun Permission +Copyright (c) 2015 Unshift.io, Arnout Kazemier +Copyright JS Foundation and other contributors +copyright year in About JupyterLab and LICENSE +Copyright (c) 2013, 2014, 2015 P'unk Avenue LLC +Copyright (c) Facebook, Inc. and its affiliates +Copyright 2013 Andrey Sitnik <andrey@sitnik.ru> +Copyright 2017 Andrey Sitnik <andrey@sitnik.ru> +Copyright 2024 Dr.-Ing. Mario Heiderich, Cure53 +Copyright (c) 2014-2017, PhosphorJS Contributors +Copyright (c) 2012-2018 Aseem Kishore, and others +Copyright (c) 2016-2018, The Cytoscape Consortium +Copyright (c) 2016-2023, The Cytoscape Consortium +Copyright (c) Isaac Z. Schlueter and Contributors +Copyright Joyent, Inc. and other Node contributors +Copyright (c) 2015, Dan Flettre <fletd01@yahoo.com> +Copyright (c) 2011-2015 Paul Vorbach <paul@vorba.ch> +Copyright (c) 2015-2024 Project Jupyter Contributors +Copyright 2016 Interactive Data Lab and contributors +Copyright (c) 2013 Roman Shtylman <shtylman@gmail.com> +Copyright (c) 2019 - present, iVis@Bilkent. Permission +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) +Copyright (c) 2014, 2016, 2017, 2019, 2021 Simon Lydell +Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com> +Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com> +Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com> +Copyright (c) 2021 Titus Wormer <tituswormer@gmail.com> +Copyright (c) 2011 Heather Arthur <fayearthur@gmail.com> +Copyright (c) 2004, John Gruber http://daringfireball.net +Copyright (c) 2019-present Fabio Spampinato, Andrew Maney +Copyright 2010, 2011, Chris Winberry <chris@winberry.net> +Copyright (c) 2020 by Marijn Haverbeke <marijnh@gmail.com> +Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com> +Copyright (c) 2020 Kevin Jahns <kevin.jahns@protonmail.com> +Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io) +Copyright (c) 2010-2020 Robert Kieffer and other contributors +Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com> +Copyright (c) 2015, University of Washington Interactive Data Lab +Copyright (c) 2016, University of Washington Interactive Data Lab +Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com) +Marked Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/) +Copyright (c) 2012 James Halliday, Josh Duff, and other contributors +Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) +Copyright (c) 2014-present Sebastian McKenzie and other contributors +Copyright (c) 2016 by Marijn Haverbeke <marijnh@gmail.com> and others +Copyright (c) 2018 by Marijn Haverbeke <marijnh@gmail.com> and others +Copyright (c) 2015-2023, University of Washington Interactive Data Lab +Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/) +Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/) +Copyright jQuery Foundation and other contributors <https://jquery.org/> +Copyright OpenJS Foundation and other contributors <https://openjsf.org/> +Copyright (c) 2018-2021 by Marijn Haverbeke <marijnh@gmail.com> and others +Copyright (c) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others +Copyright (c) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin> and others +Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov +Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js) +Copyright (c) 2018, The xterm.js authors (https://github.com/xtermjs/xterm.js) +Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js) +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) +Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com) +Copyright (c) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others +Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js) +Copyright 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University +Copyright (c) 2014 - Kevin Jahns <kevin.jahns@rwth-aachen.de> - Chair of Computer Science +Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) https://github.com/chjj/term.js +Copyright (c) 2011-2015 Jan Lehnardt <jan@apache.org> & Marc Bachmann <https://github.com/marcbachmann> +copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> +Copyright (c) 2020 by Marijn Haverbeke <marijnh@gmail.com> , Arun Srinivasan <rulfzid@gmail.com> , and others + +BSD-3-Clause AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyterlab-pygments 0.3.0 - BSD-3-Clause AND MIT + + +Copyright (c) Jupyter Development Team +Copyright JS Foundation and other contributors +Copyright (c) 2015 Project Jupyter Contributors + +BSD-3-Clause AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +jupyterlab-server 2.27.3 - BSD-3-Clause AND MIT + + +copyright 2021, Project Jupyter +Copyright (c) Jupyter Development Team +Copyright (c) 2015-2017, Project Jupyter Contributors + +BSD-3-Clause AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +phonopy 2.34.0 - BSD-3-Clause AND MIT + + +Copyright (c) 2020 +(c) elsi-interchange.org +Copyright (c) 2022 Yuyang Ji +Copyright (c) 2008 Atsushi Togo +Copyright (c) 2010 Atsushi Togo +Copyright (c) 2011 Atsushi Togo +Copyright (c) 2012 Atsushi Togo +Copyright (c) 2013 Atsushi Togo +Copyright (c) 2014 Atsushi Togo +Copyright (c) 2015 Atsushi Togo +Copyright (c) 2016 Atsushi Togo +Copyright (c) 2018 Atsushi Togo +Copyright (c) 2019 Atsushi Togo +Copyright (c) 2020 Atsushi Togo +Copyright (c) 2021 Atsushi Togo +Copyright (c) 2022 Atsushi Togo +Copyright (c) 2023 Atsushi Togo +Copyright (c) 2024 Atsushi Togo +copyright (c) 2013 Atsushi Togo +Copyright (c) 2014-2024, Phonopy +Copyright (c) 2024 Florian Knoop +Copyright (c) 1998-2014 ABINIT group +Copyright (c) 2017-2019 Tiziano Muller +Copyright (c) 2021 Alexander Neukirchen +Copyright (c) 2009-2011 Joerg Meyer (jm) +Copyright by Oldenburg Wissenshaftverlag +Copyright (c) 2018 TURBOMOLE GmbH, Karlsruhe +Copyright (c) 2015 Henrique Pereira Coutada Miranda +Copyright (c) 2018 Antti Karttunen (antti.j.karttunen@iki.fi) +Copyright (c) 2016 Antti J. Karttunen (antti.j.karttunen@iki.fi) +Copyright (c) 2019 Antti J. Karttunen (antti.j.karttunen@iki.fi) + +BSD-3-Clause AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +maggma 0.71.1 - BSD-3-Clause-LBNL AND CAL-1.0 + + +Copyright (c) 2017, The Regents of the University of California, through Lawrence Berkeley National Laboratory + +BSD-3-Clause-LBNL AND CAL-1.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +matscipy 1.1.1 - CAL-1.0 AND LGPL-2.1-only + + +Copyright 2016 Punit Patel +Copyright 2021 Jan Griesser +Copyright 2022 Lucas Frerot +Copyright 2014 James Kermode +Copyright 2015 James Kermode +Copyright 2015 Lars Pastewka +Copyright 2016 James Kermode +Copyright 2016 Lars Pastewka +Copyright 2017 Lars Pastewka +Copyright 2020 James Kermode +Copyright 2021 Lars Pastewka +Copyright 2022 Lars Pastewka +Copyright (c) 2008, Dan Wilson +Copyright 2023 Andreas Klemenz +Copyright 2018-2021 Jan Griesser +Copyright 2020 Johannes Hoermann +Copyright 2020-2021 Jan Griesser +Copyright 2014-2015 James Kermode +Copyright 2014-2015 Lars Pastewka +Copyright 2020-2021 James Kermode +Copyright 2020-2021 Lars Pastewka +Copyright 2014, 2018 James Kermode +Copyright 2014, 2020 James Kermode +Copyright 2014, 2020 Lars Pastewka +Copyright 2014, 2021 Lars Pastewka +Copyright 2015, 2017 Lars Pastewka +Copyright 2015, 2021 Lars Pastewka +Copyright 2016, 2021 Lars Pastewka +Copyright 2019, 2021 Lars Pastewka +Copyright 2019-2020 Johannes Hoermann +Copyright 2018-2019, 2021 Jan Griesser +Copyright 2019-2020 Wolfram G. Nohring +Copyright 2014, 2020-2021 Lars Pastewka +Copyright 2014-2015, 2020 Lars Pastewka +Copyright 2014-2015, 2021 Lars Pastewka +Copyright 2014-2016, 2021 Lars Pastewka +Copyright 2014-2017, 2021 Lars Pastewka +Copyright 2015, 2020-2021 Lars Pastewka +Copyright 2015-2016, 2020 James Kermode +Copyright 2015-2017, 2021 Lars Pastewka +Copyright 2016, 2020-2021 Lars Pastewka +Copyright 2016-2019, 2021 Lars Pastewka +Copyright 2018, 2020-2021 Petr Grigorev +Copyright 2015, 2017, 2021 Lars Pastewka +Copyright 2016-2017, 2020 Andreas Klemenz +Copyright 2016-2017, 2023 Andreas Klemenz +copyrighted by the Free Software Foundation +Copyright 2014-2015, 2017-2021 Lars Pastewka +Copyright 2014-2015, 2020-2021 Lars Pastewka +Copyright 2014-2015, 2017, 2021 Lars Pastewka +Copyright 2015, 2017, 2020-2021 Lars Pastewka +copyright u'2023, James Kermode, Lars Pastewka +Copyright 2014-2015, 2017, 2019-2021 Lars Pastewka +Copyright 2014-2015, 2017, 2020-2021 Lars Pastewka +Copyright 2014-2015, 2017-2019, 2021 Lars Pastewka +Copyright 2019 IMTEK Simulation University of Freiburg +Copyright 2020 IMTEK Simulation University of Freiburg +Copyright (c) 1991, 1999 Free Software Foundation, Inc. +Copyright (2020) Johannes Hormann, University of Freiburg +Copyright (2019) Johannes Hoermann, University of Freiburg +Copyright 2019, 2020 IMTEK Simulation University of Freiburg +Copyright (2014) James Kermode, King's College London Lars Pastewka, Karlsruhe Institute of Technology +Copyright (2014-2017) James Kermode, Warwick University Lars Pastewka, Karlsruhe Institute of Technology +Copyright (2014) James Kermode, King's College London Lars Pastewka, Karlsruhe Institute of Technology Adrien Gola, Karlsruhe Institute of Technology + +CAL-1.0 AND LGPL-2.1-only + +--------------------------------------------------------- + +--------------------------------------------------------- + +pylint 3.3.3 - CC-BY-4.0 AND CC-BY-SA-4.0 AND GPL-2.0-only AND GPL-2.0-or-later + + +copyrighted by the Free Software Foundation +Copyright (c) 1989, 1991 Free Software Foundation, Inc. +Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt + +CC-BY-4.0 AND CC-BY-SA-4.0 AND GPL-2.0-only AND GPL-2.0-or-later + +--------------------------------------------------------- + +--------------------------------------------------------- + +ase 3.24.0 - GPL-2.0 AND GPL-2.0-only AND LGPL-2.1-only AND LGPL-2.1-or-later + + +Copyright (c) 2018 ASE +Copyright (c) 2020 ASE +Copyright (c) 2022 ASE +Copyright (c) 2003 CAMP +Copyright (c) 2003-2016 +Copyright (c) 2011-2012 +Copyright (c) 2011-2022 ASE +Copyright (c) 2012-2019 ASE +Copyright (c) 2016-2017 ASE +Copyright (c) 2018-2022 ASE +Copyright (c) 2019-2021 ASE +Copyright (c) 2007-2017 CAMd +Copyright (c) 2008 Atsushi Togo +Copyright (c) 2017 CAMD and ASE +Copyright (c) 2010, Jesper Friis +Copyright (c) , 2002-2014, T. Ozaki +Copyright (c) 2000 - 2023 Distributed +Copyright (c) 2024, Rohit Goswami, UI +Copyright 2008, 2009 CAMd see accompanying +copyrighted by the Free Software Foundation +Copyright (c) 2012-2023, Jesper Friis, SINTEF +Copyright (c) 2018 JaeHwan Shim and JaeJun Yu +Copyright (c) 2018 Jae Hwan Shim and JaeJun Yu +Copyright (c) 2008 CSC - Scientific Computing Ltd. +Copyright (c) 1989, 1991 Free Software Foundation, Inc. +Copyright (c) 1991, 1999 Free Software Foundation, Inc. +Copyright (c) 2009 - 2011 Joerg Meyer, joerg.meyer@ch.tum.de +T. Demeyere, T.Demeyere@soton.ac.uk (2023) https://onetep.org +Copyright (c) 2017 Charles Thomas Johnson, JaeHwan Shim and JaeJun Yu +Copyright (c) 2017 Charles Thomas Johnson, Jae Hwan Shim and JaeJun Yu + +GPL-2.0 AND GPL-2.0-only AND LGPL-2.1-only AND LGPL-2.1-or-later + +--------------------------------------------------------- + +--------------------------------------------------------- + +dnspython 2.7.0 - ISC + + +Copyright (c) Google Inc. +Copyright (c) 2011 Nominum, Inc. +Copyright (c) 2014 Red Hat, Inc. +Copyright (c) 2015 Red Hat, Inc. +Copyright (c) 2016 Nominum, Inc. +Copyright (c) Dnspython Contributors +Copyright (c) 2001-2017 Nominum, Inc. +Copyright (c) 2003-2017 Nominum, Inc. +Copyright (c) 2004-2017 Nominum, Inc. +Copyright (c) 2006-2017 Nominum, Inc. +Copyright (c) 2009-2011 Nominum, Inc. +Copyright (c) 2009-2017 Nominum, Inc. +Copyright (c) 2012-2017 Nominum, Inc. +Copyright (c) 2016 Coresec Systems AB +Copyright (c) 2010, 2011 Nominum, Inc. +Copyright (c) 2001-2007, 2009-2011 Nominum, Inc. +Copyright (c) 2003-2007, 2009-2011 Nominum, Inc. +Copyright (c) 2004-2007, 2009-2011 Nominum, Inc. +Copyright (c) 2005-2007, 2009-2011 Nominum, Inc. +Copyright (c) 2003-2007, 2009, 2011 Nominum, Inc. +Copyright (c) 2006, 2007, 2009-2011 Nominum, Inc. +(c) 2009 Dennis Kaarsemaker <dennis@kaarsemaker.net> +Copyright (c) 2000, 2001 Internet Software Consortium +Copyright (c) 2004-2007, 2009-2011, 2016 Nominum, Inc. + +ISC License + +Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") + +Copyright (c) 1995-2003 by Internet Software Consortium + +Permission to use, copy, modify, and /or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +isoduration 20.11.0 - ISC + + +Copyright (c) 2020 Victor Munoz <victorm@marshland.es> + +ISC License + +Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") + +Copyright (c) 1995-2003 by Internet Software Consortium + +Permission to use, copy, modify, and /or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pexpect 4.9.0 - ISC + + +copyright u'2013, Noah Spurrier and contributors +Copyright (c) 2012, Noah Spurrier <noah@noah.org> +Copyright (c) 2013-2014, Pexpect development team +Copyright (c) 2013-2016, Pexpect development team +Copyright (c) 2016, Martin Packman <martin.packman@canonical.com> + +ISC License + +Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") + +Copyright (c) 1995-2003 by Internet Software Consortium + +Permission to use, copy, modify, and /or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +ptyprocess 0.7.0 - ISC + + +copyright u'2014, Thomas Kluyver +Copyright (c) 2012, Noah Spurrier <noah@noah.org> +Copyright (c) 2013-2014, Pexpect development team + +ISC License + +Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") + +Copyright (c) 1995-2003 by Internet Software Consortium + +Permission to use, copy, modify, and /or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +astroid 3.3.8 - LGPL-2.1-only AND LGPL-2.1-or-later + + +copyrighted by the Free Software Foundation +Copyright (c) 1991, 1999 Free Software Foundation, Inc. +Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt + +LGPL-2.1-only AND LGPL-2.1-or-later + +--------------------------------------------------------- + +--------------------------------------------------------- + +charset-normalizer 3.4.1 - LGPL-2.1-only AND MIT AND MPL-1.1 + + +COPYRIGHT (c) FOOBAR +copyright 2023, Ahmed TAHRI +Copyright (c) 2025 Ahmed TAHRI +Copyright (c) 2025 TAHRI Ahmed R. +copyright (c) 2021 by Ahmed TAHRI +(c) 2012 Denny Vrandecic (http://simia.net/letters/) +Copyright (c) Ahmed TAHRI @Ousret (https://github.com/Ousret) +(c) https://stackoverflow.com/questions/3041986/apt-command-line-interface-like-yes-no-input + +LGPL-2.1-only AND MIT AND MPL-1.1 + +--------------------------------------------------------- + +--------------------------------------------------------- + +paramiko 3.5.0 - LGPL-2.1-or-later + + +(c) 2024 Jeff Forcier +copyright 2024 Jeff Forcier +Copyright 2007-2023 by the Sphinx team +(c) JS Foundation and other contributors +copyrighted by the Free Software Foundation +Copyright (c) 2013-2014 science + computing ag +Copyright JS Foundation and other contributors +Copyright (c) 2010 Sofian Brabez <sbz@6dev.net> +Copyright (c) 2012 Olle Lundberg <geek@nerd.sh> +Copyright (c) 2012 Yipit, Inc <coders@yipit.com> +Copyright (c) 2022 Patrick Spendrin <ps_ml@gmx.de> +copyright https://docs.python.org/3.6/copyright.html +Copyright (c) 2021 Lew Gordon <lew.gordon@genesys.com> +Copyright (c) 1991, 1999 Free Software Foundation, Inc. +Copyright (c) 2008 Robey Pointer <robeypointer@gmail.com> +Copyright (c) 2013 Torsten Landschoff <torsten@debian.org> +Copyright (c) 2003-2007 John Rochester <john@jrochester.org> +Copyright (c) 2019 Edgar Sousa <https://github.com/edgsousa> +Copyright (c) 2003-2006 Robey Pointer <robeypointer@gmail.com> +Copyright (c) 2003-2007 Robey Pointer <robeypointer@gmail.com> +Copyright (c) 2003-2008 Robey Pointer <robeypointer@gmail.com> +Copyright (c) 2003-2009 Robey Pointer <robeypointer@gmail.com> +Copyright (c) 2003-2011 Robey Pointer <robeypointer@gmail.com> +Copyright (c) 2005 John Arbash-Meinel <john@arbash-meinel.com> +Copyright (c) 2006-2007 Robey Pointer <robeypointer@gmail.com> +(c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors Underscore + +GNU LESSER GENERAL PUBLIC LICENSE + +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. + +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + + Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + + You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + + In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + + e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + + It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + + If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + + It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Libraries + +If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). + +To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + +<one line to give the library's name and an idea of what it does.> + +Copyright (C) <year> <name of author> + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in + +the library `Frob' (a library for tweaking knobs) written + +by James Random Hacker. + +< signature of Ty Coon > , 1 April 1990 + +Ty Coon, President of Vice + +That's all there is to it! + +--------------------------------------------------------- + +--------------------------------------------------------- + +azure-identity 1.19.0 - LicenseRef-scancode-generic-cla AND MIT + + +Copyright (c) Microsoft Corporation + +LicenseRef-scancode-generic-cla AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +azure-storage-blob 12.24.0 - LicenseRef-scancode-generic-cla AND MIT + + +Copyright (c) Microsoft Corporation + +LicenseRef-scancode-generic-cla AND MIT + +--------------------------------------------------------- + +--------------------------------------------------------- + +pillow 11.1.0 - LicenseRef-scancode-secret-labs-2011 AND MIT-CMU + + +(c) Tavmjung Bah +Copyright 2020 Google LLC +Copyright 2014 Google Inc. +Copyright 2016 Google Inc. +copyright 2010-2011, Google +Copyright (c) 2018 Google LLC +Copyright (c) 2013 Eric Soroos +Copyright (c) 2020 by Pan Jing +Copyright (c) Eric Soroos 2016 +Copyright (c) Eric Soroos 2017 +Copyright (c) 2011 Google, Inc. +Copyright (c) 2002-2017, and GNU +Copyright (c) 2009 Fredrik Lundh +Copyright (c) Fredrik Lundh 1994 +Copyright (c) Fredrik Lundh 1995 +Copyright (c) Fredrik Lundh 1996 +Copyright (c) Fredrik Lundh 1997 +Copyright (c) Fredrik Lundh 1999 +Copyright (c) Fredrik Lundh 2009 +Copyright (c) 2004 by Secret Labs +Copyright (c) 2013 by Eric Soroos +Copyright (c) Secret Labs AB 1997 +Copyright (c) Secret Labs AB 1998 +Copyright (c) Secret Labs AB 1999 +Copyright (c) Secret Labs AB 2002 +Copyright (c) Secret Labs AB 2008 +Copyright 2008 The Bungee Project +Copyright (c) 2004 by Bob Ippolito +Copyright (c) 2006 by Tavmjong Bah +Copyright (c) Mickael Bonfill 2017 +Copyright (c) 1995 by Fredrik Lundh +Copyright (c) 1996 by Fredrik Lundh +Copyright (c) 1997 by Fredrik Lundh +Copyright (c) 1998-2001 Marti Maria +Copyright (c) 2002 by Fredrik Lundh +Copyright (c) 2003 by Fredrik Lundh +Copyright (c) 2004 by Fredrik Lundh +Copyright (c) 2005 by Fredrik Lundh +Copyright (c) 2006 by Fredrik Lundh +Copyright (c) 2009 by Fredrik Lundh +Copyright (c) 2012 by Brian Crowell +Copyright (c) Fredrik Lundh 1995-96 +Copyright (c) Fredrik Lundh 1995-97 +Copyright (c) Fredrik Lundh 1996-97 +Copyright (c) 1998 by Secret Labs AB +Copyright (c) 2002 by Kevin B. Kenny +Copyright (c) 2002 by Secret Labs AB +Copyright (c) 2003 by Secret Labs AB +Copyright (c) 2004 by William Baxter +Copyright (c) 2014 Alastair Houghton +Copyright (c) Secret Labs AB 1997-98 +Copyright (c) Secret Labs AB 1997-99 +Copyright (c) 1996-2000 Fredrik Lundh +Copyright (c) 1997 by Secret Labs AB. +Copyright (c) 1998 by Toby J Sargeant +Copyright (c) 1999 by Secret Labs AB. +Copyright (c) 2002-2003 Kevin Cazabon +Copyright (c) 2003 by Bitstream, Inc. +Copyright (c) 2004 by Secret Labs AB. +Copyright (c) 2006 by Secret Labs AB. +Copyright (c) 2016 by Mickael Bonfill +Copyright (c) Fredrik Lundh 1995-1997 +Copyright (c) Fredrik Lundh 1995-2003 +Copyright (c) Fredrik Lundh 1996-2001 +Copyright (c) Fredrik Lundh 1996-2003 +Copyright (c) Fredrik Lundh 1997-2004 +Copyright (c) 1987 Adobe Systems, Inc. +Copyright (c) 1995-96 by Fredrik Lundh +Copyright (c) 1998-2000 Secret Labs AB +Copyright (c) Secret Labs AB 1997-2001 +Copyright (c) Secret Labs AB 1997-2002 +Copyright (c) Secret Labs AB 1997-2003 +Copyright (c) Secret Labs AB 1997-2004 +Copyright (c) Secret Labs AB 1997-2005 +Copyright (c) Secret Labs AB 2002-2004 +Copyright (c) 2008 by Karsten Hiddemann +Copyright (c) 2014 by Alastair Houghton +copyright (c) 1991-1995, Thomas G. Lane +Copyright (c) 1995-1996 by Fredrik Lundh +Copyright (c) 1995-1997 by Fredrik Lundh +Copyright (c) 1995-2001 by Fredrik Lundh +Copyright (c) 1995-2002 by Fredrik Lundh +Copyright (c) 1995-2003 by Fredrik Lundh +Copyright (c) 1995-2004 by Fredrik Lundh +Copyright (c) 1995-2005 by Fredrik Lundh +Copyright (c) 1995-2006 by Fredrik Lundh +Copyright (c) 1995-2009 by Fredrik Lundh +Copyright (c) 1996-1997 by Fredrik Lundh +Copyright (c) 1996-2000 by Fredrik Lundh +Copyright (c) 1996-2003 by Fredrik Lundh +Copyright (c) 1996-2004 by Fredrik Lundh +Copyright (c) 1996-2006 by Fredrik Lundh +Copyright (c) 1997-1998 by Fredrik Lundh +Copyright (c) 1997-2003 by Fredrik Lundh +Copyright (c) 1997-2005 by Fredrik Lundh +Copyright (c) 1997-98 by Secret Labs AB. +Copyright (c) 1997-99 by Secret Labs AB. +Copyright (c) 1998-2003 by Fredrik Lundh +Copyright (c) 2000-2003 by Fredrik Lundh +Copyright (c) 2001-2002 by Fredrik Lundh +Copyright (c) 2001-2004 by Fredrik Lundh +Copyright (c) 2002-2004 by Fredrik Lundh +Copyright (c) 2003-2005 by Fredrik Lundh +Copyright 1984, 1987 Adobe Systems, Inc. +Copyright 2018 by Jack Halten Fahnestock +Copyright (c) 1995-2001 by Secret Labs AB +Copyright (c) 1997-1998 by Secret Labs AB +Copyright (c) 1997-1999 by Secret Labs AB +Copyright (c) 1997-2000 by Secret Labs AB +Copyright (c) 1997-2011 by Secret Labs AB +Copyright (c) 1998-2005 by Secret Labs AB +Copyright (c) 1998-2007 by Secret Labs AB +Copyright (c) 1999-2005 by Secret Labs AB +Copyright (c) 2001-2002 by Secret Labs AB +Copyright (c) 2001-2004 by Secret Labs AB +Copyright (c) 2002-2004 by Secret Labs AB +Copyright (c) 2003-2005 by Secret Labs AB +Copyright (c) 2015 Information Technology +Copyright (c) 2018 Dimitar Toshkov Zhekov +Copyright (c) 1997-2001 by Secret Labs AB. +Copyright (c) 1997-2002 by Secret Labs AB. +Copyright (c) 1997-2003 by Secret Labs AB. +Copyright (c) 1997-2004 by Secret Labs AB. +Copyright (c) 1997-2005 by Secret Labs AB. +Copyright (c) 1997-2006 by Secret Labs AB. +Copyright (c) 1997-2009 by Secret Labs AB. +Copyright (c) 1998-2003 by Secret Labs AB. +Copyright (c) 1998-2004 by Secret Labs AB. +Copyright (c) 2004 by Health Research Inc. +Copyright (c) 1993-1996 Lucent Technologies +Copyright (c) 1997-2007 Adobe Systems, Inc. +Copyright (c) 2000-2006 Adobe Systems, Inc. +Copyright (c) 2014 Coriolis Systems Limited +Copyright 2007 International Color Consortium +Copyright (c) 1994-1998 Sun Microsystems, Inc. +Copyright (c) 2014 by Coriolis Systems Limited +Copyright 1987-2001 Adobe Systems Incorporated +Copyright 1987-2004 Adobe Systems Incorporated +Copyright 1987-2006 Adobe Systems Incorporated +Copyright 1997-2006 Adobe Systems Incorporated +Copyright International Color Consortium, 2009 +Portions Copyright 1988 Digital Equipment Corp +Copyright (c) 1998-2000 by Scriptics Corporation +Copyright (c) 2020 Free Software Foundation, Inc. +Copyright (c) 2016 Marcin Kurczewski <rr-@sakuya.pl> +Portions Copyright 1988 Digital Equipment Corporation +Copyright (c) 2010 Oliver Tonnhofer <olt@bogosoft.com> +Copyright (c) 2010 by Jeffrey A. Clark and contributors +Copyright (c) 2014 Dov Grobgeld <dov.grobgeld@gmail.com> +Copyright Contributors to the pythoncapi_compat project. +Copyright (c) 1995-2011 by Fredrik Lundh and contributors +Copyright (c) 2018 Roel Nieskens, https://pixelambacht.nl +Copyright (c) 2016-2023 Khaled Hosny <khaled@aliftype.com> +copyright 2003 kevin_cazabon@hotmail.com kevin@cazabon.com +Portions copyright 2015, Khaled Hosny <khaledhosny@eglug.org> +Copyright (c) 1987-1994 The Regents of the University of California +Copyright 2002, 2003, 2005, 2008, 2009, 2010, 2012 GNU Freefont contributors +Copyright 2014, 2015 Adobe Systems Incorporated (http://www.adobe.com/).Noto +Copyright (c) 2002-2003 Kevin Cazabon kevin@cazabon.com https://www.cazabon.com +Portions copyright 1997, 2009, 2011 American Mathematical Society <http://www.ams.org> +copyright 1995-2011 Fredrik Lundh and contributors, 2010 Jeffrey A. Clark and contributors +Copyright 2002, 2003, 2005, 2008, 2009, 2010, 2012 GNU Freefont contributors. FreeMono FreeMono +copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation +Copyright 2016 Adobe (http://www.adobe.com/).Adobe Variable Font PrototypeRegular1.004 ADBO AdobeVFPrototype-Default + +LicenseRef-scancode-secret-labs-2011 AND MIT-CMU + +--------------------------------------------------------- + +--------------------------------------------------------- + +aioitertools 0.12.0 - MIT + + +Copyright 2022 Amethyst Reese +Copyright (c) 2022 Amethyst Reese +copyright Amethyst Reese (https://noswap.com) + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +annotated-types 0.7.0 - MIT + + +Copyright (c) 2022 the contributors + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +anyio 4.8.0 - MIT + + +Alex Gronholm copyright 2018 +Copyright (c) 2018 Alex Gronholm + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +argon2-cffi 23.1.0 - MIT + + +Copyright (c) 2015 +Copyright (c) 2015 " + __author +copyright 2015, Hynek Schlawack +Copyright (c) 2015 Hynek Schlawack + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +argon2-cffi-bindings 21.2.0 - MIT + + +Copyright (c) 2015 Thomas Pornin +copyright (c) 2015 Thomas Pornin +Copyright (c) 2021 Hynek Schlawack +copyright (c) Samuel Neves, 2013-2015 +Copyright (c) 2001-2015 by Michael Shell +Copyright 2015 Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves +Copyright (c) 1993-2000 by Gerry Murray, Silvano Balemi, Jon Dixon, Peter N'uchter, Juergen von Hagen +copyright (c) 2015 Daniel Dinu, Dmitry Khovratovich (main authors), Jean-Philippe Aumasson and Samuel Neves + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +async-lru 2.0.4 - MIT + + +Copyright (c) 2017 Ocean S. A. https://ocean.io +Copyright (c) 2018 aio-libs team https://github.com/aio-libs +Copyright (c) 2016-2017 WikiBusiness Corporation http://wikibusiness.org + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +attrs 24.3.0 - MIT + + +(c) N Revealed +Copyright (c) 2015 Hynek Schlawack + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +autopep8 2.3.1 - MIT + + +Copyright (c) 2010-2011 Hideo Hattori +Copyright (c) 2011-2013 Hideo Hattori, Steven Myint +Copyright (c) 2006-2009 Johann C. Rocholl <johann@rocholl.net> +Copyright (c) 2013-2016 Hideo Hattori, Steven Myint, Bill Wendling +Copyright (c) 2009-2013 Florent Xicluna <florent.xicluna@gmail.com> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +azure-core 1.32.0 - MIT + + +Copyright (c) Microsoft Corporation + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +beautifulsoup4 4.12.3 - MIT + + +Copyright (c) Isaac Muse +Copyright (c) Leonard Richardson +copyright u'2012, Leonard Richardson +(c) Copyright 2012, Leonard Richardson +(c) Copyright 2013, Leonard Richardson +Copyright 2007-2016 by the Sphinx team +copyright u'2004-2015, Leonard Richardson +copyright u'2004-2020, Leonard Richardson +copyright u'2004-2023, Leonard Richardson +copyright u'2004-2024, Leonard Richardson +Copyright (c) 2004-2024 Leonard Richardson +Copyright (c) James Graham and other contributors + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +blinker 1.9.0 - MIT + + +Copyright 2010 Jason Kirtland +copyright 2010 Jason Kirtland + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +cachetools 5.5.0 - MIT + + +copyright 2014-2024 Thomas Kemmer +Copyright (c) 2014-2024 Thomas Kemmer + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +cffi 1.17.1 - MIT + + +Copyright (c) 2002 Bo Thorsen +Copyright (c) 2002 Roger Sayle +Copyright (c) 2001 John Beniton +Copyright (c) 1996 Red Hat, Inc. +Copyright (c) 2002 Ranjit Mathew +Copyright (c) 1996-2003 Red Hat, Inc. +Copyright (c) 1996, 1998 Red Hat, Inc. +Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. +Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. +Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. +Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. +Copyright (c) 2011, 2014, 2019, 2021 Anthony Green +copyright u'2012-2018, Armin Rigo, Maciej Fijalkowski + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +custodian 2024.10.16 - MIT + + +Copyright (c) 2011-2012 +Copyright (c) Materials Virtual Lab +Copyright 2012, The Materials Project +Copyright 2018, The Materials Project +Copyright 2020, The Materials Project + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +debugpy 1.8.11 - MIT + + +Copyright (c) 2016 Red Hat +Copyright Brainwy Software +Copyright (c) 2012, Ben Hoyt +Copyright (c) Yuli Fitterman +Copyright Brainwy Software Ltda +copyright Brainwy Software Ltda +copyright Brainwy software Ltda +copyright Microsoft Corporation +Copyright (c) Brainwy software Ltda +Copyright (c) Microsoft Corporation +Copyright (c) 2009-2014, Mario Vilas +Copyright (c) 2009-2012 Pierre Raybaut +Copyright (c) 1999-2002 by Fredrik Lundh +Copyright (c) 1999-2002 by Secret Labs AB +Copyright (c) 2010-2014 Benjamin Peterson +Copyright (c) 2010-2018 Benjamin Peterson +Copyright (c) 2011 The IPython Development Team +Copyright (c) 2012, the IPython Development Team +Copyright (c) 2008-2010, IPython Development Team +Copyright (c) 2006-2010 Python Software Foundation +Copyright (c) 2001, Janko Hauser <jhauser@zscout.de> +Copyright (c) 2008-2011 The IPython Development Team +Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu> +Copyright (c) 1995-2001 Corporation for National Research Initiatives +Copyright (c) 2001-2007, Fernando Perez. <fernando.perez@colorado.edu> +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +deprecated 1.2.15 - MIT + + +(c) Laurent LAPORTE +Copyright (c) 2017 Laurent LAPORTE +copyright 2017, Marcos CARDOSO & Laurent LAPORTE + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +e3nn 0.5.4 - MIT + + +copyright 2020, e3nn Developers +Copyright (c) 2011 , Paul D. Nation and Robert J. Johansson +Copyright (c) 2020, The Regents of the University of California, through Lawrence Berkeley National Laboratory + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +exceptiongroup 1.2.2 - MIT + + +Copyright (c) 2022 Alex Gronholm +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Python Software Foundation + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +executing 2.1.0 - MIT + + +2021 Taneli Hukkinen +Copyright (c) 2019 Alex Hall +Copyright (c) 2021 Alex Hall +Copyright 2021 Taneli Hukkinen + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +future 1.0.0 - MIT + + +Copyright 2006 Google, Inc. +Copyright 2008 by Armin Ronacher +Copyright 2013 by the Jinja team +Copyright (c) 2013 - Damian Avila +Copyright (c) 2010 by Armin Ronacher +Copyright (c) 2000 Bastian Kleineidam +Copyright (c) 1999-2002 by Fredrik Lundh +Copyright (c) 1999-2002 by Secret Labs AB. +Copyright 2013-2024 Python Charmers, Australia +Copyright (c) 2001-2006 Python Software Foundation +Copyright (c) 2001-2007 Python Software Foundation +Copyright (c) 2001-2010 Python Software Foundation +Copyright (c) 2002-2006 Python Software Foundation +Copyright (c) 2002-2007 Python Software Foundation +Copyright (c) 2004-2006 Python Software Foundation +Copyright (c) 2013-2024 Python Charmers, Australia +Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> +Copyright 2011 by Armin Ronacher. :license Flask Design +copyright u'2013-2019, Python Charmers Pty Ltd, Australia +(c) Copyright 2013-2019, Python Charmers Pty Ltd, Australia +Copyright (c) 2000 Luke Kenneth Casson Leighton <lkcl@samba.org> +Copyright 2013-2024 Python Charmers (https://pythoncharmers.com) +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Python Software Foundation + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +h11 0.14.0 - MIT + + +copyright 2016, Nathaniel J. Smith +Copyright (c) 2006, Jonathan E. Taylor +Copyright (c) 2006-2008 Scipy Developers +Copyright (c) 2009-2012 Statsmodels Developers +Copyright 2007, 2008 Chris Wanstrath chris@ozmm.org +Copyright (c) 2016 Nathaniel J. Smith <njs@pobox.com> and other contributors + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +hydra-core 1.3.1 - MIT + + +(c) . name +Copyright (c) Facebook, Inc. and its affiliates + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +hydra-joblib-launcher 1.1.5 - MIT + + +Copyright (c) Facebook, Inc. and its affiliates. + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +iniconfig 2.0.0 - MIT + + +(c) Ronny Pfannschmidt, Holger Krekel + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +isort 5.13.2 - MIT + + +Copyright 2018 Google LLC +Copyright 2019 Google LLC +Copyright 2011 VMware, Inc +Copyright 2013 Red Hat, Inc. +Copyright (c) 2021 Taneli Hukkinen +Copyright (c) 2009-2018, Marcel Hellkamp +Copyright (c) 2013 Timothy Edmund Crosley +Copyright (c) 2016 Timothy Edmund Crosley Under + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +jedi 0.19.2 - MIT + + +copyright jedi contributors +Copyright (c) Maxim Kurnikov +Copyright (c) <2013> Permission +Copyright (c) 2015 Jukka Lehtosalo and contributors + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +jmespath 1.0.1 - MIT + + +Copyright (c) 2013 Amazon.com, Inc. or its affiliates + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +jsonschema 4.23.0 - MIT + + +Julian Berman copyright 2013 +Copyright (c) 2012 Julian Berman +Copyright (c) 2013 Julian Berman + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +jsonschema-specifications 2024.10.1 - MIT + + +Julian Berman copyright f'2022 +Copyright (c) 2022 Julian Berman + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +latexcodec 3.0.0 - MIT + + +Copyright (c) 2003, 2008 David Eppstein +copyright 2011-2014, Matthias C. M. Troffaes +Copyright (c) 2011-2020 Matthias C. M. Troffaes +Copyright (c) 2011-2020 by Matthias C. M. Troffaes + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +markdown-it-py 3.0.0 - MIT + + +Copyright 2021 Taneli Hukkinen +Copyright (c) 2020 ExecutableBookProject +Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin +Copyright 2014 Mathias Bynens <https://mathiasbynens.be/> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +mccabe 0.7.0 - MIT + + +Copyright (c) Ned Batchelder +Copyright (c) 2011-2013 Tarek Ziade <tarek@ziade.org> +Copyright (c) 2013 Florent Xicluna <florent.xicluna@gmail.com> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +mdurl 0.1.2 - MIT + + +Copyright (c) 2021 Taneli Hukkinen +Copyright (c) 2015 Vitaly Puzrin, Alex Kocharin +Copyright Joyent, Inc. and other Node contributors + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +monty 2024.7.30 - MIT + + +Copyright 2012, The Materials Project +Copyright 2013, The Materials Project +copyright 2022, Materials Virtual Lab +Copyright (c) 2014 Materials Virtual Lab +(c) Copyright 2022, Materials Virtual Lab +Copyright 2013, The Materials Virtual Lab +Copyright 2014, The Materials Virtual Lab +Copyright (c) 2008-2011 Volvox Development Team +Copyright 2014, The Materials Virtual Lab maintainer Shyue Ping Ong + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +msal 1.31.1 - MIT + + +Copyright (c) Microsoft Corporation + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +msal-extensions 1.2.0 - MIT + + +Copyright (c) Microsoft Corporation + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +nglview 3.1.4 - MIT + + +(c) 2005 Elsevier Inc. +Copyright (c) Schrodinger, LLC. +Copyright (c) 2013 Sergi Mansilla +Copyright (c) 2015 Alexander S. Rose +Copyright (c) 2011-2017, Gregor Aisch +Copyright (c) 2012 Niklas von Hertzen +Copyright (c) Jupyter Development Team +Copyright (c) 2010-2016 three.js authors +Copyright (c) 2010-2020 three.js authors +Copyright (c) 2014-2017, Alexander S Rose +copyright 2016, Alexander Rose, Hai Nguyen +Copyright JS Foundation and other contributors +Copyright OpenJS Foundation and other contributors +Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +Copyright (c) 2007-present, Alexandru Marasteanu <hello@alexei.ro> +Copyright OpenJS Foundation and other contributors, https://openjsf.org +Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University +Copyright (c) CSCS - Swiss National Supercomputing Centre // EDF - Electricite de France +Copyright (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors +(c) 2009-2024 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors Underscore +Copyright (c) 2010-2011 by // Laboratoire de Biochimie Theorique (CNRS), // Laboratoire d'Informatique Fondamentale d'Orleans Universite + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +opt-einsum 3.4.0 - MIT + + +Copyright (c) 2014 Daniel Smith +Copyright (c) 2018 Uber Technologies + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +opt-einsum-fx 0.1.4 - MIT + + +Copyright (c) 2021 Alby M. + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +palettable 3.3.3 - MIT + + +developed by D.A Green, 2011 +Copyright (c) 2019 Matt Davis +Copyright (c) 2014, James R. A. Davenport and contributors +Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +parso 0.8.4 - MIT + + +Copyright 2006 Google, Inc. +Copyright (c) 2010 by Armin Ronacher +Copyright (c) <2013-2017> Permission +Copyright David Halter and Contributors +Copyright 2004-2005 Elemental Security, Inc. +Copyright 2014 David Halter and Contributors +Copyright (c) 2014-2016 Ian Lee <IanLee1521@gmail.com> +Copyright 2010 by Armin Ronacher. :license Flask Design +Copyright (c) 2017-???? Dave Halter <davidhalter88@gmail.com> +Copyright (c) 2006-2009 Johann C. Rocholl <johann@rocholl.net> +Copyright (c) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com> +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Python Software Foundation + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +platformdirs 4.3.6 - MIT + + +Copyright (c) 2010-202x The platformdirs + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +plotly 5.24.1 - MIT + + +(c) Ho (c) +(c) Kyle Simpson +(c) Sindre Sorhus +copyright 2019 Plotly, Inc. +(c) a href http://www.esri.com +Copyright (c) 2021 Plotly, Inc +Copyright 2012-2024, Plotly, Inc. +Copyright (c) 2016-2018 Plotly, Inc +Copyright (c) Jupyter Development Team +Copyright (c) 2014-2015, Jon Schlinkert +Copyright JS Foundation and other contributors +Portions Copyright (c) 2009 David Jones <drj@pobox.com> +copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc +Copyright (c) 2006 Johann C. Rocholl <johann@browsershots.org> +portions Copyright (c) 2006 Nicko van Someren <nicko@nicko.org> +Copyright OpenJS Foundation and other contributors <https://openjsf.org/> +Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> +(c) http://www.esri.com > ESRI ,'ortoInstaMaps' type':'raster','tiles' https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857 + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pluggy 1.5.0 - MIT + + +copyright 2016, Holger Krekel +Copyright (c) 2015 holger krekel (rather uses bitbucket/hpk42) + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +p-tqdm 1.4.2 - MIT + + +Copyright (c) 2024 Kyle Swanson + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pure-eval 0.2.3 - MIT + + +Copyright (c) 2019 Alex Hall + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pybtex 0.24.0 - MIT + + +Copyright (c) 1985 +Copyright (c) 2014 Jorrit Wronski +Copyright (c) 1994-2009 Erik Meijer +Copyright (c) 2003-2008 Michael Shell +Copyright (c) 2006-2016 Andrey Golovizin +Copyright (c) 2014 Matthias C. M. Troffaes +Copyright (c) 1988, 2010 Oren Patashnik. Unlimited +Copyright (c) 1999-2004 Jens Berger (http://www.jurabib.org) +Copyright (c) 1984, 1985, 1988, 2010 Howard Trickey and Oren Patashnik. Unlimited + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pycodestyle 2.12.1 - MIT + + +Copyright (c) 2014-2016 Ian Lee <ianlee1521@gmail.com> +Copyright (c) 2014-2020 Ian Lee <IanLee1521@gmail.com> +Copyright (c) 2006-2009 Johann C. Rocholl <johann@rocholl.net> +Copyright (c) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pydantic-core 2.27.2 - MIT + + +Copyright (c) 2022 Samuel Colvin + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pydantic-settings 2.7.1 - MIT + + +Copyright (c) 2022 Samuel Colvin and other contributors + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pydash 8.0.4 - MIT + + +Summary copyright 2013 +Copyright (c) 2020 Derrick Gilland + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pyjwt 2.10.1 - MIT + + +Copyright 2015-2022 Jose Padilla +copyright 2015-2022, Jose Padilla +Copyright (c) 2015-2022 Jose Padilla + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pymatgen 2024.10.29 - MIT + + +Copyright 2016 +Copyright (c) 2011-2012 +created by Bartel et al. (2018) +Copyright 2011, The Materials Project +Copyright 2012, The Materials Project +Copyright 2013, The Materials Project +Copyright 2014, The Materials Project +Copyright 2016, The Materials Project +Copyright 2017, The Materials Project +Copyright 2018, The Materials Project +Copyright 2019, The Materials Project +Copyright 2020, The Materials Project +Copyright 2021, The Materials Project +Copyright 2022, The Materials Project +Copyright 2024, The Materials Project +Copyright (c) Pymatgen Development Team +Copyright 2015-2021 DueCredit developers +Copyright 2013, The Materials Virtual Lab +Copyright 2018, The Materials Virtual Lab +Copyright 2011-2020, The Materials Project +Copyright 2012-2020, The Materials Project +Copyright 2018-2022, The Materials Project +Copyright 2019-2021, The Materials Project +copyrighted by the Free Software Foundation +Copyright (c) 1989, 1991 Free Software Foundation, Inc. +Copyright (c) 2020 Florian Knoop, Thomas A.R.Purcell, Matthias Scheffler, Christian Carbogno +Copyright (c) 2004-2022, NetworkX Developers Aric Hagberg <hagberg@lanl.gov> Dan Schult <dschult@colgate.edu> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pymatviz 0.8.2 - MIT + + +Copyright (c) 2021 Janosh Riebesell + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pytest 8.3.4 - MIT + + +Copyright (c) 2014, Gregory Boissinot +Copyright (c) 2004 Holger Krekel and others +copyright 2015, holger krekel and pytest-dev team +Copyright Holger Krekel and others, 2004. Distributed + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pytz 2024.2 - MIT + + +Copyright (c) 2003-2019 Stuart Bishop <stuart@stuartbishop.net> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +pyyaml 6.0.2 - MIT + + +Copyright (c) 2017-2021 Ingy dot Net +Copyright (c) 2006-2016 Kirill Simonov + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +referencing 0.35.1 - MIT + + +Julian Berman copyright f'2022 +Copyright (c) 2022 Julian Berman + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +rfc3339-validator 0.1.4 - MIT + + +Copyright (c) 2019, Nicolas Aimetti + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +rfc3986-validator 0.1.1 - MIT + + +Copyright (c) 2019, Nicolas Aimetti + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +rich 13.9.4 - MIT + + +Copyright (c) 2020 Will McGugan +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +rich-click 1.7.4 - MIT + + +Copyright (c) 2022 Phil Ewels + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +rpds-py 0.22.3 - MIT + + +Copyright (c) 2023 Julian Berman +Copyright (c) 2022 Tobias Gustafsson + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +seekpath 2.1.0 - MIT + + +copyright 2016-, Giovanni Pizzi, PAUL +Copyright (c), 2016-2023, Giovanni Pizzi, PAUL + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +six 1.17.0 - MIT + + +Copyright (c) 2010-2024 Benjamin Peterson + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +smart-open 7.1.0 - MIT + + +Copyright (c) 2015 Radim Rehurek +Copyright (c) 2015 Radim Rehurek <me@radimrehurek.com> +Copyright (c) 2019 Radim Rehurek <me@radimrehurek.com> +Copyright (c) 2020 Radim Rehurek <me@radimrehurek.com> +Copyright (c) 2020 Nicolas Mitchell <ncls.mitchell@gmail.com> +Copyright (c) 2020 Radim Rehurek <radim@rare-technologies.com> +Copyright (c) 2015-now Radim Rehurek <https://radimrehurek.com> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +soupsieve 2.6 - MIT + + +Copyright (c) 2018 Isaac Muse +Copyright (c) 2018 - 2024 Isaac Muse <isaacmuse@gmail.com> +Copyright (c) 2018 - 2024 a href https://github.com/facelessuser + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +sshtunnel 0.4.0 - MIT + + +Copyright (c) 2014-2019 Pahaz White + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +stack-data 0.6.3 - MIT + + +Copyright (c) 2019 Alex Hall + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +tabulate 0.9.0 - MIT + + +Copyright (c) 2011-2020 Sergey Astanin and contributors + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +termcolor 2.5.0 - MIT + + +Copyright (c) 2008-2011 Volvox Development Team + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +toml 0.10.2 - MIT + + +Copyright 2017 Jack Evans +Copyright 2016 Google Inc. +Copyright 2017 Nate Prewitt +Copyright 2017 Samuel Vasko +Copyright 2019 Filippo Broggini +Copyright 2015-2016 Julien Enselme +Copyright 2013-2019 William Pearson + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +tomli 2.2.1 - MIT + + +2021 Taneli Hukkinen +Copyright 2021 Taneli Hukkinen +Copyright (c) 2021 Taneli Hukkinen + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +tomlkit 0.13.2 - MIT + + +Copyright (c) 2018 TOML authors +copyright 2021, Sebastien Eustace +Copyright (c) 2018 Sebastien Eustace +Copyright Rebecca Turner <me@re-becca.org> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +torch-ema 0.3 - MIT + + + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +torch-geometric 2.6.1 - MIT + + + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +uri-template 1.3.0 - MIT + + +Copyright (c) 2020 Peter Linss + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +urllib3 1.26.20 - MIT + + +Copyright 2015 Google Inc. +Copyright (c) 2010-2020 Benjamin Peterson +Copyright (c) 2015-2016 Will Bond <will@wbond.net> +Copyright (c) 2008-2020 Andrey Petrov and contributors +Copyright (c) 2012 Senko Rasic <senko.rasic@dobarkod.hr> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +wcwidth 0.2.13 - MIT + + +(c) 2023 Unicode(r), Inc. +copyright 2017, Jeff Quast +Copyright (c) 2014 Jeff Quast <contact@jeffquast.com> + +MIT License + +Copyright (c) <year> <copyright holders> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +tqdm 4.67.1 - MIT AND MPL-2.0 + + +Copyright (c) 2013 noamraph +(c) Noam Yorav-Raphael, original author +(c) Casper da Costa-Luis casperdcl (https://github.com/casperdcl) + +MIT AND MPL-2.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +pyparsing 3.2.1 - MIT AND Python-2.0 + + +Copyright 2004-2010 +Copyright (c) 2021 Dot +Copyright 2004, Paul McGuire +Copyright 2006, Paul McGuire +Copyright 2008 Chris Lambrou +Copyright 2008, Paul McGuire +Copyright 2010, Paul McGuire +Copyright 2011, Paul McGuire +Copyright 2015, Paul McGuire +Copyright 2016, Paul McGuire +Copyright 2018, Paul McGuire +Copyright 2019, Paul McGuire +Copyright 2020, Paul McGuire +Copyright 2021, Paul McGuire +Copyright 2023, Paul McGuire +Copyright 2024, Paul McGuire +Copyright Paul McGuire, 2019 +Copyright Paul McGuire, 2021 +copyright 2006, Paul McGuire +Copyright, 2010, Paul McGuire +Copyright, 2007 - Paul McGuire +Copyright, 2012 - Paul McGuire +Copyright 2006, by Paul McGuire +Copyright 2008, by Paul McGuire +Copyright 2012, Paul T. McGuire +Copyright 2022, by Paul McGuire +Copyright 2024, by Paul McGuire +Copyright (c) 2003, Paul McGuire +Copyright (c) 2004, Paul McGuire +Copyright (c) 2006, Paul McGuire +Copyright (c) 2016, Paul McGuire +Copyright (c) 2024, Paul McGuire +Copyright 2010,2019 Paul McGuire +Copyright, 2006, by Paul McGuire +Copyright 2002-2021, Paul McGuire +Copyright 2005-2006, Paul McGuire +Copyright 2009, 2011 Paul McGuire +Copyright (c) 2018 Paul T. McGuire +Copyright Ellis & Grant, Inc. 2005 +Copyright 2003-2019 by Paul McGuire +Copyright 2011,2015 Paul T. McGuire +Copyright (c) 2003,2019 Paul McGuire +Copyright (c) 2006,2016 Paul McGuire +Copyright 2003, 2019 by Paul McGuire +Copyright 2004-2016, by Paul McGuire +Copyright 2007, 2023 by Paul McGuire +Copyright 2007-2011, by Paul McGuire +Copyright 2010, 2019 by Paul McGuire +Copyright 2012, 2019 Paul T. McGuire +copyright 2018-2024, Paul T. McGuire +Copyright (c) 2003,2016, Paul McGuire +Copyright (c) 2004, 2006 Paul McGuire +Copyright (c) 2004-2016, Paul McGuire +Copyright copy 2003-2024 Paul McGuire +Copyright (c) 2006, 2019, Paul McGuire +Copyright (c) 2003-2022 Paul T. McGuire +Copyright (c) 2004-2011 Paul T. McGuire +Copyright (c) 2006, 2016, 2023, Paul McGuire +Copyright (c) 2006, Estrate, the Netherlands +Copyright 1989 by Carnegie Mellon University +Copyright Petri Savolainen <firstname.lastname@iki.fi> +Copyright 2004, by Alberto Santini http://www.albertosantini.it/chess + +MIT AND Python-2.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +certifi 2024.12.14 - MPL-2.0 + + +(c) 2006 Entrust, Inc. +(c) 1999 Entrust.net Limited +(c) 2009 Entrust, Inc. - for +(c) 2012 Entrust, Inc. - for +(c) 2006 Entrust, Inc. Label Entrust Root Certification +(c) 1999 Entrust.net Limited Label Entrust.net Premium 2048 Secure Server CA Serial + +Mozilla Public License Version 2.0 + + 1. Definitions + + 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. + + 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. + + 1.3. "Contribution" means Covered Software of a particular Contributor. + + 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. + + 1.5. "Incompatible With Secondary Licenses" means + + (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. + + 1.6. "Executable Form" means any form of the work other than Source Code Form. + + 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. + + 1.8. "License" means this document. + + 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. + + 1.10. "Modifications" means any of the following: + + (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or + + (b) any new file in Source Code Form that contains any Covered Software. + + 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. + + 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. + + 1.13. "Source Code Form" means the form of the work preferred for making modifications. + + 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + + 2. License Grants and Conditions + + 2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and + + (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. + + 2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. + + 2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: + + (a) for any code that a Contributor has removed from Covered Software; or + + (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or + + (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. + + This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). + + 2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). + + 2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. + + 2.6. Fair Use + + This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. + + 2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. + + 3. Responsibilities + + 3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. + + 3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and + + (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. + + 3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). + + 3.4. Notices + + You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. + + 3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. + + 4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. + + 5. Termination + + 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. + + 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. + + 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. + + 6. Disclaimer of Warranty + + Covered Software is provided under this License on an "as is" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. + + 7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. + + 8. Litigation + + Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. + + 9. Miscellaneous + + This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. + + 10. Versions of the License + + 10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. + + 10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. + + 10.3. Modified Versions + + If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). + + 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + + If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice + +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + +This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. + +--------------------------------------------------------- + +--------------------------------------------------------- + +fqdn 1.5.1 - MPL-2.0 + + + +Mozilla Public License Version 2.0 + + 1. Definitions + + 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. + + 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. + + 1.3. "Contribution" means Covered Software of a particular Contributor. + + 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. + + 1.5. "Incompatible With Secondary Licenses" means + + (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. + + 1.6. "Executable Form" means any form of the work other than Source Code Form. + + 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. + + 1.8. "License" means this document. + + 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. + + 1.10. "Modifications" means any of the following: + + (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or + + (b) any new file in Source Code Form that contains any Covered Software. + + 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. + + 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. + + 1.13. "Source Code Form" means the form of the work preferred for making modifications. + + 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + + 2. License Grants and Conditions + + 2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and + + (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. + + 2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. + + 2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: + + (a) for any code that a Contributor has removed from Covered Software; or + + (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or + + (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. + + This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). + + 2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). + + 2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. + + 2.6. Fair Use + + This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. + + 2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. + + 3. Responsibilities + + 3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. + + 3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and + + (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. + + 3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). + + 3.4. Notices + + You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. + + 3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. + + 4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. + + 5. Termination + + 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. + + 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. + + 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. + + 6. Disclaimer of Warranty + + Covered Software is provided under this License on an "as is" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. + + 7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. + + 8. Litigation + + Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. + + 9. Miscellaneous + + This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. + + 10. Versions of the License + + 10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. + + 10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. + + 10.3. Modified Versions + + If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). + + 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + + If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice + +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + +This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. + +--------------------------------------------------------- + +--------------------------------------------------------- + +defusedxml 0.7.1 - PSF-2.0 + + +Copyright (c) 2013-2017 by Christian Heimes +Copyright (c) 2013 by Christian Heimes <christian@python.org> +Copyright (c) 2013-2017 by Christian Heimes <christian@python.org> +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation + +PSF-2.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +matplotlib 3.8.4 - PSF-2.0 + + +(c) Tavmjong Bah +(c) Tavmjung Bah +Copyright Font's +Copyright xa9 2017 +b'Copyright xa9 2017 +(c) Frank Siegert 1996 +(c) 2003 by Bitstream, Inc. +Copyright <http://www.ams.org> +X11R4 release, copyright M.I.T. +Copyright (c) 2010 Doug Hellmann +Copyright 2010-2012, Google Inc. +Copyright (c) 2002 Hansruedi Baer +Copyright (c) 2003 Hansruedi Baer +Copyright (c) 2009 Pierre Raybaut +copyrighted by C.B. Barber. Qhull +Copyright (c) 2006 by Tavmjong Bah +Copyright (c) 2007-2008 Permission +copyrighted by the Geometry Center +Copyright (c) 1993-2020 C.B. Barber +Copyright (c) 2011 Ethan Schoonover +Copyright (c) 2002 by Kevin B. Kenny +Copyright (c) 1994, Basil K. Malyshev +Copyright (c) 2003 by Bitstream, Inc. +Copyright (c) 2010, Bartosz Telenczuk +copyright 2014, Matplotlib developers +(c) 2001-2010 by the STI Pub Companies +Copyright (c) 2002-2011 John D. Hunter +ECopyright (c) 2003 by Bitstream, Inc. +FCopyright (c) 2003 by Bitstream, Inc. +Copyright (c) 2001-2004 by Fredrik Lundh +Copyright (c) 2002-2005 Maxim Shemanarev +Copyright 2004 John Gill and John Hunter +Copyright The Matplotlib development team +Copyright (c) 1993-1996 Lucent Technologies +Copyright (c) 1994, 1995, Basil K. Malyshev +Portions copyright (c) 1990 by Elsevier, Inc. +Copyright (c) 1994-1998 Sun Microsystems, Inc. +Copyright (c) 2012- Matplotlib Development Team +Copyright (c) 1997 American Mathematical Society +Copyright (c) 1998-2000 by Scriptics Corporation +Copyright (c) 2001-2010 by the STI Pub Companies +Copyright 1995, Trinity College Computing Center +LCopyright (c) 2001-2010 by the STI Pub Companies +Copyright (c) 1989, 1991 Adobe Systems Incorporated +Copyright (c) 2010-2013 by tyPoland Lukasz Dziedzic +Copyright (c) 2005 Tony Juricic (tonygeek@yahoo.com) +Portions copyright (c) 1998-2003 by MicroPress, Inc. +Copyright (c) Jeremy O'Donoghue & John Hunter, 2003-4 +Copyright (c) 1997, 2009 American Mathematical Society +(c) Copyright 1989-1992, Bitstream Inc., Cambridge, MA. +Copyright 1990 as an unpublished work by Bitstream Inc. +Copyright (c) 1985, 1987, 1988 Adobe Systems Incorporated +Copyright (c) 1989, 1990, 1991 Adobe Systems Incorporated +Copyright (c) 1989, 1990, 1991, Adobe Systems Incorporated +Copyright (c) 2009 John Horigan (http://www.antigrain.com) +Copyright 2020- by the Matplotlib development team. :license +Copyright (c) 1985, 1987, 1988, 1989 Adobe Systems Incorporated +Copyright (c) 1985, 1987, 1988, 1991 Adobe Systems Incorporated +Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated +Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated +Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated +Copyright (c) 1996. The Regents of the University of California +Copyright (c) 2002-2005 Maxim Shemanarev (http://antigrain.com/) +Copyright (c) 2003-2004 Andrew Straw, Jeremy O'Donoghue and others +Copyright (c) 1987-1994 The Regents of the University of California +Copyright (c) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) +Copyright (c) 1985, 1987, 1988, 1989, 1997 Adobe Systems Incorporated +Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated +Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated +Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated +Copyright (c) 1985, 1987, 1989, 1990, 1993, 1997 Adobe Systems Incorporated +Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated +Copyright (c) 1997, 2009, American Mathematical Society (http://www.ams.org) +Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University +copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation +copyright 2002-2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team f'2012- sourceyear The Matplotlib development team + +PSF-2.0 + +--------------------------------------------------------- + +--------------------------------------------------------- + +typing-extensions 4.12.2 - Python-2.0 AND Python-2.0 AND BSD-3-Clause AND Python-2.0 AND BSD-3-Clause AND 0BSD + + +Copyright (c) 1995-2001 Corporation for National Research Initiatives +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherlands +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation + +Python-2.0 AND Python-2.0 AND BSD-3-Clause AND Python-2.0 AND BSD-3-Clause AND 0BSD + +--------------------------------------------------------- + +--------------------------------------------------------- + +email-validator 2.2.0 - Unlicense + + + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. + +In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and + +successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to <http://unlicense.org/> + +--------------------------------------------------------- + +--------------------------------------------------------- + +filelock 3.16.1 - Unlicense + + + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. + +In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and + +successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to <http://unlicense.org/> + +--------------------------------------------------------- + diff --git a/data/SECURITY.md b/data/SECURITY.md new file mode 100644 index 0000000000000000000000000000000000000000..b3c89efc852e22f71eabf5dfbc6ac62493425eb6 --- /dev/null +++ b/data/SECURITY.md @@ -0,0 +1,41 @@ +<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK --> + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). + +<!-- END MICROSOFT SECURITY.MD BLOCK --> diff --git a/data/assets/MatterGenlogo_.png b/data/assets/MatterGenlogo_.png new file mode 100644 index 0000000000000000000000000000000000000000..a9d40e6fec93d8c2ba4a5efe9dd0bb4d7ac4e2ef --- /dev/null +++ b/data/assets/MatterGenlogo_.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db1bc6af0701aa5b8c4c95e7195eb2bf5f2f8b6142217ebd28ee786dbfe98623 +size 865451 diff --git a/data/assets/datasets_venn_diagram.png b/data/assets/datasets_venn_diagram.png new file mode 100644 index 0000000000000000000000000000000000000000..afe1453a0dfa9fc866d7b873ee9905dd31a85fe1 --- /dev/null +++ b/data/assets/datasets_venn_diagram.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d55e1ef7fc6ab1034475608ecfed18fd7981d2fdb6e1ec04d5387b12d3039ecc +size 473052 diff --git a/data/checkpoints/chemical_system/checkpoints/last.ckpt b/data/checkpoints/chemical_system/checkpoints/last.ckpt new file mode 100644 index 0000000000000000000000000000000000000000..03e6fc544e5fa3a0fd25bf6b40d4657dbc8de165 --- /dev/null +++ b/data/checkpoints/chemical_system/checkpoints/last.ckpt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ace0330f950a10142d3c8827642c38e9d5267672bdcdecd6fc9d2ab248193ca +size 134 diff --git a/data/checkpoints/chemical_system/config.yaml b/data/checkpoints/chemical_system/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..671d0abb3ec2af2721ab9f5dd8c7ac3a0e28151a --- /dev/null +++ b/data/checkpoints/chemical_system/config.yaml @@ -0,0 +1,224 @@ +adapter: + adapter: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - chemical_system + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + chemical_system: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.property_embeddings.ChemicalSystemMultiHotEmbedding + hidden_dim: 512 + name: chemical_system + scaler: + _target_: torch.nn.Identity + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + full_finetuning: true + load_epoch: last + model_path: checkpoints/mattergen_base +data_module: + _recursive_: true + _target_: mattergen.common.data.datamodule.CrystDataModule + average_density: 0.05771451654022283 + batch_size: + train: 64 + val: 64 + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + max_epochs: 2200 + num_workers: + train: 0 + val: 0 + properties: + - chemical_system + root_dir: datasets/cache/alex_mp_20/ + train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/train + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - chemical_system + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/val + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - chemical_system + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string +lightning_module: + _target_: mattergen.diffusion.lightning_module.DiffusionLightningModule + diffusion_module: + _target_: mattergen.diffusion.diffusion_module.DiffusionModule + corruption: + _target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption + discrete_corruptions: + atomic_numbers: + _target_: mattergen.diffusion.corruption.d3pm_corruption.D3PMCorruption + d3pm: + _target_: mattergen.diffusion.d3pm.d3pm.MaskDiffusion + dim: 101 + schedule: + _target_: mattergen.diffusion.d3pm.d3pm.create_discrete_diffusion_schedule + kind: standard + num_steps: 1000 + offset: 1 + sdes: + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_max: 20 + beta_min: 0.1 + limit_density: 0.05771451654022283 + limit_var_scaling_constant: 0.25 + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + limit_info_key: num_atoms + sigma_max: 5.0 + wrapping_boundary: 1.0 + loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + d3pm_hybrid_lambda: 0.01 + include_atomic_numbers: true + include_cell: true + include_pos: true + reduce: sum + weights: + atomic_numbers: 1.0 + cell: 1.0 + pos: 0.1 + model: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - chemical_system + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + chemical_system: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.property_embeddings.ChemicalSystemMultiHotEmbedding + hidden_dim: 512 + name: chemical_system + scaler: + _target_: torch.nn.Identity + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + dropout_fields_iid: false + p_unconditional: 0.2 + optimizer_partial: + _partial_: true + _target_: torch.optim.Adam + lr: 5.0e-06 + scheduler_partials: + - frequency: 1 + interval: epoch + monitor: loss_train + scheduler: + _partial_: true + _target_: torch.optim.lr_scheduler.ReduceLROnPlateau + factor: 0.6 + min_lr: 1.0e-06 + patience: 100 + verbose: true + strict: true +trainer: + _target_: pytorch_lightning.Trainer + accelerator: gpu + accumulate_grad_batches: 1 + callbacks: + - _target_: pytorch_lightning.callbacks.LearningRateMonitor + log_momentum: false + logging_interval: step + - _target_: pytorch_lightning.callbacks.ModelCheckpoint + every_n_epochs: 1 + filename: '{epoch}-{loss_val:.2f}' + mode: min + monitor: loss_val + save_last: true + save_top_k: 1 + verbose: false + - _target_: pytorch_lightning.callbacks.TQDMProgressBar + refresh_rate: 50 + - _target_: mattergen.common.data.callback.SetPropertyScalers + check_val_every_n_epoch: 1 + devices: 8 + gradient_clip_algorithm: value + gradient_clip_val: 0.5 + logger: + _target_: pytorch_lightning.loggers.WandbLogger + job_type: train_finetune + project: crystal-generation + settings: + _save_requirements: false + _target_: wandb.Settings + start_method: fork + max_epochs: 200 + num_nodes: 1 + precision: 32 + strategy: + _target_: pytorch_lightning.strategies.ddp.DDPStrategy + find_unused_parameters: true diff --git a/data/checkpoints/chemical_system_energy_above_hull/checkpoints/last.ckpt b/data/checkpoints/chemical_system_energy_above_hull/checkpoints/last.ckpt new file mode 100644 index 0000000000000000000000000000000000000000..77c2c9b38d9e5fbd76a3a2bf97c1c297fb38ae72 --- /dev/null +++ b/data/checkpoints/chemical_system_energy_above_hull/checkpoints/last.ckpt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8184d14c2e80e8eeb86906e773ee76b733380732929bb2e22148e81d53f906d3 +size 134 diff --git a/data/checkpoints/chemical_system_energy_above_hull/config.yaml b/data/checkpoints/chemical_system_energy_above_hull/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e0c953654fb5a59cc678f46403317b12dbffdbda --- /dev/null +++ b/data/checkpoints/chemical_system_energy_above_hull/config.yaml @@ -0,0 +1,251 @@ +adapter: + adapter: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - chemical_system + - energy_above_hull + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + chemical_system: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.property_embeddings.ChemicalSystemMultiHotEmbedding + hidden_dim: 512 + name: chemical_system + scaler: + _target_: torch.nn.Identity + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + energy_above_hull: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: energy_above_hull + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + full_finetuning: true + load_epoch: last + model_path: checkpoints/mattergen_base +data_module: + _recursive_: true + _target_: mattergen.common.data.datamodule.CrystDataModule + average_density: 0.05771451654022283 + batch_size: + train: 64 + val: 64 + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + max_epochs: 2200 + num_workers: + train: 0 + val: 0 + properties: + - chemical_system + - energy_above_hull + root_dir: datasets/cache/alex_mp_20 + train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/train + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - chemical_system + - energy_above_hull + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/val + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - chemical_system + - energy_above_hull + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string +lightning_module: + _target_: mattergen.diffusion.lightning_module.DiffusionLightningModule + diffusion_module: + _target_: mattergen.diffusion.diffusion_module.DiffusionModule + corruption: + _target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption + discrete_corruptions: + atomic_numbers: + _target_: mattergen.diffusion.corruption.d3pm_corruption.D3PMCorruption + d3pm: + _target_: mattergen.diffusion.d3pm.d3pm.MaskDiffusion + dim: 101 + schedule: + _target_: mattergen.diffusion.d3pm.d3pm.create_discrete_diffusion_schedule + kind: standard + num_steps: 1000 + offset: 1 + sdes: + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_max: 20 + beta_min: 0.1 + limit_density: 0.05771451654022283 + limit_var_scaling_constant: 0.25 + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + limit_info_key: num_atoms + sigma_max: 5.0 + wrapping_boundary: 1.0 + loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + d3pm_hybrid_lambda: 0.01 + include_atomic_numbers: true + include_cell: true + include_pos: true + reduce: sum + weights: + atomic_numbers: 1.0 + cell: 1.0 + pos: 0.1 + model: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - chemical_system + - energy_above_hull + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + chemical_system: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.property_embeddings.ChemicalSystemMultiHotEmbedding + hidden_dim: 512 + name: chemical_system + scaler: + _target_: torch.nn.Identity + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + energy_above_hull: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: energy_above_hull + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + dropout_fields_iid: false + p_unconditional: 0.2 + optimizer_partial: + _partial_: true + _target_: torch.optim.Adam + lr: 5.0e-06 + scheduler_partials: + - frequency: 1 + interval: epoch + monitor: loss_train + scheduler: + _partial_: true + _target_: torch.optim.lr_scheduler.ReduceLROnPlateau + factor: 0.6 + min_lr: 1.0e-06 + patience: 100 + verbose: true + strict: true +trainer: + _target_: pytorch_lightning.Trainer + accelerator: gpu + accumulate_grad_batches: 1 + callbacks: + - _target_: pytorch_lightning.callbacks.LearningRateMonitor + log_momentum: false + logging_interval: step + - _target_: pytorch_lightning.callbacks.ModelCheckpoint + every_n_epochs: 1 + filename: '{epoch}-{loss_val:.2f}' + mode: min + monitor: loss_val + save_last: true + save_top_k: 1 + verbose: false + - _target_: pytorch_lightning.callbacks.TQDMProgressBar + refresh_rate: 50 + - _target_: mattergen.common.data.callback.SetPropertyScalers + check_val_every_n_epoch: 5 + devices: 8 + gradient_clip_algorithm: value + gradient_clip_val: 0.5 + logger: + _target_: pytorch_lightning.loggers.WandbLogger + job_type: train_finetune + project: crystal-generation + settings: + _save_requirements: false + _target_: wandb.Settings + start_method: fork + max_epochs: 200 + num_nodes: 1 + precision: 32 + strategy: + _target_: pytorch_lightning.strategies.ddp.DDPStrategy + find_unused_parameters: true diff --git a/data/checkpoints/dft_band_gap/checkpoints/last.ckpt b/data/checkpoints/dft_band_gap/checkpoints/last.ckpt new file mode 100644 index 0000000000000000000000000000000000000000..5542834365e7599a97c23441a7d4fcb4a9241d04 --- /dev/null +++ b/data/checkpoints/dft_band_gap/checkpoints/last.ckpt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6f844861a1218b3b414dfdd708b4c68750a6e63915ba41036dc94bbd4975076 +size 134 diff --git a/data/checkpoints/dft_band_gap/config.yaml b/data/checkpoints/dft_band_gap/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1eebe5d53c3801709df446678ba2b8ad893647bd --- /dev/null +++ b/data/checkpoints/dft_band_gap/config.yaml @@ -0,0 +1,224 @@ +adapter: + adapter: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - dft_band_gap + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + dft_band_gap: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: dft_band_gap + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + full_finetuning: true + load_epoch: last + model_path: checkpoints/mattergen_base +data_module: + _recursive_: true + _target_: mattergen.common.data.datamodule.CrystDataModule + average_density: 0.05771451654022283 + batch_size: + train: 64 + val: 64 + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + max_epochs: 2200 + num_workers: + train: 0 + val: 0 + properties: + - dft_band_gap + root_dir: datasets/cache/alex_mp_20 + train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/train + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - dft_band_gap + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/val + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - dft_band_gap + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string +lightning_module: + _target_: mattergen.diffusion.lightning_module.DiffusionLightningModule + diffusion_module: + _target_: mattergen.diffusion.diffusion_module.DiffusionModule + corruption: + _target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption + discrete_corruptions: + atomic_numbers: + _target_: mattergen.diffusion.corruption.d3pm_corruption.D3PMCorruption + d3pm: + _target_: mattergen.diffusion.d3pm.d3pm.MaskDiffusion + dim: 101 + schedule: + _target_: mattergen.diffusion.d3pm.d3pm.create_discrete_diffusion_schedule + kind: standard + num_steps: 1000 + offset: 1 + sdes: + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_max: 20 + beta_min: 0.1 + limit_density: 0.05771451654022283 + limit_var_scaling_constant: 0.25 + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + limit_info_key: num_atoms + sigma_max: 5.0 + wrapping_boundary: 1.0 + loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + d3pm_hybrid_lambda: 0.01 + include_atomic_numbers: true + include_cell: true + include_pos: true + reduce: sum + weights: + atomic_numbers: 1.0 + cell: 1.0 + pos: 0.1 + model: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - dft_band_gap + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + dft_band_gap: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: dft_band_gap + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + dropout_fields_iid: false + p_unconditional: 0.2 + optimizer_partial: + _partial_: true + _target_: torch.optim.Adam + lr: 5.0e-06 + scheduler_partials: + - frequency: 1 + interval: epoch + monitor: loss_train + scheduler: + _partial_: true + _target_: torch.optim.lr_scheduler.ReduceLROnPlateau + factor: 0.6 + min_lr: 1.0e-06 + patience: 100 + verbose: true + strict: true +trainer: + _target_: pytorch_lightning.Trainer + accelerator: gpu + accumulate_grad_batches: 1 + callbacks: + - _target_: pytorch_lightning.callbacks.LearningRateMonitor + log_momentum: false + logging_interval: step + - _target_: pytorch_lightning.callbacks.ModelCheckpoint + every_n_epochs: 1 + filename: '{epoch}-{loss_val:.2f}' + mode: min + monitor: loss_val + save_last: true + save_top_k: 1 + verbose: false + - _target_: pytorch_lightning.callbacks.TQDMProgressBar + refresh_rate: 50 + - _target_: mattergen.common.data.callback.SetPropertyScalers + check_val_every_n_epoch: 5 + devices: 8 + gradient_clip_algorithm: value + gradient_clip_val: 0.5 + logger: + _target_: pytorch_lightning.loggers.WandbLogger + job_type: train_finetune + project: crystal-generation + settings: + _save_requirements: false + _target_: wandb.Settings + start_method: fork + max_epochs: 200 + num_nodes: 1 + precision: 32 + strategy: + _target_: pytorch_lightning.strategies.ddp.DDPStrategy + find_unused_parameters: true diff --git a/data/checkpoints/dft_mag_density/checkpoints/last.ckpt b/data/checkpoints/dft_mag_density/checkpoints/last.ckpt new file mode 100644 index 0000000000000000000000000000000000000000..f13382c059c288422b7dd37cfbdbd0112b6db248 --- /dev/null +++ b/data/checkpoints/dft_mag_density/checkpoints/last.ckpt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:908fa450a025993a79f6235734be9f29edd035461aece61ee8be3009d3b6e678 +size 134 diff --git a/data/checkpoints/dft_mag_density/config.yaml b/data/checkpoints/dft_mag_density/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bcb67a9b17ab7ad0d33020a3509f51e06121d9f8 --- /dev/null +++ b/data/checkpoints/dft_mag_density/config.yaml @@ -0,0 +1,224 @@ +adapter: + adapter: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - dft_mag_density + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + dft_mag_density: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: dft_mag_density + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + full_finetuning: true + load_epoch: last + model_path: checkpoints/mattergen_base +data_module: + _recursive_: true + _target_: mattergen.common.data.datamodule.CrystDataModule + average_density: 0.05771451654022283 + batch_size: + train: 64 + val: 64 + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + max_epochs: 2200 + num_workers: + train: 0 + val: 0 + properties: + - dft_mag_density + root_dir: datasets/cache/alex_mp_20 + train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/train + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - dft_mag_density + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/val + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - dft_mag_density + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string +lightning_module: + _target_: mattergen.diffusion.lightning_module.DiffusionLightningModule + diffusion_module: + _target_: mattergen.diffusion.diffusion_module.DiffusionModule + corruption: + _target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption + discrete_corruptions: + atomic_numbers: + _target_: mattergen.diffusion.corruption.d3pm_corruption.D3PMCorruption + d3pm: + _target_: mattergen.diffusion.d3pm.d3pm.MaskDiffusion + dim: 101 + schedule: + _target_: mattergen.diffusion.d3pm.d3pm.create_discrete_diffusion_schedule + kind: standard + num_steps: 1000 + offset: 1 + sdes: + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_max: 20 + beta_min: 0.1 + limit_density: 0.05771451654022283 + limit_var_scaling_constant: 0.25 + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + limit_info_key: num_atoms + sigma_max: 5.0 + wrapping_boundary: 1.0 + loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + d3pm_hybrid_lambda: 0.01 + include_atomic_numbers: true + include_cell: true + include_pos: true + reduce: sum + weights: + atomic_numbers: 1.0 + cell: 1.0 + pos: 0.1 + model: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - dft_mag_density + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + dft_mag_density: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: dft_mag_density + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + dropout_fields_iid: false + p_unconditional: 0.2 + optimizer_partial: + _partial_: true + _target_: torch.optim.Adam + lr: 5.0e-06 + scheduler_partials: + - frequency: 1 + interval: epoch + monitor: loss_train + scheduler: + _partial_: true + _target_: torch.optim.lr_scheduler.ReduceLROnPlateau + factor: 0.6 + min_lr: 1.0e-06 + patience: 100 + verbose: true + strict: true +trainer: + _target_: pytorch_lightning.Trainer + accelerator: gpu + accumulate_grad_batches: 1 + callbacks: + - _target_: pytorch_lightning.callbacks.LearningRateMonitor + log_momentum: false + logging_interval: step + - _target_: pytorch_lightning.callbacks.ModelCheckpoint + every_n_epochs: 1 + filename: '{epoch}-{loss_val:.2f}' + mode: min + monitor: loss_val + save_last: true + save_top_k: 1 + verbose: false + - _target_: pytorch_lightning.callbacks.TQDMProgressBar + refresh_rate: 50 + - _target_: mattergen.common.data.callback.SetPropertyScalers + check_val_every_n_epoch: 1 + devices: 8 + gradient_clip_algorithm: value + gradient_clip_val: 0.5 + logger: + _target_: pytorch_lightning.loggers.WandbLogger + job_type: train_finetune + project: crystal-generation + settings: + _save_requirements: false + _target_: wandb.Settings + start_method: fork + max_epochs: 200 + num_nodes: 1 + precision: 32 + strategy: + _target_: pytorch_lightning.strategies.ddp.DDPStrategy + find_unused_parameters: true diff --git a/data/checkpoints/dft_mag_density_hhi_score/checkpoints/last.ckpt b/data/checkpoints/dft_mag_density_hhi_score/checkpoints/last.ckpt new file mode 100644 index 0000000000000000000000000000000000000000..46bf4d4310684e37359a1d36249d224fda64dc9d --- /dev/null +++ b/data/checkpoints/dft_mag_density_hhi_score/checkpoints/last.ckpt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c410c7e10fc8a38ebc35bbc36c2a6c94bfe3b332b0c3de27c65854dae4e977d +size 134 diff --git a/data/checkpoints/dft_mag_density_hhi_score/config.yaml b/data/checkpoints/dft_mag_density_hhi_score/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f86c90fd2949b8f7b1e9e8550b066ea11b8b772c --- /dev/null +++ b/data/checkpoints/dft_mag_density_hhi_score/config.yaml @@ -0,0 +1,251 @@ +adapter: + adapter: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - dft_mag_density + - hhi_score + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + dft_mag_density: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: dft_mag_density + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + hhi_score: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: hhi_score + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + full_finetuning: true + load_epoch: last + model_path: checkpoints/mattergen_base +data_module: + _recursive_: true + _target_: mattergen.common.data.datamodule.CrystDataModule + average_density: 0.05771451654022283 + batch_size: + train: 64 + val: 64 + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + max_epochs: 2200 + num_workers: + train: 0 + val: 0 + properties: + - dft_mag_density + - hhi_score + root_dir: datasets/cache/alex_mp_20 + train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/train + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - dft_mag_density + - hhi_score + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/val + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - dft_mag_density + - hhi_score + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string +lightning_module: + _target_: mattergen.diffusion.lightning_module.DiffusionLightningModule + diffusion_module: + _target_: mattergen.diffusion.diffusion_module.DiffusionModule + corruption: + _target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption + discrete_corruptions: + atomic_numbers: + _target_: mattergen.diffusion.corruption.d3pm_corruption.D3PMCorruption + d3pm: + _target_: mattergen.diffusion.d3pm.d3pm.MaskDiffusion + dim: 101 + schedule: + _target_: mattergen.diffusion.d3pm.d3pm.create_discrete_diffusion_schedule + kind: standard + num_steps: 1000 + offset: 1 + sdes: + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_max: 20 + beta_min: 0.1 + limit_density: 0.05771451654022283 + limit_var_scaling_constant: 0.25 + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + limit_info_key: num_atoms + sigma_max: 5.0 + wrapping_boundary: 1.0 + loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + d3pm_hybrid_lambda: 0.01 + include_atomic_numbers: true + include_cell: true + include_pos: true + reduce: sum + weights: + atomic_numbers: 1.0 + cell: 1.0 + pos: 0.1 + model: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - dft_mag_density + - hhi_score + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + dft_mag_density: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: dft_mag_density + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + hhi_score: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: hhi_score + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + dropout_fields_iid: false + p_unconditional: 0.2 + optimizer_partial: + _partial_: true + _target_: torch.optim.Adam + lr: 5.0e-06 + scheduler_partials: + - frequency: 1 + interval: epoch + monitor: loss_train + scheduler: + _partial_: true + _target_: torch.optim.lr_scheduler.ReduceLROnPlateau + factor: 0.6 + min_lr: 1.0e-06 + patience: 100 + verbose: true + strict: true +trainer: + _target_: pytorch_lightning.Trainer + accelerator: gpu + accumulate_grad_batches: 1 + callbacks: + - _target_: pytorch_lightning.callbacks.LearningRateMonitor + log_momentum: false + logging_interval: step + - _target_: pytorch_lightning.callbacks.ModelCheckpoint + every_n_epochs: 1 + filename: '{epoch}-{loss_val:.2f}' + mode: min + monitor: loss_val + save_last: true + save_top_k: 1 + verbose: false + - _target_: pytorch_lightning.callbacks.TQDMProgressBar + refresh_rate: 50 + - _target_: mattergen.common.data.callback.SetPropertyScalers + check_val_every_n_epoch: 5 + devices: 8 + gradient_clip_algorithm: value + gradient_clip_val: 0.5 + logger: + _target_: pytorch_lightning.loggers.WandbLogger + job_type: train_finetune + project: crystal-generation + settings: + _save_requirements: false + _target_: wandb.Settings + start_method: fork + max_epochs: 200 + num_nodes: 1 + precision: 32 + strategy: + _target_: pytorch_lightning.strategies.ddp.DDPStrategy + find_unused_parameters: true diff --git a/data/checkpoints/mattergen_base/checkpoints/last.ckpt b/data/checkpoints/mattergen_base/checkpoints/last.ckpt new file mode 100644 index 0000000000000000000000000000000000000000..e853f5e01f9c6d83054edc64fc5e3726fbb0914f --- /dev/null +++ b/data/checkpoints/mattergen_base/checkpoints/last.ckpt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3407829227a1071dda19824f3dbcb074be4598419cebbd33d25df95617b2325e +size 134 diff --git a/data/checkpoints/mattergen_base/config.yaml b/data/checkpoints/mattergen_base/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..04012f3a1f9ea12db3d46eef8e41ec745361f09b --- /dev/null +++ b/data/checkpoints/mattergen_base/config.yaml @@ -0,0 +1,184 @@ +auto_resume: true +checkpoint_path: null +data_module: + _recursive_: true + _target_: mattergen.common.data.datamodule.CrystDataModule + average_density: 0.05771451654022283 + batch_size: + train: 32 + val: 32 + max_epochs: 2200 + num_workers: + train: 0 + val: 0 + properties: + - dft_bulk_modulus + - dft_band_gap + - dft_mag_density + - ml_bulk_modulus + - hhi_score + - space_group + - energy_above_hull + root_dir: datasets/cache/alex_mp_20/ + train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/train + properties: + - dft_bulk_modulus + - dft_band_gap + - dft_mag_density + - ml_bulk_modulus + - hhi_score + - space_group + - energy_above_hull + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/val + properties: + - dft_bulk_modulus + - dft_band_gap + - dft_mag_density + - ml_bulk_modulus + - hhi_score + - space_group + - energy_above_hull + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string +lightning_module: + _target_: mattergen.diffusion.lightning_module.DiffusionLightningModule + diffusion_module: + _target_: mattergen.diffusion.diffusion_module.DiffusionModule + corruption: + _target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption + discrete_corruptions: + atomic_numbers: + _target_: mattergen.diffusion.corruption.d3pm_corruption.D3PMCorruption + d3pm: + _target_: mattergen.diffusion.d3pm.d3pm.MaskDiffusion + dim: 101 + schedule: + _target_: mattergen.diffusion.d3pm.d3pm.create_discrete_diffusion_schedule + kind: standard + num_steps: 1000 + offset: 1 + sdes: + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_max: 20 + beta_min: 0.1 + limit_density: 0.05771451654022283 + limit_var_scaling_constant: 0.25 + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + limit_info_key: num_atoms + sigma_max: 5.0 + wrapping_boundary: 1.0 + loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + d3pm_hybrid_lambda: 0.01 + include_atomic_numbers: true + include_cell: true + include_pos: true + reduce: sum + weights: + atomic_numbers: 1.0 + cell: 1.0 + pos: 0.1 + model: + _target_: mattergen.denoiser.GemNetTDenoiser + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet.GemNetT + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: {} + pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + dropout_fields_iid: false + p_unconditional: 0.2 + optimizer_partial: + _partial_: true + _target_: torch.optim.Adam + lr: 0.0001 + scheduler_partials: + - frequency: 1 + interval: epoch + monitor: loss_train + scheduler: + _partial_: true + _target_: torch.optim.lr_scheduler.ReduceLROnPlateau + factor: 0.6 + min_lr: 1.0e-06 + patience: 100 + verbose: true + strict: true +load_original: false +params: {} +train: true +trainer: + _target_: pytorch_lightning.Trainer + accelerator: gpu + accumulate_grad_batches: 1 + callbacks: + - _target_: pytorch_lightning.callbacks.LearningRateMonitor + log_momentum: false + logging_interval: step + - _target_: pytorch_lightning.callbacks.ModelCheckpoint + every_n_epochs: 1 + filename: '{epoch}-{loss_val:.2f}' + mode: min + monitor: loss_val + save_last: true + save_top_k: 1 + verbose: false + - _target_: pytorch_lightning.callbacks.TQDMProgressBar + refresh_rate: 50 + - _target_: mattergen.common.data.callback.SetPropertyScalers + check_val_every_n_epoch: 5 + devices: 8 + gradient_clip_algorithm: value + gradient_clip_val: 0.5 + logger: + _target_: pytorch_lightning.loggers.WandbLogger + job_type: train + project: crystal-generation + settings: + _save_requirements: false + _target_: wandb.Settings + start_method: fork + max_epochs: 2200 + num_nodes: 2 + precision: 32 + strategy: + _target_: pytorch_lightning.strategies.ddp.DDPStrategy + find_unused_parameters: true diff --git a/data/checkpoints/ml_bulk_modulus/checkpoints/last.ckpt b/data/checkpoints/ml_bulk_modulus/checkpoints/last.ckpt new file mode 100644 index 0000000000000000000000000000000000000000..2696049b4231ae53fa98fd56950306ee6d250ffd --- /dev/null +++ b/data/checkpoints/ml_bulk_modulus/checkpoints/last.ckpt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26ad45013b6382211534c39f629ec98e8751c22a2bb62592c12d901baacdbea5 +size 134 diff --git a/data/checkpoints/ml_bulk_modulus/config.yaml b/data/checkpoints/ml_bulk_modulus/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f52450acd29c131646c2cbd4c55a96379843cb15 --- /dev/null +++ b/data/checkpoints/ml_bulk_modulus/config.yaml @@ -0,0 +1,224 @@ +adapter: + adapter: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - ml_bulk_modulus + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + ml_bulk_modulus: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: ml_bulk_modulus + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + full_finetuning: true + load_epoch: last + model_path: checkpoints/mattergen_base +data_module: + _recursive_: true + _target_: mattergen.common.data.datamodule.CrystDataModule + average_density: 0.05771451654022283 + batch_size: + train: 64 + val: 64 + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + max_epochs: 2200 + num_workers: + train: 0 + val: 0 + properties: + - ml_bulk_modulus + root_dir: datasets/cache/alex_mp_20 + train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/train + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - ml_bulk_modulus + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/val + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - ml_bulk_modulus + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string +lightning_module: + _target_: mattergen.diffusion.lightning_module.DiffusionLightningModule + diffusion_module: + _target_: mattergen.diffusion.diffusion_module.DiffusionModule + corruption: + _target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption + discrete_corruptions: + atomic_numbers: + _target_: mattergen.diffusion.corruption.d3pm_corruption.D3PMCorruption + d3pm: + _target_: mattergen.diffusion.d3pm.d3pm.MaskDiffusion + dim: 101 + schedule: + _target_: mattergen.diffusion.d3pm.d3pm.create_discrete_diffusion_schedule + kind: standard + num_steps: 1000 + offset: 1 + sdes: + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_max: 20 + beta_min: 0.1 + limit_density: 0.05771451654022283 + limit_var_scaling_constant: 0.25 + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + limit_info_key: num_atoms + sigma_max: 5.0 + wrapping_boundary: 1.0 + loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + d3pm_hybrid_lambda: 0.01 + include_atomic_numbers: true + include_cell: true + include_pos: true + reduce: sum + weights: + atomic_numbers: 1.0 + cell: 1.0 + pos: 0.1 + model: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - ml_bulk_modulus + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + ml_bulk_modulus: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: 512 + name: ml_bulk_modulus + scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + dropout_fields_iid: false + p_unconditional: 0.2 + optimizer_partial: + _partial_: true + _target_: torch.optim.Adam + lr: 5.0e-06 + scheduler_partials: + - frequency: 1 + interval: epoch + monitor: loss_train + scheduler: + _partial_: true + _target_: torch.optim.lr_scheduler.ReduceLROnPlateau + factor: 0.6 + min_lr: 1.0e-06 + patience: 100 + verbose: true + strict: true +trainer: + _target_: pytorch_lightning.Trainer + accelerator: gpu + accumulate_grad_batches: 1 + callbacks: + - _target_: pytorch_lightning.callbacks.LearningRateMonitor + log_momentum: false + logging_interval: step + - _target_: pytorch_lightning.callbacks.ModelCheckpoint + every_n_epochs: 1 + filename: '{epoch}-{loss_val:.2f}' + mode: min + monitor: loss_val + save_last: true + save_top_k: 1 + verbose: false + - _target_: pytorch_lightning.callbacks.TQDMProgressBar + refresh_rate: 50 + - _target_: mattergen.common.data.callback.SetPropertyScalers + check_val_every_n_epoch: 1 + devices: 8 + gradient_clip_algorithm: value + gradient_clip_val: 0.5 + logger: + _target_: pytorch_lightning.loggers.WandbLogger + job_type: train_finetune + project: crystal-generation + settings: + _save_requirements: false + _target_: wandb.Settings + start_method: fork + max_epochs: 200 + num_nodes: 1 + precision: 32 + strategy: + _target_: pytorch_lightning.strategies.ddp.DDPStrategy + find_unused_parameters: true diff --git a/data/checkpoints/space_group/checkpoints/last.ckpt b/data/checkpoints/space_group/checkpoints/last.ckpt new file mode 100644 index 0000000000000000000000000000000000000000..1a0302e4f53024959e8507c6f6131e90f981ffd8 --- /dev/null +++ b/data/checkpoints/space_group/checkpoints/last.ckpt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a58b06008a935a56a6842bd631ee2c74aa668936111d0678001c11c88ba66e80 +size 134 diff --git a/data/checkpoints/space_group/config.yaml b/data/checkpoints/space_group/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2861dcee39acb23fbbd4668cf17c1679f34209ac --- /dev/null +++ b/data/checkpoints/space_group/config.yaml @@ -0,0 +1,224 @@ +adapter: + adapter: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - space_group + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + space_group: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.property_embeddings.SpaceGroupEmbeddingVector + hidden_dim: 512 + name: space_group + scaler: + _target_: torch.nn.Identity + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + full_finetuning: true + load_epoch: last + model_path: checkpoints/mattergen_base +data_module: + _recursive_: true + _target_: mattergen.common.data.datamodule.CrystDataModule + average_density: 0.05771451654022283 + batch_size: + train: 64 + val: 64 + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + max_epochs: 2200 + num_workers: + train: 0 + val: 0 + properties: + - space_group + root_dir: datasets/cache/alex_mp_20 + train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/train + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - space_group + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string + val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: datasets/cache/alex_mp_20/val + dataset_transforms: + - _partial_: true + _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + properties: + - space_group + transforms: + - _partial_: true + _target_: mattergen.common.data.transform.symmetrize_lattice + - _partial_: true + _target_: mattergen.common.data.transform.set_chemical_system_string +lightning_module: + _target_: mattergen.diffusion.lightning_module.DiffusionLightningModule + diffusion_module: + _target_: mattergen.diffusion.diffusion_module.DiffusionModule + corruption: + _target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption + discrete_corruptions: + atomic_numbers: + _target_: mattergen.diffusion.corruption.d3pm_corruption.D3PMCorruption + d3pm: + _target_: mattergen.diffusion.d3pm.d3pm.MaskDiffusion + dim: 101 + schedule: + _target_: mattergen.diffusion.d3pm.d3pm.create_discrete_diffusion_schedule + kind: standard + num_steps: 1000 + offset: 1 + sdes: + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_max: 20 + beta_min: 0.1 + limit_density: 0.05771451654022283 + limit_var_scaling_constant: 0.25 + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + limit_info_key: num_atoms + sigma_max: 5.0 + wrapping_boundary: 1.0 + loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + d3pm_hybrid_lambda: 0.01 + include_atomic_numbers: true + include_cell: true + include_pos: true + reduce: sum + weights: + atomic_numbers: 1.0 + cell: 1.0 + pos: 0.1 + model: + _target_: mattergen.adapter.GemNetTAdapter + atom_type_diffusion: mask + denoise_atom_types: true + gemnet: + _target_: mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: 512 + with_mask_type: true + condition_on_adapt: + - space_group + cutoff: 7.0 + emb_size_atom: 512 + emb_size_edge: 512 + latent_dim: 512 + max_cell_images_per_dim: 5 + max_neighbors: 50 + num_blocks: 4 + num_targets: 1 + otf_graph: true + regress_stress: true + scale_file: /scratch/amlt_code/mattergen/common/gemnet/gemnet-dT.json + hidden_dim: 512 + property_embeddings: {} + property_embeddings_adapt: + space_group: + _target_: mattergen.property_embeddings.PropertyEmbedding + conditional_embedding_module: + _target_: mattergen.property_embeddings.SpaceGroupEmbeddingVector + hidden_dim: 512 + name: space_group + scaler: + _target_: torch.nn.Identity + unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: 512 + pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + dropout_fields_iid: false + p_unconditional: 0.2 + optimizer_partial: + _partial_: true + _target_: torch.optim.Adam + lr: 5.0e-06 + scheduler_partials: + - frequency: 1 + interval: epoch + monitor: loss_train + scheduler: + _partial_: true + _target_: torch.optim.lr_scheduler.ReduceLROnPlateau + factor: 0.6 + min_lr: 1.0e-06 + patience: 100 + verbose: true + strict: true +trainer: + _target_: pytorch_lightning.Trainer + accelerator: gpu + accumulate_grad_batches: 1 + callbacks: + - _target_: pytorch_lightning.callbacks.LearningRateMonitor + log_momentum: false + logging_interval: step + - _target_: pytorch_lightning.callbacks.ModelCheckpoint + every_n_epochs: 1 + filename: '{epoch}-{loss_val:.2f}' + mode: min + monitor: loss_val + save_last: true + save_top_k: 1 + verbose: false + - _target_: pytorch_lightning.callbacks.TQDMProgressBar + refresh_rate: 50 + - _target_: mattergen.common.data.callback.SetPropertyScalers + check_val_every_n_epoch: 1 + devices: 8 + gradient_clip_algorithm: value + gradient_clip_val: 0.5 + logger: + _target_: pytorch_lightning.loggers.WandbLogger + job_type: train_finetune + project: crystal-generation + settings: + _save_requirements: false + _target_: wandb.Settings + start_method: fork + max_epochs: 200 + num_nodes: 1 + precision: 32 + strategy: + _target_: pytorch_lightning.strategies.ddp.DDPStrategy + find_unused_parameters: true diff --git a/data/data-release/alex-mp/alex_mp_20.zip b/data/data-release/alex-mp/alex_mp_20.zip new file mode 100644 index 0000000000000000000000000000000000000000..7df2f43c02a11a05c488b2476f28f586e33cf2e4 --- /dev/null +++ b/data/data-release/alex-mp/alex_mp_20.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:449975d6083eddd23b73d60b543a89fb449a159b3dcec5d55e350eb7a71ca481 +size 134 diff --git a/data/data-release/alex-mp/reference_MP2020correction.gz b/data/data-release/alex-mp/reference_MP2020correction.gz new file mode 100644 index 0000000000000000000000000000000000000000..8191da6aabaaea74db506e4b5dbffd2d81698edd --- /dev/null +++ b/data/data-release/alex-mp/reference_MP2020correction.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c660071e14130853c4f3ce5b61c16b38c9e2b94fdb0e19e639fcde783cfacde6 +size 134 diff --git a/data/data-release/cifs/LICENSE.md b/data/data-release/cifs/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..6faa45102268da9ba592923f54cf866e96afc3f7 --- /dev/null +++ b/data/data-release/cifs/LICENSE.md @@ -0,0 +1,35 @@ +# Community Data License Agreement - Permissive - Version 2.0 + +This is the Community Data License Agreement - Permissive, Version 2.0 (the "agreement"). Data Provider(s) and Data Recipient(s) agree as follows: + +## 1. Provision of the Data + +1.1. A Data Recipient may use, modify, and share the Data made available by Data Provider(s) under this agreement if that Data Recipient follows the terms of this agreement. + +1.2. This agreement does not impose any restriction on a Data Recipient's use, modification, or sharing of any portions of the Data that are in the public domain or that may be used, modified, or shared under any other legal exception or limitation. + +## 2. Conditions for Sharing Data + +2.1. A Data Recipient may share Data, with or without modifications, so long as the Data Recipient makes available the text of this agreement with the shared Data. + +## 3. No Restrictions on Results + +3.1. This agreement does not impose any restriction or obligations with respect to the use, modification, or sharing of Results. + +## 4. No Warranty; Limitation of Liability + +4.1. All Data Recipients receive the Data subject to the following terms: + +THE DATA IS PROVIDED ON AN "AS IS" BASIS, WITHOUT REPRESENTATIONS, WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +NO DATA PROVIDER SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE DATA OR RESULTS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +## 5. Definitions + +5.1. "Data" means the material received by a Data Recipient under this agreement. + +5.2. "Data Provider" means any person who is the source of Data provided under this agreement and in reliance on a Data Recipient's agreement to its terms. + +5.3. "Data Recipient" means any person who receives Data directly or indirectly from a Data Provider and agrees to the terms of this agreement. + +5.4. "Results" means any outcome obtained by computational analysis of Data, including for example machine learning models and models' insights. \ No newline at end of file diff --git a/data/data-release/cifs/chemsys/Sr2VO4.cif b/data/data-release/cifs/chemsys/Sr2VO4.cif new file mode 100644 index 0000000000000000000000000000000000000000..87c8bc32c7d88f1bfdef7faea0d9e8ebe9ab2da3 --- /dev/null +++ b/data/data-release/cifs/chemsys/Sr2VO4.cif @@ -0,0 +1,33 @@ +# generated using pymatgen +data_Sr2VO4 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 3.96465000 +_cell_length_b 3.96465000 +_cell_length_c 6.80348000 +_cell_angle_alpha 106.94000000 +_cell_angle_beta 106.94000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Sr2VO4 +_chemical_formula_sum 'Sr2 V1 O4' +_cell_volume 97.43926415 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr1 1 0.35932000 0.35932000 0.71864000 1.0 + Sr Sr2 1 0.64068000 0.64068000 0.28136000 1.0 + V V1 1 0.00000000 0.00000000 0.00000000 1.0 + O O1 1 0.84364000 0.84364000 0.68728000 1.0 + O O2 1 0.15636000 0.15636000 0.31272000 1.0 + O O3 1 0.00000000 0.50000000 0.00000000 1.0 + O O4 1 0.50000000 0.00000000 0.00000000 1.0 diff --git a/data/data-release/cifs/chemsys/Sr2VO4_symmetrized.cif b/data/data-release/cifs/chemsys/Sr2VO4_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..8fa3e4d0b76ab568b09e4c23ead71e58d836bf71 --- /dev/null +++ b/data/data-release/cifs/chemsys/Sr2VO4_symmetrized.cif @@ -0,0 +1,61 @@ +# generated using pymatgen +data_Sr2VO4 +_symmetry_space_group_name_H-M I4/mmm +_cell_length_a 3.96465000 +_cell_length_b 3.96465000 +_cell_length_c 12.39807570 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 139 +_chemical_formula_structural Sr2VO4 +_chemical_formula_sum 'Sr4 V2 O8' +_cell_volume 194.87852831 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y, x, z' + 4 'y, -x, -z' + 5 '-x, -y, z' + 6 'x, y, -z' + 7 'y, -x, z' + 8 '-y, x, -z' + 9 'x, -y, -z' + 10 '-x, y, z' + 11 '-y, -x, -z' + 12 'y, x, z' + 13 '-x, y, -z' + 14 'x, -y, z' + 15 'y, x, -z' + 16 '-y, -x, z' + 17 'x+1/2, y+1/2, z+1/2' + 18 '-x+1/2, -y+1/2, -z+1/2' + 19 '-y+1/2, x+1/2, z+1/2' + 20 'y+1/2, -x+1/2, -z+1/2' + 21 '-x+1/2, -y+1/2, z+1/2' + 22 'x+1/2, y+1/2, -z+1/2' + 23 'y+1/2, -x+1/2, z+1/2' + 24 '-y+1/2, x+1/2, -z+1/2' + 25 'x+1/2, -y+1/2, -z+1/2' + 26 '-x+1/2, y+1/2, z+1/2' + 27 '-y+1/2, -x+1/2, -z+1/2' + 28 'y+1/2, x+1/2, z+1/2' + 29 '-x+1/2, y+1/2, -z+1/2' + 30 'x+1/2, -y+1/2, z+1/2' + 31 'y+1/2, x+1/2, -z+1/2' + 32 '-y+1/2, -x+1/2, z+1/2' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr0 4 0.00000000 0.00000000 0.35932000 1.0 + V V1 2 0.00000000 0.00000000 0.00000000 1.0 + O O2 4 0.00000000 0.00000000 0.15636000 1.0 + O O3 4 0.00000000 0.50000000 0.00000000 1.0 diff --git a/data/data-release/cifs/chemsys/Sr3V2O8.cif b/data/data-release/cifs/chemsys/Sr3V2O8.cif new file mode 100644 index 0000000000000000000000000000000000000000..269a6fe21d9a7c8e26a1c100cfa4c9c57f313d10 --- /dev/null +++ b/data/data-release/cifs/chemsys/Sr3V2O8.cif @@ -0,0 +1,39 @@ +# generated using pymatgen +data_Sr3V2O8 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 5.72412000 +_cell_length_b 5.72717000 +_cell_length_c 7.51409000 +_cell_angle_alpha 67.76830000 +_cell_angle_beta 67.68030000 +_cell_angle_gamma 60.15960000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Sr3V2O8 +_chemical_formula_sum 'Sr3 V2 O8' +_cell_volume 192.08149380 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr1 1 0.79832000 0.79943000 0.60317000 1.0 + Sr Sr2 1 0.20168000 0.20057000 0.39683000 1.0 + Sr Sr3 1 0.00000000 0.00000000 0.00000000 1.0 + V V1 1 0.40749000 0.40438000 0.78106000 1.0 + V V2 1 0.59251000 0.59562000 0.21894000 1.0 + O O1 1 0.31376000 0.22351000 0.69664000 1.0 + O O2 1 0.76617000 0.31011000 0.69727000 1.0 + O O3 1 0.22754000 0.76206000 0.69713000 1.0 + O O4 1 0.68624000 0.77649000 0.30336000 1.0 + O O5 1 0.32254000 0.31971000 0.03504000 1.0 + O O6 1 0.67746000 0.68029000 0.96496000 1.0 + O O7 1 0.23383000 0.68989000 0.30273000 1.0 + O O8 1 0.77246000 0.23794000 0.30287000 1.0 diff --git a/data/data-release/cifs/chemsys/Sr3V2O8_symmetrized.cif b/data/data-release/cifs/chemsys/Sr3V2O8_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..602f5e67f6e07c05ee9d79c44469bfe4e1b57366 --- /dev/null +++ b/data/data-release/cifs/chemsys/Sr3V2O8_symmetrized.cif @@ -0,0 +1,48 @@ +# generated using pymatgen +data_Sr3V2O8 +_symmetry_space_group_name_H-M R-3 +_cell_length_a 5.73178616 +_cell_length_b 5.73178616 +_cell_length_c 20.26433495 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 148 +_chemical_formula_structural Sr3V2O8 +_chemical_formula_sum 'Sr9 V6 O24' +_cell_volume 576.55792558 +_cell_formula_units_Z 3 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y, x-y, z' + 4 'y, -x+y, -z' + 5 '-x+y, -x, z' + 6 'x-y, x, -z' + 7 'x+2/3, y+1/3, z+1/3' + 8 '-x+2/3, -y+1/3, -z+1/3' + 9 '-y+2/3, x-y+1/3, z+1/3' + 10 'y+2/3, -x+y+1/3, -z+1/3' + 11 '-x+y+2/3, -x+1/3, z+1/3' + 12 'x-y+2/3, x+1/3, -z+1/3' + 13 'x+1/3, y+2/3, z+2/3' + 14 '-x+1/3, -y+2/3, -z+2/3' + 15 '-y+1/3, x-y+2/3, z+2/3' + 16 'y+1/3, -x+y+2/3, -z+2/3' + 17 '-x+y+1/3, -x+2/3, z+2/3' + 18 'x-y+1/3, x+2/3, -z+2/3' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr0 6 0.00000000 0.00000000 0.20030000 1.0 + Sr Sr1 3 0.00000000 0.00000000 0.00000000 1.0 + V V2 6 0.00000000 0.00000000 0.40707000 1.0 + O O3 18 0.00245333 0.45765667 0.23145667 1.0 + O O4 6 0.00000000 0.00000000 0.32241000 1.0 diff --git a/data/data-release/cifs/chemsys/SrV2O4.cif b/data/data-release/cifs/chemsys/SrV2O4.cif new file mode 100644 index 0000000000000000000000000000000000000000..4f0b07a807151940ff9fbf49eec9ee3cec859150 --- /dev/null +++ b/data/data-release/cifs/chemsys/SrV2O4.cif @@ -0,0 +1,40 @@ +# generated using pymatgen +data_SrV2O4 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 5.32206000 +_cell_length_b 6.06570000 +_cell_length_c 6.79311000 +_cell_angle_alpha 115.76000000 +_cell_angle_beta 103.70800000 +_cell_angle_gamma 90.79170000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural SrV2O4 +_chemical_formula_sum 'Sr2 V4 O8' +_cell_volume 190.15914603 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr1 1 0.29723000 0.24339000 0.98897000 1.0 + Sr Sr2 1 0.70277000 0.75661000 0.01103000 1.0 + V V1 1 0.50000000 0.00000000 0.50000000 1.0 + V V2 1 0.50000000 0.50000000 0.50000000 1.0 + V V3 1 0.99986000 0.25458000 0.50018000 1.0 + V V4 1 0.00014000 0.74542000 0.49982000 1.0 + O O1 1 0.39916000 0.35266000 0.69498000 1.0 + O O2 1 0.39997000 0.84777000 0.69415000 1.0 + O O3 1 0.88630000 0.58548000 0.67681000 1.0 + O O4 1 0.11340000 0.91515000 0.32502000 1.0 + O O5 1 0.11370000 0.41452000 0.32319000 1.0 + O O6 1 0.88660000 0.08485000 0.67498000 1.0 + O O7 1 0.60003000 0.15223000 0.30585000 1.0 + O O8 1 0.60084000 0.64734000 0.30502000 1.0 diff --git a/data/data-release/cifs/chemsys/SrV2O4_symmetrized.cif b/data/data-release/cifs/chemsys/SrV2O4_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..c14d05c0895b711e5a5e18285da332f42c82a58f --- /dev/null +++ b/data/data-release/cifs/chemsys/SrV2O4_symmetrized.cif @@ -0,0 +1,40 @@ +# generated using pymatgen +data_SrV2O4 +_symmetry_space_group_name_H-M C2/m +_cell_length_a 12.23711449 +_cell_length_b 6.06570000 +_cell_length_c 5.32206000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 105.66119862 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 12 +_chemical_formula_structural SrV2O4 +_chemical_formula_sum 'Sr4 V8 O16' +_cell_volume 380.37286526 +_cell_formula_units_Z 4 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-x, y, -z' + 4 'x, -y, z' + 5 'x+1/2, y+1/2, z' + 6 '-x+1/2, -y+1/2, -z' + 7 '-x+1/2, y+1/2, -z' + 8 'x+1/2, -y+1/2, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr0 4 0.24558000 0.00000000 0.29723000 1.0 + V V1 4 0.00000000 0.25339500 0.00000000 1.0 + V V2 2 0.00000000 0.00000000 0.50000000 1.0 + V V3 2 0.00000000 0.50000000 0.50000000 1.0 + O O4 8 0.09858500 0.25407500 0.39916000 1.0 + O O5 4 0.08639500 0.00000000 0.88660000 1.0 + O O6 4 0.08950000 0.50000000 0.88630000 1.0 diff --git a/data/data-release/cifs/chemsys/SrV2O6.cif b/data/data-release/cifs/chemsys/SrV2O6.cif new file mode 100644 index 0000000000000000000000000000000000000000..4ecb482a8e6cb6c4f12fbab70789ebcd192ac800 --- /dev/null +++ b/data/data-release/cifs/chemsys/SrV2O6.cif @@ -0,0 +1,35 @@ +# generated using pymatgen +data_SrV2O6 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 3.78110000 +_cell_length_b 5.87562000 +_cell_length_c 7.42507000 +_cell_angle_alpha 101.11100000 +_cell_angle_beta 90.07430000 +_cell_angle_gamma 108.64000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural SrV2O6 +_chemical_formula_sum 'Sr1 V2 O6' +_cell_volume 153.02377039 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr1 1 0.45571000 0.74499000 0.36646000 1.0 + V V1 1 0.20762000 0.24997000 0.70002000 1.0 + V V2 1 0.70384000 0.24084000 0.03353000 1.0 + O O1 1 0.21440000 0.26230000 0.96862000 1.0 + O O2 1 0.08321000 0.00080000 0.52151000 1.0 + O O3 1 0.82839000 0.48974000 0.21229000 1.0 + O O4 1 0.69748000 0.22918000 0.76522000 1.0 + O O5 1 0.57683000 0.98440000 0.11398000 1.0 + O O6 1 0.33439000 0.50598000 0.61906000 1.0 diff --git a/data/data-release/cifs/chemsys/SrV2O6_symmetrized.cif b/data/data-release/cifs/chemsys/SrV2O6_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..34e77c648f42ed40d185813f4646e2f1375ae877 --- /dev/null +++ b/data/data-release/cifs/chemsys/SrV2O6_symmetrized.cif @@ -0,0 +1,38 @@ +# generated using pymatgen +data_SrV2O6 +_symmetry_space_group_name_H-M C2/m +_cell_length_a 11.13486304 +_cell_length_b 3.78110000 +_cell_length_c 7.42507000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 101.76033251 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 12 +_chemical_formula_structural SrV2O6 +_chemical_formula_sum 'Sr2 V4 O12' +_cell_volume 306.04843361 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-x, y, -z' + 4 'x, -y, z' + 5 'x+1/2, y+1/2, z' + 6 '-x+1/2, -y+1/2, -z' + 7 '-x+1/2, y+1/2, -z' + 8 'x+1/2, -y+1/2, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr0 2 0.00000000 0.00000000 0.00000000 1.0 + V V1 4 0.24751000 0.00000000 0.66644000 1.0 + O O2 4 0.11970500 0.00000000 0.74752000 1.0 + O O3 4 0.12790500 0.50000000 0.15505000 1.0 + O O4 4 0.24134500 0.00000000 0.39784000 1.0 diff --git a/data/data-release/cifs/experimental/Ta0.66666667Cr1.33333333O4.cif b/data/data-release/cifs/experimental/Ta0.66666667Cr1.33333333O4.cif new file mode 100644 index 0000000000000000000000000000000000000000..eb30860b77ec92534ffd44f040f114f4eaab4131 --- /dev/null +++ b/data/data-release/cifs/experimental/Ta0.66666667Cr1.33333333O4.cif @@ -0,0 +1,34 @@ +# generated using pymatgen +data_Ta0.66666667Cr1.33333333O4 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.63975247 +_cell_length_b 4.63975247 +_cell_length_c 3.03638782 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Ta0.66666667Cr1.33333333O4 +_chemical_formula_sum 'Ta0.66666667 Cr1.33333333 O4' +_cell_volume 65.36524057 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Ta Cr1 1 0.00000000 0.00000000 0.00000000 0.3333333333333333 + Cr Cr1 1 0.00000000 0.00000000 0.00000000 0.6666666666666666 + Ta Cr1 1 0.50000000 0.50000000 0.50000000 0.3333333333333333 + Cr Cr1 1 0.50000000 0.50000000 0.50000000 0.6666666666666666 + O O2 1 0.19655223 0.19655223 0.50000000 1.0 + O O2 1 0.80344777 0.80344777 0.50000000 1.0 + O O2 1 0.30344777 0.69655223 0.00000000 1.0 + O O2 1 0.69655223 0.30344777 0.00000000 1.0 diff --git a/data/data-release/cifs/experimental/Ta0.66666667Cr1.33333333O4_symmetrized.cif b/data/data-release/cifs/experimental/Ta0.66666667Cr1.33333333O4_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..a332774766e42fde0721cc788749dcdaabc6a7a4 --- /dev/null +++ b/data/data-release/cifs/experimental/Ta0.66666667Cr1.33333333O4_symmetrized.cif @@ -0,0 +1,44 @@ +# generated using pymatgen +data_Ta0.66666667Cr1.33333333O4 +_symmetry_space_group_name_H-M P4_2/mnm +_cell_length_a 4.63975247 +_cell_length_b 4.63975247 +_cell_length_c 3.03638782 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 136 +_chemical_formula_structural Ta0.66666667Cr1.33333333O4 +_chemical_formula_sum 'Ta0.66666667 Cr1.33333333 O4' +_cell_volume 65.36524057 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y+1/2, x+1/2, z+1/2' + 4 'y+1/2, -x+1/2, -z+1/2' + 5 '-x, -y, z' + 6 'x, y, -z' + 7 'y+1/2, -x+1/2, z+1/2' + 8 '-y+1/2, x+1/2, -z+1/2' + 9 'x+1/2, -y+1/2, -z+1/2' + 10 '-x+1/2, y+1/2, z+1/2' + 11 '-y, -x, -z' + 12 'y, x, z' + 13 '-x+1/2, y+1/2, -z+1/2' + 14 'x+1/2, -y+1/2, z+1/2' + 15 'y, x, -z' + 16 '-y, -x, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Ta Ta0 2 0.00000000 0.00000000 0.00000000 0.3333333333333333 + Cr Cr1 2 0.00000000 0.00000000 0.00000000 0.6666666666666666 + O O2 4 0.19655223 0.19655223 0.50000000 1.0 diff --git a/data/data-release/cifs/experimental/TaCr2O6.cif b/data/data-release/cifs/experimental/TaCr2O6.cif new file mode 100644 index 0000000000000000000000000000000000000000..c8eeb7c017d055c19a60a4bc6560343d63d6ccfd --- /dev/null +++ b/data/data-release/cifs/experimental/TaCr2O6.cif @@ -0,0 +1,44 @@ +# generated using pymatgen +data_TaCr2O6 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.63975247 +_cell_length_b 4.63975247 +_cell_length_c 9.10916345 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural TaCr2O6 +_chemical_formula_sum 'Ta2 Cr4 O12' +_cell_volume 196.09572151 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Ta Ta0 1 0.00000000 0.00000000 0.00000000 1.0 + Ta Ta0 1 0.50000000 0.50000000 0.50000000 1.0 + Cr Cr1 1 0.00000000 0.00000000 0.33285057 1.0 + Cr Cr1 1 0.00000000 0.00000000 0.66714943 1.0 + Cr Cr1 1 0.50000000 0.50000000 0.83285057 1.0 + Cr Cr1 1 0.50000000 0.50000000 0.16714943 1.0 + O O2 1 0.19756912 0.19756912 0.16559713 1.0 + O O2 1 0.80243088 0.80243088 0.83440287 1.0 + O O2 1 0.30243088 0.69756912 0.66559713 1.0 + O O2 1 0.69756912 0.30243088 0.33440287 1.0 + O O2 1 0.80243088 0.80243088 0.16559713 1.0 + O O2 1 0.19756912 0.19756912 0.83440287 1.0 + O O2 1 0.69756912 0.30243088 0.66559713 1.0 + O O2 1 0.30243088 0.69756912 0.33440287 1.0 + O O3 1 0.19464118 0.19464118 0.50000000 1.0 + O O3 1 0.80535882 0.80535882 0.50000000 1.0 + O O3 1 0.30535882 0.69464118 0.00000000 1.0 + O O3 1 0.69464118 0.30535882 0.00000000 1.0 diff --git a/data/data-release/cifs/experimental/TaCr2O6_symmetrized.cif b/data/data-release/cifs/experimental/TaCr2O6_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..325c56e293f31e7fca633b1fd5d54af606205841 --- /dev/null +++ b/data/data-release/cifs/experimental/TaCr2O6_symmetrized.cif @@ -0,0 +1,45 @@ +# generated using pymatgen +data_TaCr2O6 +_symmetry_space_group_name_H-M P4_2/mnm +_cell_length_a 4.63975247 +_cell_length_b 4.63975247 +_cell_length_c 9.10916345 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 136 +_chemical_formula_structural TaCr2O6 +_chemical_formula_sum 'Ta2 Cr4 O12' +_cell_volume 196.09572151 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y+1/2, x+1/2, z+1/2' + 4 'y+1/2, -x+1/2, -z+1/2' + 5 '-x, -y, z' + 6 'x, y, -z' + 7 'y+1/2, -x+1/2, z+1/2' + 8 '-y+1/2, x+1/2, -z+1/2' + 9 'x+1/2, -y+1/2, -z+1/2' + 10 '-x+1/2, y+1/2, z+1/2' + 11 '-y, -x, -z' + 12 'y, x, z' + 13 '-x+1/2, y+1/2, -z+1/2' + 14 'x+1/2, -y+1/2, z+1/2' + 15 'y, x, -z' + 16 '-y, -x, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Ta Ta0 2 0.00000000 0.00000000 0.00000000 1.0 + Cr Cr1 4 0.00000000 0.00000000 0.33285057 1.0 + O O2 8 0.19756912 0.19756912 0.16559713 1.0 + O O3 4 0.19464118 0.19464118 0.50000000 1.0 diff --git a/data/data-release/cifs/joint_mag_hhi/Fe8Au.cif b/data/data-release/cifs/joint_mag_hhi/Fe8Au.cif new file mode 100644 index 0000000000000000000000000000000000000000..d5b6028f363b2131af8d8ef4a148196a43b546f6 --- /dev/null +++ b/data/data-release/cifs/joint_mag_hhi/Fe8Au.cif @@ -0,0 +1,35 @@ +# generated using pymatgen +data_Fe8Au +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.11732000 +_cell_length_b 4.83558000 +_cell_length_c 6.61890000 +_cell_angle_alpha 81.76470000 +_cell_angle_beta 71.87880000 +_cell_angle_gamma 64.80300000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Fe8Au +_chemical_formula_sum 'Fe8 Au1' +_cell_volume 113.31767108 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Fe Fe1 1 0.00249000 0.83783000 0.15719000 1.0 + Fe Fe2 1 0.34471000 0.92559000 0.38499000 1.0 + Fe Fe3 1 0.33647000 0.27250000 0.05457000 1.0 + Fe Fe4 1 0.99751000 0.16217000 0.84281000 1.0 + Fe Fe5 1 0.66353000 0.72750000 0.94543000 1.0 + Fe Fe6 1 0.65529000 0.07441000 0.61501000 1.0 + Fe Fe7 1 0.31511000 0.62773000 0.74206000 1.0 + Fe Fe8 1 0.68489000 0.37227000 0.25794000 1.0 + Au Au1 1 0.00000000 0.50000000 0.50000000 1.0 diff --git a/data/data-release/cifs/joint_mag_hhi/Fe8Au_symmetrized.cif b/data/data-release/cifs/joint_mag_hhi/Fe8Au_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..98c344eb034530c4e67eadd43c7332b6c04d3785 --- /dev/null +++ b/data/data-release/cifs/joint_mag_hhi/Fe8Au_symmetrized.cif @@ -0,0 +1,38 @@ +# generated using pymatgen +data_Fe8Au +_symmetry_space_group_name_H-M C2/m +_cell_length_a 8.75094279 +_cell_length_b 4.11732000 +_cell_length_c 7.61732314 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 124.33400420 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 12 +_chemical_formula_structural Fe8Au +_chemical_formula_sum 'Fe16 Au2' +_cell_volume 226.63534216 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-x, y, -z' + 4 'x, -y, z' + 5 'x+1/2, y+1/2, z' + 6 '-x+1/2, -y+1/2, -z' + 7 '-x+1/2, y+1/2, -z' + 8 'x+1/2, -y+1/2, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Fe Fe0 4 0.00249000 0.00000000 0.84281000 1.0 + Fe Fe1 4 0.15529000 0.50000000 0.38499000 1.0 + Fe Fe2 4 0.16353500 0.50000000 0.05457000 1.0 + Fe Fe3 4 0.18489500 0.50000000 0.74206000 1.0 + Au Au4 2 0.00000000 0.00000000 0.50000000 1.0 diff --git a/data/data-release/cifs/joint_mag_hhi/MgMn4Fe3O8.cif b/data/data-release/cifs/joint_mag_hhi/MgMn4Fe3O8.cif new file mode 100644 index 0000000000000000000000000000000000000000..b98ff579556c0efbefae7323e246ac8332ad174c --- /dev/null +++ b/data/data-release/cifs/joint_mag_hhi/MgMn4Fe3O8.cif @@ -0,0 +1,42 @@ +# generated using pymatgen +data_MgMn4Fe3O8 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 6.23428000 +_cell_length_b 6.27508000 +_cell_length_c 6.27016000 +_cell_angle_alpha 88.68040000 +_cell_angle_beta 60.59250000 +_cell_angle_gamma 119.18200000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural MgMn4Fe3O8 +_chemical_formula_sum 'Mg1 Mn4 Fe3 O8' +_cell_volume 175.10593603 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mg Mg1 1 0.10320000 0.98096000 0.78987000 1.0 + Mn Mn1 1 0.60337000 0.48109000 0.78966000 1.0 + Mn Mn2 1 0.10328000 0.98136000 0.28970000 1.0 + Mn Mn3 1 0.60309000 0.48113000 0.28985000 1.0 + Mn Mn4 1 0.10258000 0.48085000 0.79012000 1.0 + Fe Fe1 1 0.60292000 0.98095000 0.28984000 1.0 + Fe Fe2 1 0.10355000 0.48137000 0.28948000 1.0 + Fe Fe3 1 0.60313000 0.98117000 0.78982000 1.0 + O O1 1 0.10051000 0.72232000 0.04797000 1.0 + O O2 1 0.10587000 0.24001000 0.53160000 1.0 + O O3 1 0.58586000 0.21497000 0.55713000 1.0 + O O4 1 0.60240000 0.23478000 0.03947000 1.0 + O O5 1 0.08715000 0.21496000 0.03943000 1.0 + O O6 1 0.60335000 0.72740000 0.54035000 1.0 + O O7 1 0.11913000 0.74709000 0.54018000 1.0 + O O8 1 0.62078000 0.74734000 0.02221000 1.0 diff --git a/data/data-release/cifs/joint_mag_hhi/MgMn4Fe3O8_symmetrized.cif b/data/data-release/cifs/joint_mag_hhi/MgMn4Fe3O8_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..89b52e1930c5e547cceeb6adf555b58c6d3995ad --- /dev/null +++ b/data/data-release/cifs/joint_mag_hhi/MgMn4Fe3O8_symmetrized.cif @@ -0,0 +1,39 @@ +# generated using pymatgen +data_MgMn4Fe3O8 +_symmetry_space_group_name_H-M P-1 +_cell_length_a 6.23428000 +_cell_length_b 6.26167648 +_cell_length_c 6.27016000 +_cell_angle_alpha 119.30159630 +_cell_angle_beta 119.40750000 +_cell_angle_gamma 90.87738125 +_symmetry_Int_Tables_number 2 +_chemical_formula_structural MgMn4Fe3O8 +_chemical_formula_sum 'Mg1 Mn4 Fe3 O8' +_cell_volume 175.10593603 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mg Mg0 1 0.00000000 0.00000000 0.00000000 1.0 + Mn Mn1 1 0.00000000 0.00000000 0.50000000 1.0 + Mn Mn2 1 0.00000000 0.50000000 0.00000000 1.0 + Mn Mn3 1 0.00000000 0.50000000 0.50000000 1.0 + Mn Mn4 1 0.50000000 0.50000000 0.50000000 1.0 + Fe Fe5 1 0.50000000 0.00000000 0.00000000 1.0 + Fe Fe6 1 0.50000000 0.00000000 0.50000000 1.0 + Fe Fe7 1 0.50000000 0.50000000 0.00000000 1.0 + O O8 2 0.24538000 0.74618000 0.49658000 1.0 + O O9 2 0.24865000 0.76599000 0.99873000 1.0 + O O10 2 0.25005000 0.23400000 0.48356000 1.0 + O O11 2 0.25595000 0.25864000 0.00054000 1.0 diff --git a/data/data-release/cifs/joint_mag_hhi/Mn2Fe3O5.cif b/data/data-release/cifs/joint_mag_hhi/Mn2Fe3O5.cif new file mode 100644 index 0000000000000000000000000000000000000000..e2d2896ace531f0a0bb491080be523a5b452d8a8 --- /dev/null +++ b/data/data-release/cifs/joint_mag_hhi/Mn2Fe3O5.cif @@ -0,0 +1,46 @@ +# generated using pymatgen +data_Mn2Fe3O5 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 5.50230000 +_cell_length_b 5.47512000 +_cell_length_c 8.24408000 +_cell_angle_alpha 71.33730000 +_cell_angle_beta 82.96680000 +_cell_angle_gamma 69.54000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Mn2Fe3O5 +_chemical_formula_sum 'Mn4 Fe6 O10' +_cell_volume 220.44084459 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mn Mn1 1 0.24469000 0.99172000 0.76556000 1.0 + Mn Mn2 1 0.24625000 0.59180000 0.56158000 1.0 + Mn Mn3 1 0.74631000 0.09155000 0.56184000 1.0 + Mn Mn4 1 0.24863000 0.19141000 0.35759000 1.0 + Fe Fe1 1 0.24773000 0.39496000 0.96082000 1.0 + Fe Fe2 1 0.74356000 0.88970000 0.96233000 1.0 + Fe Fe3 1 0.74913000 0.29359000 0.16136000 1.0 + Fe Fe4 1 0.74893000 0.69100000 0.35740000 1.0 + Fe Fe5 1 0.74366000 0.49308000 0.76538000 1.0 + Fe Fe6 1 0.24477000 0.78875000 0.16279000 1.0 + O O1 1 0.98668000 0.75300000 0.76510000 1.0 + O O2 1 0.48255000 0.25076000 0.76801000 1.0 + O O3 1 0.01024000 0.93230000 0.35545000 1.0 + O O4 1 0.50299000 0.83061000 0.56909000 1.0 + O O5 1 0.50719000 0.43039000 0.35836000 1.0 + O O6 1 0.51029000 0.02392000 0.16498000 1.0 + O O7 1 0.98100000 0.15990000 0.95827000 1.0 + O O8 1 0.99076000 0.35157000 0.55441000 1.0 + O O9 1 0.00776000 0.53535000 0.15381000 1.0 + O O10 1 0.48537000 0.64941000 0.96978000 1.0 diff --git a/data/data-release/cifs/joint_mag_hhi/Mn2Fe3O5_symmetrized.cif b/data/data-release/cifs/joint_mag_hhi/Mn2Fe3O5_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..b4ceda567c7b7f31ba82b93ad160361b5fd4fe18 --- /dev/null +++ b/data/data-release/cifs/joint_mag_hhi/Mn2Fe3O5_symmetrized.cif @@ -0,0 +1,38 @@ +# generated using pymatgen +data_Mn2Fe3O5 +_symmetry_space_group_name_H-M P-1 +_cell_length_a 5.47512000 +_cell_length_b 5.50230000 +_cell_length_c 8.24408000 +_cell_angle_alpha 82.96680000 +_cell_angle_beta 71.33730000 +_cell_angle_gamma 69.54000000 +_symmetry_Int_Tables_number 2 +_chemical_formula_structural Mn2Fe3O5 +_chemical_formula_sum 'Mn4 Fe6 O10' +_cell_volume 220.44084459 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mn Mn0 2 0.40015500 0.49803000 0.20398500 1.0 + Mn Mn1 1 0.00000000 0.50000000 0.00000000 1.0 + Mn Mn2 1 0.50000000 0.00000000 0.00000000 1.0 + Fe Fe3 2 0.09943500 0.00227000 0.79582500 1.0 + Fe Fe4 2 0.19660500 0.49893000 0.60075500 1.0 + Fe Fe5 2 0.29813500 0.99690000 0.40075500 1.0 + O O6 2 0.05621500 0.73890000 0.40776500 1.0 + O O7 2 0.16143500 0.24002000 0.20352500 1.0 + O O8 2 0.23904500 0.75633000 0.00751500 1.0 + O O9 2 0.34080500 0.26411000 0.79356500 1.0 + O O10 2 0.43235500 0.76363000 0.60340500 1.0 diff --git a/data/data-release/cifs/joint_mag_hhi/MnFe3O4.cif b/data/data-release/cifs/joint_mag_hhi/MnFe3O4.cif new file mode 100644 index 0000000000000000000000000000000000000000..f66c767f3b8f13623beccdded9d240a3cd610500 --- /dev/null +++ b/data/data-release/cifs/joint_mag_hhi/MnFe3O4.cif @@ -0,0 +1,34 @@ +# generated using pymatgen +data_MnFe3O4 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 3.16722000 +_cell_length_b 3.17168000 +_cell_length_c 8.62096000 +_cell_angle_alpha 90.05770000 +_cell_angle_beta 89.65480000 +_cell_angle_gamma 89.93640000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural MnFe3O4 +_chemical_formula_sum 'Mn1 Fe3 O4' +_cell_volume 86.59939377 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mn Mn1 1 0.36624000 0.50372000 0.18560000 1.0 + Fe Fe1 1 0.86799000 0.00412000 0.43880000 1.0 + Fe Fe2 1 0.86782000 0.00426000 0.93232000 1.0 + Fe Fe3 1 0.37083000 0.50478000 0.68555000 1.0 + O O1 1 0.86938000 0.00537000 0.68559000 1.0 + O O2 1 0.36713000 0.50447000 0.93032000 1.0 + O O3 1 0.36741000 0.50431000 0.44077000 1.0 + O O4 1 0.86584000 0.00365000 0.18552000 1.0 diff --git a/data/data-release/cifs/joint_mag_hhi/MnFe3O4_symmetrized.cif b/data/data-release/cifs/joint_mag_hhi/MnFe3O4_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..fd0e16f5196f8be1be473d5c8631036f2cbf1d8e --- /dev/null +++ b/data/data-release/cifs/joint_mag_hhi/MnFe3O4_symmetrized.cif @@ -0,0 +1,47 @@ +# generated using pymatgen +data_MnFe3O4 +_symmetry_space_group_name_H-M P4/mmm +_cell_length_a 3.16945000 +_cell_length_b 3.16945000 +_cell_length_c 8.62096000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 123 +_chemical_formula_structural MnFe3O4 +_chemical_formula_sum 'Mn1 Fe3 O4' +_cell_volume 86.60110626 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y, x, z' + 4 'y, -x, -z' + 5 '-x, -y, z' + 6 'x, y, -z' + 7 'y, -x, z' + 8 '-y, x, -z' + 9 'x, -y, -z' + 10 '-x, y, z' + 11 '-y, -x, -z' + 12 'y, x, z' + 13 '-x, y, -z' + 14 'x, -y, z' + 15 'y, x, -z' + 16 '-y, -x, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mn Mn0 1 0.50000000 0.50000000 0.00000000 1.0 + Fe Fe1 2 0.00000000 0.00000000 0.25320000 1.0 + Fe Fe2 1 0.50000000 0.50000000 0.50000000 1.0 + O O3 2 0.50000000 0.50000000 0.25528000 1.0 + O O4 1 0.00000000 0.00000000 0.00000000 1.0 + O O5 1 0.00000000 0.00000000 0.50000000 1.0 diff --git a/data/data-release/cifs/single_prop/band_gap/TlNO3.cif b/data/data-release/cifs/single_prop/band_gap/TlNO3.cif new file mode 100644 index 0000000000000000000000000000000000000000..63190b3ecc8a0678ae825d3d3edd6c8e7a5c855b --- /dev/null +++ b/data/data-release/cifs/single_prop/band_gap/TlNO3.cif @@ -0,0 +1,31 @@ +# generated using pymatgen +data_TlNO3 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.66793000 +_cell_length_b 4.66793000 +_cell_length_c 4.68451000 +_cell_angle_alpha 74.43760000 +_cell_angle_beta 74.43760000 +_cell_angle_gamma 74.42240000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural TlNO3 +_chemical_formula_sum 'Tl1 N1 O3' +_cell_volume 92.57711299 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Tl Tl1 1 0.96394000 0.96394000 0.69108000 1.0 + N N1 1 0.41520000 0.41520000 0.14164000 1.0 + O O1 1 0.54412000 0.15432000 0.26959000 1.0 + O O2 1 0.15432000 0.54412000 0.26959000 1.0 + O O3 1 0.54410000 0.54410000 0.88105000 1.0 diff --git a/data/data-release/cifs/single_prop/band_gap/TlNO3_symmetrized.cif b/data/data-release/cifs/single_prop/band_gap/TlNO3_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..7f3e2868a22c153d6671852d6b34ad49ea330452 --- /dev/null +++ b/data/data-release/cifs/single_prop/band_gap/TlNO3_symmetrized.cif @@ -0,0 +1,46 @@ +# generated using pymatgen +data_TlNO3 +_symmetry_space_group_name_H-M R3m +_cell_length_a 5.65142130 +_cell_length_b 5.65142130 +_cell_length_c 10.03460060 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 160 +_chemical_formula_structural TlNO3 +_chemical_formula_sum 'Tl3 N3 O9' +_cell_volume 277.55310557 +_cell_formula_units_Z 3 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-y, x-y, z' + 3 '-x+y, -x, z' + 4 '-y, -x, z' + 5 '-x+y, y, z' + 6 'x, x-y, z' + 7 'x+2/3, y+1/3, z+1/3' + 8 '-y+2/3, x-y+1/3, z+1/3' + 9 '-x+y+2/3, -x+1/3, z+1/3' + 10 '-y+2/3, -x+1/3, z+1/3' + 11 '-x+y+2/3, y+1/3, z+1/3' + 12 'x+2/3, x-y+1/3, z+1/3' + 13 'x+1/3, y+2/3, z+2/3' + 14 '-y+1/3, x-y+2/3, z+2/3' + 15 '-x+y+1/3, -x+2/3, z+2/3' + 16 '-y+1/3, -x+2/3, z+2/3' + 17 '-x+y+1/3, y+2/3, z+2/3' + 18 'x+1/3, x-y+2/3, z+2/3' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Tl Tl0 3 0.00000000 0.00000000 0.96394000 1.0 + N N1 3 0.00000000 0.00000000 0.41496667 1.0 + O O2 9 0.07402333 0.53701167 0.08029667 1.0 diff --git a/data/data-release/cifs/single_prop/band_gap/VBiO4.cif b/data/data-release/cifs/single_prop/band_gap/VBiO4.cif new file mode 100644 index 0000000000000000000000000000000000000000..92b8fbcd34043983d50f794d7201938035da3b21 --- /dev/null +++ b/data/data-release/cifs/single_prop/band_gap/VBiO4.cif @@ -0,0 +1,38 @@ +# generated using pymatgen +data_VBiO4 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.95898000 +_cell_length_b 4.96935000 +_cell_length_c 7.45609000 +_cell_angle_alpha 90.00580000 +_cell_angle_beta 90.04340000 +_cell_angle_gamma 94.94600000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural VBiO4 +_chemical_formula_sum 'V2 Bi2 O8' +_cell_volume 183.05550570 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + V V1 1 0.64134000 0.14298000 0.74979000 1.0 + V V2 1 0.35866000 0.85702000 0.25021000 1.0 + Bi Bi1 1 0.10145000 0.60399000 0.74988000 1.0 + Bi Bi2 1 0.89855000 0.39601000 0.25012000 1.0 + O O1 1 0.18967000 0.68708000 0.43130000 1.0 + O O2 1 0.29788000 0.18056000 0.74999000 1.0 + O O3 1 0.70212000 0.81944000 0.25001000 1.0 + O O4 1 0.81039000 0.31263000 0.93090000 1.0 + O O5 1 0.31869000 0.19960000 0.24979000 1.0 + O O6 1 0.68131000 0.80040000 0.75021000 1.0 + O O7 1 0.18961000 0.68737000 0.06910000 1.0 + O O8 1 0.81033000 0.31292000 0.56870000 1.0 diff --git a/data/data-release/cifs/single_prop/band_gap/VBiO4_symmetrized.cif b/data/data-release/cifs/single_prop/band_gap/VBiO4_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..f4dec2f12a059b67caec0b9758d87b4cffe1153b --- /dev/null +++ b/data/data-release/cifs/single_prop/band_gap/VBiO4_symmetrized.cif @@ -0,0 +1,45 @@ +# generated using pymatgen +data_VBiO4 +_symmetry_space_group_name_H-M Cmcm +_cell_length_a 7.31677442 +_cell_length_b 6.71093557 +_cell_length_c 7.45609000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 63 +_chemical_formula_structural VBiO4 +_chemical_formula_sum 'V4 Bi4 O16' +_cell_volume 366.11192634 +_cell_formula_units_Z 4 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-x, -y, z+1/2' + 4 'x, y, -z+1/2' + 5 'x, -y, -z' + 6 '-x, y, z' + 7 '-x, y, -z+1/2' + 8 'x, -y, z+1/2' + 9 'x+1/2, y+1/2, z' + 10 '-x+1/2, -y+1/2, -z' + 11 '-x+1/2, -y+1/2, z+1/2' + 12 'x+1/2, y+1/2, -z+1/2' + 13 'x+1/2, -y+1/2, -z' + 14 '-x+1/2, y+1/2, z' + 15 '-x+1/2, y+1/2, -z+1/2' + 16 'x+1/2, -y+1/2, z+1/2' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + V V0 4 0.00000000 0.14298000 0.75000000 1.0 + Bi Bi1 4 0.00000000 0.39646000 0.25000000 1.0 + O O2 8 0.00000000 0.31080500 0.56870000 1.0 + O O3 8 0.19052000 0.00996000 0.25000000 1.0 diff --git a/data/data-release/cifs/single_prop/bulk_modulus/Re3B.cif b/data/data-release/cifs/single_prop/bulk_modulus/Re3B.cif new file mode 100644 index 0000000000000000000000000000000000000000..6e39aa6cf00f7badbee4b243634de014616942af --- /dev/null +++ b/data/data-release/cifs/single_prop/bulk_modulus/Re3B.cif @@ -0,0 +1,30 @@ +# generated using pymatgen +data_Re3B +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 2.84803000 +_cell_length_b 2.84803000 +_cell_length_c 7.35951000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Re3B +_chemical_formula_sum 'Re3 B1' +_cell_volume 51.69739393 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Re Re1 1 0.00000000 0.00000000 0.00000000 1.0 + Re Re2 1 0.33333333 0.66666667 0.70186000 1.0 + Re Re3 1 0.33333333 0.66666667 0.29814000 1.0 + B B1 1 0.00000000 0.00000000 0.50000000 1.0 diff --git a/data/data-release/cifs/single_prop/bulk_modulus/Re3B2C.cif b/data/data-release/cifs/single_prop/bulk_modulus/Re3B2C.cif new file mode 100644 index 0000000000000000000000000000000000000000..987ee9226bfed30f34ca4408c45f0717a4173422 --- /dev/null +++ b/data/data-release/cifs/single_prop/bulk_modulus/Re3B2C.cif @@ -0,0 +1,32 @@ +# generated using pymatgen +data_Re3B2C +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 2.88906000 +_cell_length_b 2.88906000 +_cell_length_c 8.71333000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Re3B2C +_chemical_formula_sum 'Re3 B2 C1' +_cell_volume 62.98366331 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Re Re1 1 0.66666667 0.33333333 0.46160000 1.0 + Re Re2 1 0.66666667 0.33333333 0.78414000 1.0 + Re Re3 1 0.33333333 0.66666667 0.03376000 1.0 + B B1 1 0.66666667 0.33333333 0.20633000 1.0 + B B2 1 0.33333333 0.66666667 0.29075000 1.0 + C C1 1 0.33333333 0.66666667 0.62852000 1.0 diff --git a/data/data-release/cifs/single_prop/bulk_modulus/Re3B2C_symmetrized.cif b/data/data-release/cifs/single_prop/bulk_modulus/Re3B2C_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..f8095e280ea940034e3fad9d3b566a3c24725927 --- /dev/null +++ b/data/data-release/cifs/single_prop/bulk_modulus/Re3B2C_symmetrized.cif @@ -0,0 +1,37 @@ +# generated using pymatgen +data_Re3B2C +_symmetry_space_group_name_H-M P3m1 +_cell_length_a 2.88906000 +_cell_length_b 2.88906000 +_cell_length_c 8.71333000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 156 +_chemical_formula_structural Re3B2C +_chemical_formula_sum 'Re3 B2 C1' +_cell_volume 62.98366331 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-y, x-y, z' + 3 '-x+y, -x, z' + 4 '-y, -x, z' + 5 '-x+y, y, z' + 6 'x, x-y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Re Re0 1 0.33333333 0.66666667 0.03376000 1.0 + Re Re1 1 0.66666667 0.33333333 0.46160000 1.0 + Re Re2 1 0.66666667 0.33333333 0.78414000 1.0 + B B3 1 0.33333333 0.66666667 0.29075000 1.0 + B B4 1 0.66666667 0.33333333 0.20633000 1.0 + C C5 1 0.33333333 0.66666667 0.62852000 1.0 diff --git a/data/data-release/cifs/single_prop/bulk_modulus/Re3B_symmetrized.cif b/data/data-release/cifs/single_prop/bulk_modulus/Re3B_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..734e27713ee920c389c299081c791a8c05379089 --- /dev/null +++ b/data/data-release/cifs/single_prop/bulk_modulus/Re3B_symmetrized.cif @@ -0,0 +1,40 @@ +# generated using pymatgen +data_Re3B +_symmetry_space_group_name_H-M P-6m2 +_cell_length_a 2.84803000 +_cell_length_b 2.84803000 +_cell_length_c 7.35951000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 187 +_chemical_formula_structural Re3B +_chemical_formula_sum 'Re3 B1' +_cell_volume 51.69739393 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x+y, -x, -z' + 3 '-y, x-y, z' + 4 'x, y, -z' + 5 '-x+y, -x, z' + 6 '-y, x-y, -z' + 7 '-y, -x, -z' + 8 'x, x-y, z' + 9 '-x+y, y, -z' + 10 '-y, -x, z' + 11 'x, x-y, -z' + 12 '-x+y, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Re Re0 2 0.33333333 0.66666667 0.70186000 1.0 + Re Re1 1 0.00000000 0.00000000 0.00000000 1.0 + B B2 1 0.00000000 0.00000000 0.50000000 1.0 diff --git a/data/data-release/cifs/single_prop/magnetic_density/Gd2N.cif b/data/data-release/cifs/single_prop/magnetic_density/Gd2N.cif new file mode 100644 index 0000000000000000000000000000000000000000..64444d9981ad79bfca7be643df67172b28065c8b --- /dev/null +++ b/data/data-release/cifs/single_prop/magnetic_density/Gd2N.cif @@ -0,0 +1,29 @@ +# generated using pymatgen +data_Gd2N +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 3.55818000 +_cell_length_b 3.55818000 +_cell_length_c 6.00959000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Gd2N +_chemical_formula_sum 'Gd2 N1' +_cell_volume 65.89178972 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Gd Gd1 1 0.33333333 0.66666667 0.77529000 1.0 + Gd Gd2 1 0.66666667 0.33333333 0.22471000 1.0 + N N1 1 0.00000000 0.00000000 0.00000000 1.0 diff --git a/data/data-release/cifs/single_prop/magnetic_density/Gd2N_symmetrized.cif b/data/data-release/cifs/single_prop/magnetic_density/Gd2N_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..732c27635836f00fab9e521aa0a7861b4d578707 --- /dev/null +++ b/data/data-release/cifs/single_prop/magnetic_density/Gd2N_symmetrized.cif @@ -0,0 +1,39 @@ +# generated using pymatgen +data_Gd2N +_symmetry_space_group_name_H-M P-3m1 +_cell_length_a 3.55818000 +_cell_length_b 3.55818000 +_cell_length_c 6.00959000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 164 +_chemical_formula_structural Gd2N +_chemical_formula_sum 'Gd2 N1' +_cell_volume 65.89178972 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y, x-y, z' + 4 'y, -x+y, -z' + 5 '-x+y, -x, z' + 6 'x-y, x, -z' + 7 'y, x, -z' + 8 '-y, -x, z' + 9 'x-y, -y, -z' + 10 '-x+y, y, z' + 11 '-x, -x+y, -z' + 12 'x, x-y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Gd Gd0 2 0.33333333 0.66666667 0.77529000 1.0 + N N1 1 0.00000000 0.00000000 0.00000000 1.0 diff --git a/data/data-release/cifs/single_prop/magnetic_density/Gd6H2CN3.cif b/data/data-release/cifs/single_prop/magnetic_density/Gd6H2CN3.cif new file mode 100644 index 0000000000000000000000000000000000000000..96a25e9b2b871b74e915a0af8a1d0ebf379b3112 --- /dev/null +++ b/data/data-release/cifs/single_prop/magnetic_density/Gd6H2CN3.cif @@ -0,0 +1,38 @@ +# generated using pymatgen +data_Gd6H2CN3 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 6.12777000 +_cell_length_b 6.12777000 +_cell_length_c 6.19222000 +_cell_angle_alpha 99.64950000 +_cell_angle_beta 99.64950000 +_cell_angle_gamma 119.88400000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Gd6H2CN3 +_chemical_formula_sum 'Gd6 H2 C1 N3' +_cell_volume 189.97498821 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Gd Gd1 1 0.76629000 0.76629000 0.26031000 1.0 + Gd Gd2 1 0.91186000 0.59192000 0.73099000 1.0 + Gd Gd3 1 0.23371000 0.23371000 0.73969000 1.0 + Gd Gd4 1 0.59192000 0.91186000 0.73099000 1.0 + Gd Gd5 1 0.08814000 0.40808000 0.26901000 1.0 + Gd Gd6 1 0.40808000 0.08814000 0.26901000 1.0 + H H1 1 0.33283000 0.66717000 0.00000000 1.0 + H H2 1 0.66717000 0.33283000 0.00000000 1.0 + C C1 1 0.00000000 0.00000000 0.00000000 1.0 + N N1 1 0.83571000 0.16429000 0.50000000 1.0 + N N2 1 0.16429000 0.83571000 0.50000000 1.0 + N N3 1 0.50000000 0.50000000 0.50000000 1.0 diff --git a/data/data-release/cifs/single_prop/magnetic_density/Gd6H2CN3_symmetrized.cif b/data/data-release/cifs/single_prop/magnetic_density/Gd6H2CN3_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..f4d05a14d7d1f47795b4ace2da6d0f408a052932 --- /dev/null +++ b/data/data-release/cifs/single_prop/magnetic_density/Gd6H2CN3_symmetrized.cif @@ -0,0 +1,39 @@ +# generated using pymatgen +data_Gd6H2CN3 +_symmetry_space_group_name_H-M C2/m +_cell_length_a 6.13851092 +_cell_length_b 10.60740045 +_cell_length_c 6.19222000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 109.55152699 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 12 +_chemical_formula_structural Gd6H2CN3 +_chemical_formula_sum 'Gd12 H4 C2 N6' +_cell_volume 379.94997641 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-x, y, -z' + 4 'x, -y, z' + 5 'x+1/2, y+1/2, z' + 6 '-x+1/2, -y+1/2, -z' + 7 '-x+1/2, y+1/2, -z' + 8 'x+1/2, -y+1/2, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Gd Gd0 8 0.24811000 0.15997000 0.26901000 1.0 + Gd Gd1 4 0.23371000 0.00000000 0.73969000 1.0 + H H2 4 0.00000000 0.33283000 0.00000000 1.0 + C C3 2 0.00000000 0.00000000 0.00000000 1.0 + N N4 4 0.00000000 0.16429000 0.50000000 1.0 + N N5 2 0.00000000 0.50000000 0.50000000 1.0 diff --git a/data/data-release/cifs/symmetry/CsCu2HgI6.cif b/data/data-release/cifs/symmetry/CsCu2HgI6.cif new file mode 100644 index 0000000000000000000000000000000000000000..308d69661c4bb56c3d781765deb73b1cca9aa587 --- /dev/null +++ b/data/data-release/cifs/symmetry/CsCu2HgI6.cif @@ -0,0 +1,46 @@ +# generated using pymatgen +data_CsCu2HgI6 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 9.06604000 +_cell_length_b 10.88570000 +_cell_length_c 10.92940000 +_cell_angle_alpha 79.87990000 +_cell_angle_beta 66.15590000 +_cell_angle_gamma 66.29790000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural CsCu2HgI6 +_chemical_formula_sum 'Cs2 Cu4 Hg2 I12' +_cell_volume 903.23159401 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Cs Cs1 1 0.32688000 0.35961000 0.32391000 1.0 + Cs Cs2 1 0.82708000 0.95356000 0.73084000 1.0 + Cu Cu1 1 0.44843000 0.80117000 0.28573000 1.0 + Cu Cu2 1 0.94909000 0.91548000 0.17158000 1.0 + Cu Cu3 1 0.70355000 0.51222000 0.76981000 1.0 + Cu Cu4 1 0.20288000 0.39727000 0.88426000 1.0 + Hg Hg1 1 0.32838000 0.97870000 0.70442000 1.0 + Hg Hg2 1 0.82634000 0.33509000 0.34970000 1.0 + I I1 1 0.01929000 0.04391000 0.93281000 1.0 + I I2 1 0.39980000 0.22651000 0.69331000 1.0 + I I3 1 0.74478000 0.81931000 0.13627000 1.0 + I I4 1 0.40650000 0.49468000 0.91839000 1.0 + I I5 1 0.75303000 0.08814000 0.36064000 1.0 + I I6 1 0.90719000 0.54690000 0.86619000 1.0 + I I7 1 0.90023000 0.32298000 0.59618000 1.0 + I I8 1 0.51677000 0.56238000 0.41776000 1.0 + I I9 1 0.63747000 0.75028000 0.63795000 1.0 + I I10 1 0.24425000 0.76538000 0.19103000 1.0 + I I11 1 0.13625000 0.26677000 0.12234000 1.0 + I I12 1 0.25375000 0.99045000 0.45884000 1.0 diff --git a/data/data-release/cifs/symmetry/CsCu2HgI6_symmetrized.cif b/data/data-release/cifs/symmetry/CsCu2HgI6_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..b15e95f322a937d16325ade63c51e7858654fe32 --- /dev/null +++ b/data/data-release/cifs/symmetry/CsCu2HgI6_symmetrized.cif @@ -0,0 +1,39 @@ +# generated using pymatgen +data_CsCu2HgI6 +_symmetry_space_group_name_H-M C2/c +_cell_length_a 16.72604702 +_cell_length_b 14.00499371 +_cell_length_c 9.06604000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 121.72008581 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 15 +_chemical_formula_structural CsCu2HgI6 +_chemical_formula_sum 'Cs4 Cu8 Hg4 I24' +_cell_volume 1806.47912472 +_cell_formula_units_Z 4 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-x, y, -z+1/2' + 4 'x, -y, z+1/2' + 5 'x+1/2, y+1/2, z' + 6 '-x+1/2, -y+1/2, -z' + 7 '-x+1/2, y+1/2, -z+1/2' + 8 'x+1/2, -y+1/2, z+1/2' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Cs Cs0 4 0.00000000 0.29653500 0.75000000 1.0 + Cu Cu1 8 0.20169000 0.05666500 0.62845000 1.0 + Hg Hg2 4 0.00000000 0.32275500 0.25000000 1.0 + I I3 8 0.11815000 0.45221500 0.17708000 1.0 + I I4 8 0.13603000 0.02713500 0.83210000 1.0 + I I5 8 0.14660000 0.24116500 0.55759000 1.0 diff --git a/data/data-release/cifs/symmetry/CsMgIn9.cif b/data/data-release/cifs/symmetry/CsMgIn9.cif new file mode 100644 index 0000000000000000000000000000000000000000..1b561abec16cf5ad113f6186d196f8eb4f9dc810 --- /dev/null +++ b/data/data-release/cifs/symmetry/CsMgIn9.cif @@ -0,0 +1,37 @@ +# generated using pymatgen +data_CsMgIn9 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 5.00542000 +_cell_length_b 8.78653000 +_cell_length_c 8.80040000 +_cell_angle_alpha 60.15540000 +_cell_angle_beta 90.01270000 +_cell_angle_gamma 89.97780000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural CsMgIn9 +_chemical_formula_sum 'Cs1 Mg1 In9' +_cell_volume 335.71351295 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Cs Cs1 1 0.98903000 0.94892000 0.87959000 1.0 + Mg Mg1 1 0.98832000 0.28139000 0.21320000 1.0 + In In1 1 0.98905000 0.48088000 0.41233000 1.0 + In In2 1 0.48887000 0.35850000 0.67484000 1.0 + In In3 1 0.98924000 0.48033000 0.81495000 1.0 + In In4 1 0.48899000 0.15601000 0.08624000 1.0 + In In5 1 0.48914000 0.15505000 0.46622000 1.0 + In In6 1 0.48916000 0.74306000 0.67420000 1.0 + In In7 1 0.48873000 0.74386000 0.28981000 1.0 + In In8 1 0.98917000 0.88347000 0.41182000 1.0 + In In9 1 0.48870000 0.53557000 0.08594000 1.0 diff --git a/data/data-release/cifs/symmetry/CsMgIn9_symmetrized.cif b/data/data-release/cifs/symmetry/CsMgIn9_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..66433673dba152478d2284465887d59293a56e8c --- /dev/null +++ b/data/data-release/cifs/symmetry/CsMgIn9_symmetrized.cif @@ -0,0 +1,42 @@ +# generated using pymatgen +data_CsMgIn9 +_symmetry_space_group_name_H-M P-6m2 +_cell_length_a 8.79346500 +_cell_length_b 8.79346500 +_cell_length_c 5.00542000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 187 +_chemical_formula_structural CsMgIn9 +_chemical_formula_sum 'Cs1 Mg1 In9' +_cell_volume 335.19014005 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x+y, -x, -z' + 3 '-y, x-y, z' + 4 'x, y, -z' + 5 '-x+y, -x, z' + 6 '-y, x-y, -z' + 7 '-y, -x, -z' + 8 'x, x-y, z' + 9 '-x+y, y, -z' + 10 '-y, -x, z' + 11 'x, x-y, -z' + 12 '-x+y, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Cs Cs0 1 0.66666667 0.33333333 0.00000000 1.0 + Mg Mg1 1 0.00000000 0.00000000 0.00000000 1.0 + In In2 3 0.07624667 0.53812333 0.50000000 1.0 + In In3 3 0.19901667 0.80098333 0.00000000 1.0 + In In4 3 0.25292667 0.12646333 0.50000000 1.0 diff --git a/data/data-release/cifs/symmetry/CsMn3I8.cif b/data/data-release/cifs/symmetry/CsMn3I8.cif new file mode 100644 index 0000000000000000000000000000000000000000..a14c46f2bc72fabfd52463a7c7cdee634512bdad --- /dev/null +++ b/data/data-release/cifs/symmetry/CsMn3I8.cif @@ -0,0 +1,38 @@ +# generated using pymatgen +data_CsMn3I8 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 7.44306000 +_cell_length_b 7.44306000 +_cell_length_c 10.47280000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural CsMn3I8 +_chemical_formula_sum 'Cs1 Mn3 I8' +_cell_volume 502.45420069 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Cs Cs1 1 0.00000000 0.00000000 0.75320000 1.0 + Mn Mn1 1 0.66666667 0.33333333 0.48503000 1.0 + Mn Mn2 1 0.33333333 0.66666667 0.02052000 1.0 + Mn Mn3 1 0.00000000 0.00000000 0.25297000 1.0 + I I1 1 0.31447000 0.00539000 0.09249000 1.0 + I I2 1 0.66666667 0.33333333 0.73376000 1.0 + I I3 1 0.99461000 0.30908000 0.09249000 1.0 + I I4 1 0.00540000 0.69140000 0.41400000 1.0 + I I5 1 0.69092000 0.68553000 0.09249000 1.0 + I I6 1 0.68600000 0.99460000 0.41400000 1.0 + I I7 1 0.30860000 0.31400000 0.41400000 1.0 + I I8 1 0.33333333 0.66666667 0.77170000 1.0 diff --git a/data/data-release/cifs/symmetry/CsMn3I8_symmetrized.cif b/data/data-release/cifs/symmetry/CsMn3I8_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..2eac19c3b949e0ae11d81191fb726e5d9ffd3a65 --- /dev/null +++ b/data/data-release/cifs/symmetry/CsMn3I8_symmetrized.cif @@ -0,0 +1,36 @@ +# generated using pymatgen +data_CsMn3I8 +_symmetry_space_group_name_H-M P-3 +_cell_length_a 7.44306000 +_cell_length_b 7.44306000 +_cell_length_c 10.47280000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 147 +_chemical_formula_structural CsMn3I8 +_chemical_formula_sum 'Cs1 Mn3 I8' +_cell_volume 502.45420069 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y, x-y, z' + 4 'y, -x+y, -z' + 5 '-x+y, -x, z' + 6 'x-y, x, -z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Cs Cs0 1 0.00000000 0.00000000 0.50000000 1.0 + Mn Mn1 2 0.33333333 0.66666667 0.76817000 1.0 + Mn Mn2 1 0.00000000 0.00000000 0.00000000 1.0 + I I3 6 0.00539000 0.69092000 0.16071000 1.0 + I I4 2 0.33333333 0.66666667 0.51944000 1.0 diff --git a/data/data-release/cifs/symmetry/Cu4P3O11.cif b/data/data-release/cifs/symmetry/Cu4P3O11.cif new file mode 100644 index 0000000000000000000000000000000000000000..7d61c8b899620ef9142e885f00bb3267e40ba4e0 --- /dev/null +++ b/data/data-release/cifs/symmetry/Cu4P3O11.cif @@ -0,0 +1,44 @@ +# generated using pymatgen +data_Cu4P3O11 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 5.28207000 +_cell_length_b 5.26854000 +_cell_length_c 8.77552000 +_cell_angle_alpha 96.70850000 +_cell_angle_beta 99.80130000 +_cell_angle_gamma 98.05290000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Cu4P3O11 +_chemical_formula_sum 'Cu4 P3 O11' +_cell_volume 235.78537133 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Cu Cu1 1 0.72622000 0.95255000 0.13221000 1.0 + Cu Cu2 1 0.37513000 0.86632000 0.78990000 1.0 + Cu Cu3 1 0.40718000 0.20106000 0.31030000 1.0 + Cu Cu4 1 0.87901000 0.83970000 0.46497000 1.0 + P P1 1 0.93113000 0.23964000 0.87302000 1.0 + P P2 1 0.94329000 0.39982000 0.56666000 1.0 + P P3 1 0.19700000 0.64834000 0.12487000 1.0 + O O1 1 0.09150000 0.18580000 0.51910000 1.0 + O O2 1 0.21409000 0.47262000 0.24970000 1.0 + O O3 1 0.62559000 0.95288000 0.32583000 1.0 + O O4 1 0.19104000 0.16260000 0.86958000 1.0 + O O5 1 0.71868000 0.03993000 0.91142000 1.0 + O O6 1 0.79995000 0.31511000 0.70729000 1.0 + O O7 1 0.94654000 0.50346000 0.98685000 1.0 + O O8 1 0.11879000 0.66901000 0.61897000 1.0 + O O9 1 0.10852000 0.90754000 0.18273000 1.0 + O O10 1 0.41765000 0.69229000 0.03223000 1.0 + O O11 1 0.71683000 0.46382000 0.44607000 1.0 diff --git a/data/data-release/cifs/symmetry/Cu4P3O11_symmetrized.cif b/data/data-release/cifs/symmetry/Cu4P3O11_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..1e6281f1db5521f4dc4eb5260b41b6a5bc216d79 --- /dev/null +++ b/data/data-release/cifs/symmetry/Cu4P3O11_symmetrized.cif @@ -0,0 +1,44 @@ +# generated using pymatgen +data_Cu4P3O11 +_symmetry_space_group_name_H-M P1 +_cell_length_a 5.26854000 +_cell_length_b 5.28207000 +_cell_length_c 8.77552000 +_cell_angle_alpha 99.80130000 +_cell_angle_beta 96.70850000 +_cell_angle_gamma 98.05290000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Cu4P3O11 +_chemical_formula_sum 'Cu4 P3 O11' +_cell_volume 235.78537133 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Cu Cu0 1 0.04745000 0.27378000 0.86779000 1.0 + Cu Cu1 1 0.13368000 0.62487000 0.21010000 1.0 + Cu Cu2 1 0.16030000 0.12099000 0.53503000 1.0 + Cu Cu3 1 0.79894000 0.59282000 0.68970000 1.0 + P P4 1 0.35166000 0.80300000 0.87513000 1.0 + P P5 1 0.60018000 0.05671000 0.43334000 1.0 + P P6 1 0.76036000 0.06887000 0.12698000 1.0 + O O7 1 0.04712000 0.37441000 0.67417000 1.0 + O O8 1 0.09246000 0.89148000 0.81727000 1.0 + O O9 1 0.30771000 0.58235000 0.96777000 1.0 + O O10 1 0.33099000 0.88121000 0.38103000 1.0 + O O11 1 0.49654000 0.05346000 0.01315000 1.0 + O O12 1 0.52738000 0.78591000 0.75030000 1.0 + O O13 1 0.53618000 0.28317000 0.55393000 1.0 + O O14 1 0.68489000 0.20005000 0.29271000 1.0 + O O15 1 0.81420000 0.90850000 0.48090000 1.0 + O O16 1 0.83740000 0.80896000 0.13042000 1.0 + O O17 1 0.96007000 0.28132000 0.08858000 1.0 diff --git a/data/data-release/cifs/symmetry/FeIrOsRh.cif b/data/data-release/cifs/symmetry/FeIrOsRh.cif new file mode 100644 index 0000000000000000000000000000000000000000..016da7e50e79c9370fa18cef08f8e62e6c881478 --- /dev/null +++ b/data/data-release/cifs/symmetry/FeIrOsRh.cif @@ -0,0 +1,30 @@ +# generated using pymatgen +data_FeIrOsRh +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 3.79844000 +_cell_length_b 3.79844000 +_cell_length_c 4.67183000 +_cell_angle_alpha 113.98700000 +_cell_angle_beta 113.98700000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural FeIrOsRh +_chemical_formula_sum 'Fe1 Ir1 Os1 Rh1' +_cell_volume 55.15214503 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Fe Fe1 1 0.75000000 0.25000000 0.50000000 1.0 + Ir Ir1 1 0.00000000 0.00000000 0.00000000 1.0 + Os Os1 1 0.25000000 0.75000000 0.50000000 1.0 + Rh Rh1 1 0.50000000 0.50000000 0.00000000 1.0 diff --git a/data/data-release/cifs/symmetry/FeIrOsRh_symmetrized.cif b/data/data-release/cifs/symmetry/FeIrOsRh_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..f29a4d361d741fcf2bf265e9fa7c6937a76f79a3 --- /dev/null +++ b/data/data-release/cifs/symmetry/FeIrOsRh_symmetrized.cif @@ -0,0 +1,45 @@ +# generated using pymatgen +data_FeIrOsRh +_symmetry_space_group_name_H-M I-4m2 +_cell_length_a 3.79844000 +_cell_length_b 3.79844000 +_cell_length_c 7.64507697 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 119 +_chemical_formula_structural FeIrOsRh +_chemical_formula_sum 'Fe2 Ir2 Os2 Rh2' +_cell_volume 110.30429005 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 'y, -x, -z' + 3 '-x, -y, z' + 4 '-y, x, -z' + 5 '-x, y, z' + 6 '-y, -x, -z' + 7 'x, -y, z' + 8 'y, x, -z' + 9 'x+1/2, y+1/2, z+1/2' + 10 'y+1/2, -x+1/2, -z+1/2' + 11 '-x+1/2, -y+1/2, z+1/2' + 12 '-y+1/2, x+1/2, -z+1/2' + 13 '-x+1/2, y+1/2, z+1/2' + 14 '-y+1/2, -x+1/2, -z+1/2' + 15 'x+1/2, -y+1/2, z+1/2' + 16 'y+1/2, x+1/2, -z+1/2' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Fe Fe0 2 0.00000000 0.50000000 0.25000000 1.0 + Ir Ir1 2 0.00000000 0.00000000 0.00000000 1.0 + Os Os2 2 0.00000000 0.50000000 0.75000000 1.0 + Rh Rh3 2 0.00000000 0.00000000 0.50000000 1.0 diff --git a/data/data-release/cifs/symmetry/KNdOsO6.cif b/data/data-release/cifs/symmetry/KNdOsO6.cif new file mode 100644 index 0000000000000000000000000000000000000000..5237432c49b9795994c0bac21399e9e570f69ffa --- /dev/null +++ b/data/data-release/cifs/symmetry/KNdOsO6.cif @@ -0,0 +1,44 @@ +# generated using pymatgen +data_KNdOsO6 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 5.80593000 +_cell_length_b 5.80593000 +_cell_length_c 11.07540000 +_cell_angle_alpha 89.97940000 +_cell_angle_beta 89.97940000 +_cell_angle_gamma 119.98700000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural KNdOsO6 +_chemical_formula_sum 'K2 Nd2 Os2 O12' +_cell_volume 323.36306053 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + K K1 1 0.93970000 0.06088000 0.24980000 1.0 + K K2 1 0.93912000 0.06030000 0.75020000 1.0 + Nd Nd1 1 0.27247000 0.72753000 0.00000000 1.0 + Nd Nd2 1 0.60610000 0.39390000 0.50000000 1.0 + Os Os1 1 0.60573000 0.39427000 0.00000000 1.0 + Os Os2 1 0.27295000 0.72705000 0.50000000 1.0 + O O1 1 0.52949000 0.00020000 0.59766000 1.0 + O O2 1 0.34888000 0.41041000 0.09749000 1.0 + O O3 1 0.28881000 0.46990000 0.59754000 1.0 + O O4 1 0.87911000 0.65120000 0.09747000 1.0 + O O5 1 0.34880000 0.12089000 0.90253000 1.0 + O O6 1 0.99980000 0.47051000 0.40234000 1.0 + O O7 1 0.99941000 0.71056000 0.59758000 1.0 + O O8 1 0.28944000 0.00059000 0.40242000 1.0 + O O9 1 0.87920000 0.41021000 0.90248000 1.0 + O O10 1 0.58979000 0.12080000 0.09752000 1.0 + O O11 1 0.53010000 0.71119000 0.40246000 1.0 + O O12 1 0.58959000 0.65112000 0.90251000 1.0 diff --git a/data/data-release/cifs/symmetry/KNdOsO6_symmetrized.cif b/data/data-release/cifs/symmetry/KNdOsO6_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..b9ebead370f2ef83f3531391ae52c712e16eff43 --- /dev/null +++ b/data/data-release/cifs/symmetry/KNdOsO6_symmetrized.cif @@ -0,0 +1,41 @@ +# generated using pymatgen +data_KNdOsO6 +_symmetry_space_group_name_H-M P-31c +_cell_length_a 5.80593000 +_cell_length_b 5.80593000 +_cell_length_c 11.07540000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 163 +_chemical_formula_structural KNdOsO6 +_chemical_formula_sum 'K2 Nd2 Os2 O12' +_cell_volume 323.32079849 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y, x-y, z' + 4 'y, -x+y, -z' + 5 '-x+y, -x, z' + 6 'x-y, x, -z' + 7 '-y, -x, -z+1/2' + 8 'y, x, z+1/2' + 9 '-x+y, y, -z+1/2' + 10 'x-y, -y, z+1/2' + 11 'x, x-y, -z+1/2' + 12 '-x, -x+y, z+1/2' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + K K0 2 0.00000000 0.00000000 0.00000000 1.0 + Nd Nd1 2 0.33333333 0.66666667 0.75000000 1.0 + Os Os2 2 0.33333333 0.66666667 0.25000000 1.0 + O O3 12 0.06048667 0.40982333 0.15234000 1.0 diff --git a/data/data-release/cifs/symmetry/Li(SnCl3)2.cif b/data/data-release/cifs/symmetry/Li(SnCl3)2.cif new file mode 100644 index 0000000000000000000000000000000000000000..9d9d72df0b0eb5bc1ec6e12e5372724b03b9b7bf --- /dev/null +++ b/data/data-release/cifs/symmetry/Li(SnCl3)2.cif @@ -0,0 +1,44 @@ +# generated using pymatgen +data_Li(SnCl3)2 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 6.41540000 +_cell_length_b 6.42099000 +_cell_length_c 12.15040000 +_cell_angle_alpha 90.03830000 +_cell_angle_beta 90.02910000 +_cell_angle_gamma 90.06100000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Li(SnCl3)2 +_chemical_formula_sum 'Li2 Sn4 Cl12' +_cell_volume 500.51363090 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Li Li1 1 0.50000000 0.00000000 0.00000000 1.0 + Li Li2 1 0.00000000 0.50000000 0.50000000 1.0 + Sn Sn1 1 0.49974000 0.99978000 0.66714000 1.0 + Sn Sn2 1 0.99999000 0.50011000 0.16752000 1.0 + Sn Sn3 1 0.00001000 0.49989000 0.83248000 1.0 + Sn Sn4 1 0.50026000 0.00022000 0.33286000 1.0 + Cl Cl1 1 0.30320000 0.80333000 0.83622000 1.0 + Cl Cl2 1 0.20486000 0.29557000 0.99975000 1.0 + Cl Cl3 1 0.30273000 0.80319000 0.16361000 1.0 + Cl Cl4 1 0.70523000 0.20529000 0.50034000 1.0 + Cl Cl5 1 0.29477000 0.79471000 0.49966000 1.0 + Cl Cl6 1 0.80299000 0.69725000 0.33628000 1.0 + Cl Cl7 1 0.69727000 0.19681000 0.83639000 1.0 + Cl Cl8 1 0.19714000 0.30279000 0.33632000 1.0 + Cl Cl9 1 0.69680000 0.19667000 0.16378000 1.0 + Cl Cl10 1 0.79514000 0.70443000 0.00025000 1.0 + Cl Cl11 1 0.19701000 0.30275000 0.66372000 1.0 + Cl Cl12 1 0.80286000 0.69721000 0.66368000 1.0 diff --git a/data/data-release/cifs/symmetry/Li(SnCl3)2_symmetrized.cif b/data/data-release/cifs/symmetry/Li(SnCl3)2_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..fa488878c09ff3ecacbecf2fb37d66380e05d970 --- /dev/null +++ b/data/data-release/cifs/symmetry/Li(SnCl3)2_symmetrized.cif @@ -0,0 +1,45 @@ +# generated using pymatgen +data_Li(SnCl3)2 +_symmetry_space_group_name_H-M P4_2/mnm +_cell_length_a 6.41819500 +_cell_length_b 6.41819500 +_cell_length_c 12.15040000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 136 +_chemical_formula_structural Li(SnCl3)2 +_chemical_formula_sum 'Li2 Sn4 Cl12' +_cell_volume 500.51418605 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y+1/2, x+1/2, z+1/2' + 4 'y+1/2, -x+1/2, -z+1/2' + 5 '-x, -y, z' + 6 'x, y, -z' + 7 'y+1/2, -x+1/2, z+1/2' + 8 '-y+1/2, x+1/2, -z+1/2' + 9 'x+1/2, -y+1/2, -z+1/2' + 10 '-x+1/2, y+1/2, z+1/2' + 11 '-y, -x, -z' + 12 'y, x, z' + 13 '-x+1/2, y+1/2, -z+1/2' + 14 'x+1/2, -y+1/2, z+1/2' + 15 'y, x, -z' + 16 '-y, -x, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Li Li0 2 0.00000000 0.00000000 0.50000000 1.0 + Sn Sn1 4 0.00000000 0.00000000 0.16714000 1.0 + Cl Cl2 8 0.19673500 0.80326500 0.33622000 1.0 + Cl Cl3 4 0.20464500 0.79535500 0.00000000 1.0 diff --git a/data/data-release/cifs/symmetry/LiHoZrRh.cif b/data/data-release/cifs/symmetry/LiHoZrRh.cif new file mode 100644 index 0000000000000000000000000000000000000000..755e7d5ac782febabac62097048d35a96c8c64e2 --- /dev/null +++ b/data/data-release/cifs/symmetry/LiHoZrRh.cif @@ -0,0 +1,30 @@ +# generated using pymatgen +data_LiHoZrRh +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.78763000 +_cell_length_b 4.78763000 +_cell_length_c 4.78763000 +_cell_angle_alpha 60.00000000 +_cell_angle_beta 60.00000000 +_cell_angle_gamma 60.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural LiHoZrRh +_chemical_formula_sum 'Li1 Ho1 Zr1 Rh1' +_cell_volume 77.59732340 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Li Li1 1 0.25000000 0.25000000 0.25000000 1.0 + Ho Ho1 1 0.50000000 0.50000000 0.50000000 1.0 + Zr Zr1 1 0.00000000 0.00000000 0.00000000 1.0 + Rh Rh1 1 0.75000000 0.75000000 0.75000000 1.0 diff --git a/data/data-release/cifs/symmetry/LiHoZrRh_symmetrized.cif b/data/data-release/cifs/symmetry/LiHoZrRh_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..566ab6ee3cb83b2e8ba33228398a1a6bd0b929af --- /dev/null +++ b/data/data-release/cifs/symmetry/LiHoZrRh_symmetrized.cif @@ -0,0 +1,125 @@ +# generated using pymatgen +data_LiHoZrRh +_symmetry_space_group_name_H-M F-43m +_cell_length_a 6.77073128 +_cell_length_b 6.77073128 +_cell_length_c 6.77073128 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 216 +_chemical_formula_structural LiHoZrRh +_chemical_formula_sum 'Li4 Ho4 Zr4 Rh4' +_cell_volume 310.38929358 +_cell_formula_units_Z 4 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 'y, -x, -z' + 3 '-x, -y, z' + 4 '-y, x, -z' + 5 'x, -y, -z' + 6 'y, x, z' + 7 '-x, y, -z' + 8 '-y, -x, z' + 9 'z, x, y' + 10 '-z, y, -x' + 11 'z, -x, -y' + 12 '-z, -y, x' + 13 '-z, x, -y' + 14 'z, y, x' + 15 '-z, -x, y' + 16 'z, -y, -x' + 17 'y, z, x' + 18 '-x, -z, y' + 19 '-y, z, -x' + 20 'x, -z, -y' + 21 '-y, -z, x' + 22 'x, z, y' + 23 'y, -z, -x' + 24 '-x, z, -y' + 25 'x+1/2, y+1/2, z' + 26 'y+1/2, -x+1/2, -z' + 27 '-x+1/2, -y+1/2, z' + 28 '-y+1/2, x+1/2, -z' + 29 'x+1/2, -y+1/2, -z' + 30 'y+1/2, x+1/2, z' + 31 '-x+1/2, y+1/2, -z' + 32 '-y+1/2, -x+1/2, z' + 33 'z+1/2, x+1/2, y' + 34 '-z+1/2, y+1/2, -x' + 35 'z+1/2, -x+1/2, -y' + 36 '-z+1/2, -y+1/2, x' + 37 '-z+1/2, x+1/2, -y' + 38 'z+1/2, y+1/2, x' + 39 '-z+1/2, -x+1/2, y' + 40 'z+1/2, -y+1/2, -x' + 41 'y+1/2, z+1/2, x' + 42 '-x+1/2, -z+1/2, y' + 43 '-y+1/2, z+1/2, -x' + 44 'x+1/2, -z+1/2, -y' + 45 '-y+1/2, -z+1/2, x' + 46 'x+1/2, z+1/2, y' + 47 'y+1/2, -z+1/2, -x' + 48 '-x+1/2, z+1/2, -y' + 49 'x+1/2, y, z+1/2' + 50 'y+1/2, -x, -z+1/2' + 51 '-x+1/2, -y, z+1/2' + 52 '-y+1/2, x, -z+1/2' + 53 'x+1/2, -y, -z+1/2' + 54 'y+1/2, x, z+1/2' + 55 '-x+1/2, y, -z+1/2' + 56 '-y+1/2, -x, z+1/2' + 57 'z+1/2, x, y+1/2' + 58 '-z+1/2, y, -x+1/2' + 59 'z+1/2, -x, -y+1/2' + 60 '-z+1/2, -y, x+1/2' + 61 '-z+1/2, x, -y+1/2' + 62 'z+1/2, y, x+1/2' + 63 '-z+1/2, -x, y+1/2' + 64 'z+1/2, -y, -x+1/2' + 65 'y+1/2, z, x+1/2' + 66 '-x+1/2, -z, y+1/2' + 67 '-y+1/2, z, -x+1/2' + 68 'x+1/2, -z, -y+1/2' + 69 '-y+1/2, -z, x+1/2' + 70 'x+1/2, z, y+1/2' + 71 'y+1/2, -z, -x+1/2' + 72 '-x+1/2, z, -y+1/2' + 73 'x, y+1/2, z+1/2' + 74 'y, -x+1/2, -z+1/2' + 75 '-x, -y+1/2, z+1/2' + 76 '-y, x+1/2, -z+1/2' + 77 'x, -y+1/2, -z+1/2' + 78 'y, x+1/2, z+1/2' + 79 '-x, y+1/2, -z+1/2' + 80 '-y, -x+1/2, z+1/2' + 81 'z, x+1/2, y+1/2' + 82 '-z, y+1/2, -x+1/2' + 83 'z, -x+1/2, -y+1/2' + 84 '-z, -y+1/2, x+1/2' + 85 '-z, x+1/2, -y+1/2' + 86 'z, y+1/2, x+1/2' + 87 '-z, -x+1/2, y+1/2' + 88 'z, -y+1/2, -x+1/2' + 89 'y, z+1/2, x+1/2' + 90 '-x, -z+1/2, y+1/2' + 91 '-y, z+1/2, -x+1/2' + 92 'x, -z+1/2, -y+1/2' + 93 '-y, -z+1/2, x+1/2' + 94 'x, z+1/2, y+1/2' + 95 'y, -z+1/2, -x+1/2' + 96 '-x, z+1/2, -y+1/2' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Li Li0 4 0.25000000 0.25000000 0.75000000 1.0 + Ho Ho1 4 0.00000000 0.00000000 0.50000000 1.0 + Zr Zr2 4 0.00000000 0.00000000 0.00000000 1.0 + Rh Rh3 4 0.25000000 0.25000000 0.25000000 1.0 diff --git a/data/data-release/cifs/symmetry/Mn6O5F7.cif b/data/data-release/cifs/symmetry/Mn6O5F7.cif new file mode 100644 index 0000000000000000000000000000000000000000..879823a70fa0c3cf4c0b9d249abaa5bfc8f7837b --- /dev/null +++ b/data/data-release/cifs/symmetry/Mn6O5F7.cif @@ -0,0 +1,44 @@ +# generated using pymatgen +data_Mn6O5F7 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 3.12293000 +_cell_length_b 4.83419000 +_cell_length_c 14.41190000 +_cell_angle_alpha 91.12190000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Mn6O5F7 +_chemical_formula_sum 'Mn6 O5 F7' +_cell_volume 217.53239615 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mn Mn1 1 0.00000000 0.87158000 0.43471000 1.0 + Mn Mn2 1 0.50000000 0.49050000 0.92714000 1.0 + Mn Mn3 1 0.00000000 0.92633000 0.08778000 1.0 + Mn Mn4 1 0.00000000 0.97888000 0.73863000 1.0 + Mn Mn5 1 0.50000000 0.36308000 0.24748000 1.0 + Mn Mn6 1 0.50000000 0.45597000 0.59550000 1.0 + O O1 1 0.00000000 0.65593000 0.98955000 1.0 + O O2 1 0.50000000 0.16748000 0.68671000 1.0 + O O3 1 0.00000000 0.64147000 0.64964000 1.0 + O O4 1 0.50000000 0.69528000 0.48984000 1.0 + O O5 1 0.00000000 0.19370000 0.18621000 1.0 + F F1 1 0.50000000 0.06707000 0.36393000 1.0 + F F2 1 0.00000000 0.56521000 0.31629000 1.0 + F F3 1 0.00000000 0.23541000 0.52778000 1.0 + F F4 1 0.00000000 0.28698000 0.85822000 1.0 + F F5 1 0.50000000 0.72340000 0.15287000 1.0 + F F6 1 0.50000000 0.12929000 0.02293000 1.0 + F F7 1 0.50000000 0.79367000 0.81383000 1.0 diff --git a/data/data-release/cifs/symmetry/Mn6O5F7_symmetrized.cif b/data/data-release/cifs/symmetry/Mn6O5F7_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..fad45fe10d158e303c2091ed9c63befd98df3ec3 --- /dev/null +++ b/data/data-release/cifs/symmetry/Mn6O5F7_symmetrized.cif @@ -0,0 +1,45 @@ +# generated using pymatgen +data_Mn6O5F7 +_symmetry_space_group_name_H-M Pm +_cell_length_a 4.83419000 +_cell_length_b 3.12293000 +_cell_length_c 14.41190000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 91.12190000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 6 +_chemical_formula_structural Mn6O5F7 +_chemical_formula_sum 'Mn6 O5 F7' +_cell_volume 217.53239615 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 'x, -y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mn Mn0 1 0.36308000 0.50000000 0.24748000 1.0 + Mn Mn1 1 0.45597000 0.50000000 0.59550000 1.0 + Mn Mn2 1 0.49050000 0.50000000 0.92714000 1.0 + Mn Mn3 1 0.87158000 0.00000000 0.43471000 1.0 + Mn Mn4 1 0.92633000 0.00000000 0.08778000 1.0 + Mn Mn5 1 0.97888000 0.00000000 0.73863000 1.0 + O O6 1 0.16748000 0.50000000 0.68671000 1.0 + O O7 1 0.19370000 0.00000000 0.18621000 1.0 + O O8 1 0.64147000 0.00000000 0.64964000 1.0 + O O9 1 0.65593000 0.00000000 0.98955000 1.0 + O O10 1 0.69528000 0.50000000 0.48984000 1.0 + F F11 1 0.06707000 0.50000000 0.36393000 1.0 + F F12 1 0.12929000 0.50000000 0.02293000 1.0 + F F13 1 0.23541000 0.00000000 0.52778000 1.0 + F F14 1 0.28698000 0.00000000 0.85822000 1.0 + F F15 1 0.56521000 0.00000000 0.31629000 1.0 + F F16 1 0.72340000 0.50000000 0.15287000 1.0 + F F17 1 0.79367000 0.50000000 0.81383000 1.0 diff --git a/data/data-release/cifs/symmetry/MnSn2F6.cif b/data/data-release/cifs/symmetry/MnSn2F6.cif new file mode 100644 index 0000000000000000000000000000000000000000..93eff2f778e0f38f3ebe924791328e234943d242 --- /dev/null +++ b/data/data-release/cifs/symmetry/MnSn2F6.cif @@ -0,0 +1,35 @@ +# generated using pymatgen +data_MnSn2F6 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.09015000 +_cell_length_b 5.54489000 +_cell_length_c 7.03755000 +_cell_angle_alpha 113.16200000 +_cell_angle_beta 106.89400000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural MnSn2F6 +_chemical_formula_sum 'Mn1 Sn2 F6' +_cell_volume 139.21960595 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mn Mn1 1 0.50000000 0.50000000 0.00000000 1.0 + Sn Sn1 1 0.15475000 0.15515000 0.30951000 1.0 + Sn Sn2 1 0.84525000 0.84485000 0.69049000 1.0 + F F1 1 0.35902000 0.60376000 0.71804000 1.0 + F F2 1 0.99975000 0.74437000 0.99950000 1.0 + F F3 1 0.64014000 0.88567000 0.28028000 1.0 + F F4 1 0.35986000 0.11433000 0.71972000 1.0 + F F5 1 0.00025000 0.25563000 0.00050000 1.0 + F F6 1 0.64098000 0.39624000 0.28196000 1.0 diff --git a/data/data-release/cifs/symmetry/MnSn2F6_symmetrized.cif b/data/data-release/cifs/symmetry/MnSn2F6_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..c597699a40b93546b9ee929a1c1afc706195ab8b --- /dev/null +++ b/data/data-release/cifs/symmetry/MnSn2F6_symmetrized.cif @@ -0,0 +1,45 @@ +# generated using pymatgen +data_MnSn2F6 +_symmetry_space_group_name_H-M Immm +_cell_length_a 4.09015000 +_cell_length_b 5.54489000 +_cell_length_c 12.27717184 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 71 +_chemical_formula_structural MnSn2F6 +_chemical_formula_sum 'Mn2 Sn4 F12' +_cell_volume 278.43928181 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-x, -y, z' + 4 'x, y, -z' + 5 'x, -y, -z' + 6 '-x, y, z' + 7 '-x, y, -z' + 8 'x, -y, z' + 9 'x+1/2, y+1/2, z+1/2' + 10 '-x+1/2, -y+1/2, -z+1/2' + 11 '-x+1/2, -y+1/2, z+1/2' + 12 'x+1/2, y+1/2, -z+1/2' + 13 'x+1/2, -y+1/2, -z+1/2' + 14 '-x+1/2, y+1/2, z+1/2' + 15 '-x+1/2, y+1/2, -z+1/2' + 16 'x+1/2, -y+1/2, z+1/2' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Mn Mn0 2 0.00000000 0.00000000 0.50000000 1.0 + Sn Sn1 4 0.00000000 0.00000000 0.15475500 1.0 + F F2 8 0.00000000 0.24474000 0.35902000 1.0 + F F3 4 0.00000000 0.25538000 0.00000000 1.0 diff --git a/data/data-release/cifs/symmetry/Rb2Tl2TeSe4.cif b/data/data-release/cifs/symmetry/Rb2Tl2TeSe4.cif new file mode 100644 index 0000000000000000000000000000000000000000..1366ff0fd1df31c0e4f2aae01728c98701951f7b --- /dev/null +++ b/data/data-release/cifs/symmetry/Rb2Tl2TeSe4.cif @@ -0,0 +1,35 @@ +# generated using pymatgen +data_Rb2Tl2TeSe4 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 6.05341000 +_cell_length_b 7.31134000 +_cell_length_c 8.46401000 +_cell_angle_alpha 112.22600000 +_cell_angle_beta 96.82050000 +_cell_angle_gamma 96.48550000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Rb2Tl2TeSe4 +_chemical_formula_sum 'Rb2 Tl2 Te1 Se4' +_cell_volume 339.20013264 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Rb Rb1 1 0.37717000 0.90874000 0.77316000 1.0 + Rb Rb2 1 0.59265000 0.64238000 0.26848000 1.0 + Tl Tl1 1 0.75532000 0.43902000 0.62362000 1.0 + Tl Tl2 1 0.21301000 0.11020000 0.41767000 1.0 + Te Te1 1 0.98517000 0.27479000 0.02085000 1.0 + Se Se1 1 0.87426000 0.90830000 0.06635000 1.0 + Se Se2 1 0.87411000 0.06524000 0.65112000 1.0 + Se Se3 1 0.09493000 0.48407000 0.38926000 1.0 + Se Se4 1 0.09658000 0.64022000 0.97341000 1.0 diff --git a/data/data-release/cifs/symmetry/Rb2Tl2TeSe4_symmetrized.cif b/data/data-release/cifs/symmetry/Rb2Tl2TeSe4_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..2187b871907096115e695176e1ca405449ce00bd --- /dev/null +++ b/data/data-release/cifs/symmetry/Rb2Tl2TeSe4_symmetrized.cif @@ -0,0 +1,32 @@ +# generated using pymatgen +data_Rb2Tl2TeSe4 +_symmetry_space_group_name_H-M P-1 +_cell_length_a 6.05341000 +_cell_length_b 7.31134000 +_cell_length_c 8.46401000 +_cell_angle_alpha 112.22600000 +_cell_angle_beta 96.82050000 +_cell_angle_gamma 96.48550000 +_symmetry_Int_Tables_number 2 +_chemical_formula_structural Rb2Tl2TeSe4 +_chemical_formula_sum 'Rb2 Tl2 Te1 Se4' +_cell_volume 339.20013264 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Rb Rb0 2 0.10800000 0.36605000 0.24769000 1.0 + Tl Tl1 2 0.27015000 0.16423000 0.60277000 1.0 + Te Te2 1 0.50000000 0.00000000 0.00000000 1.0 + Se Se3 2 0.38894000 0.79045000 0.63027000 1.0 + Se Se4 2 0.38909000 0.63351000 0.04550000 1.0 diff --git a/data/data-release/cifs/symmetry/RbCu4Ag3F12.cif b/data/data-release/cifs/symmetry/RbCu4Ag3F12.cif new file mode 100644 index 0000000000000000000000000000000000000000..595a7e2f36ccf26b87f7bcb42f8150af10747c41 --- /dev/null +++ b/data/data-release/cifs/symmetry/RbCu4Ag3F12.cif @@ -0,0 +1,46 @@ +# generated using pymatgen +data_RbCu4Ag3F12 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 6.98181000 +_cell_length_b 6.98181000 +_cell_length_c 6.98316000 +_cell_angle_alpha 70.57210000 +_cell_angle_beta 70.54430000 +_cell_angle_gamma 109.52200000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural RbCu4Ag3F12 +_chemical_formula_sum 'Rb1 Cu4 Ag3 F12' +_cell_volume 262.06506137 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Rb Rb1 1 0.67717000 0.17717000 0.50000000 1.0 + Cu Cu1 1 0.17737000 0.67717000 0.00003000 1.0 + Cu Cu2 1 0.67779000 0.67768000 0.49991000 1.0 + Cu Cu3 1 0.17759000 0.17770000 0.50009000 1.0 + Cu Cu4 1 0.67719000 0.17739000 0.99997000 1.0 + Ag Ag1 1 0.17736000 0.67736000 0.50000000 1.0 + Ag Ag2 1 0.17728000 0.17728000 0.00000000 1.0 + Ag Ag3 1 0.67790000 0.67790000 0.00000000 1.0 + F F1 1 0.89749000 0.89506000 0.56269000 1.0 + F F2 1 0.39531000 0.67422000 0.72004000 1.0 + F F3 1 0.95980000 0.23881000 0.72038000 1.0 + F F4 1 0.89730000 0.45896000 0.99826000 1.0 + F F5 1 0.17563000 0.95695000 0.78248000 1.0 + F F6 1 0.17887000 0.39781000 0.21815000 1.0 + F F7 1 0.73943000 0.95811000 0.21752000 1.0 + F F8 1 0.61597000 0.39702000 0.78185000 1.0 + F F9 1 0.39426000 0.11534000 0.27996000 1.0 + F F10 1 0.95918000 0.68018000 0.27962000 1.0 + F F11 1 0.45775000 0.46017000 0.43731000 1.0 + F F12 1 0.45722000 0.89557000 0.00174000 1.0 diff --git a/data/data-release/cifs/symmetry/RbCu4Ag3F12_symmetrized.cif b/data/data-release/cifs/symmetry/RbCu4Ag3F12_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..9d8f7df24626be54ccac40d359c92d99fa3ce6c6 --- /dev/null +++ b/data/data-release/cifs/symmetry/RbCu4Ag3F12_symmetrized.cif @@ -0,0 +1,77 @@ +# generated using pymatgen +data_RbCu4Ag3F12 +_symmetry_space_group_name_H-M Im-3 +_cell_length_a 8.06268651 +_cell_length_b 8.06268651 +_cell_length_c 8.06268651 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 204 +_chemical_formula_structural RbCu4Ag3F12 +_chemical_formula_sum 'Rb2 Cu8 Ag6 F24' +_cell_volume 524.13036692 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-x, -y, z' + 4 'x, y, -z' + 5 'x, -y, -z' + 6 '-x, y, z' + 7 '-x, y, -z' + 8 'x, -y, z' + 9 'z, x, y' + 10 '-z, -x, -y' + 11 'z, -x, -y' + 12 '-z, x, y' + 13 '-z, x, -y' + 14 'z, -x, y' + 15 '-z, -x, y' + 16 'z, x, -y' + 17 'y, z, x' + 18 '-y, -z, -x' + 19 '-y, z, -x' + 20 'y, -z, x' + 21 '-y, -z, x' + 22 'y, z, -x' + 23 'y, -z, -x' + 24 '-y, z, x' + 25 'x+1/2, y+1/2, z+1/2' + 26 '-x+1/2, -y+1/2, -z+1/2' + 27 '-x+1/2, -y+1/2, z+1/2' + 28 'x+1/2, y+1/2, -z+1/2' + 29 'x+1/2, -y+1/2, -z+1/2' + 30 '-x+1/2, y+1/2, z+1/2' + 31 '-x+1/2, y+1/2, -z+1/2' + 32 'x+1/2, -y+1/2, z+1/2' + 33 'z+1/2, x+1/2, y+1/2' + 34 '-z+1/2, -x+1/2, -y+1/2' + 35 'z+1/2, -x+1/2, -y+1/2' + 36 '-z+1/2, x+1/2, y+1/2' + 37 '-z+1/2, x+1/2, -y+1/2' + 38 'z+1/2, -x+1/2, y+1/2' + 39 '-z+1/2, -x+1/2, y+1/2' + 40 'z+1/2, x+1/2, -y+1/2' + 41 'y+1/2, z+1/2, x+1/2' + 42 '-y+1/2, -z+1/2, -x+1/2' + 43 '-y+1/2, z+1/2, -x+1/2' + 44 'y+1/2, -z+1/2, x+1/2' + 45 '-y+1/2, -z+1/2, x+1/2' + 46 'y+1/2, z+1/2, -x+1/2' + 47 'y+1/2, -z+1/2, -x+1/2' + 48 '-y+1/2, z+1/2, x+1/2' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Rb Rb0 2 0.00000000 0.00000000 0.00000000 1.0 + Cu Cu1 8 0.25000000 0.25000000 0.25000000 1.0 + Ag Ag2 6 0.00000000 0.00000000 0.50000000 1.0 + F F3 24 0.00000000 0.21987000 0.28256000 1.0 diff --git a/data/data-release/cifs/symmetry/SrCaSiPt.cif b/data/data-release/cifs/symmetry/SrCaSiPt.cif new file mode 100644 index 0000000000000000000000000000000000000000..4e6c455cf3a58c7e992ef30e3de468b816f8ab37 --- /dev/null +++ b/data/data-release/cifs/symmetry/SrCaSiPt.cif @@ -0,0 +1,30 @@ +# generated using pymatgen +data_SrCaSiPt +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.35906000 +_cell_length_b 4.70308000 +_cell_length_c 5.68889000 +_cell_angle_alpha 114.41600000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural SrCaSiPt +_chemical_formula_sum 'Sr1 Ca1 Si1 Pt1' +_cell_volume 106.19773633 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr1 1 0.50000000 0.64598000 0.29196000 1.0 + Ca Ca1 1 0.00000000 0.93545000 0.87090000 1.0 + Si Si1 1 0.00000000 0.25261000 0.50522000 1.0 + Pt Pt1 1 0.50000000 0.34797000 0.69594000 1.0 diff --git a/data/data-release/cifs/symmetry/SrCaSiPt_symmetrized.cif b/data/data-release/cifs/symmetry/SrCaSiPt_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..998219b04852c88067d74b1eb883f5462c905cc7 --- /dev/null +++ b/data/data-release/cifs/symmetry/SrCaSiPt_symmetrized.cif @@ -0,0 +1,37 @@ +# generated using pymatgen +data_SrCaSiPt +_symmetry_space_group_name_H-M Amm2 +_cell_length_a 4.35906000 +_cell_length_b 4.70308000 +_cell_length_c 10.36024539 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 38 +_chemical_formula_structural SrCaSiPt +_chemical_formula_sum 'Sr2 Ca2 Si2 Pt2' +_cell_volume 212.39547267 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, z' + 3 '-x, y, z' + 4 'x, -y, z' + 5 'x, y+1/2, z+1/2' + 6 '-x, -y+1/2, z+1/2' + 7 '-x, y+1/2, z+1/2' + 8 'x, -y+1/2, z+1/2' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Sr Sr0 2 0.50000000 0.00000000 0.64598000 1.0 + Ca Ca1 2 0.00000000 0.00000000 0.93545000 1.0 + Si Si2 2 0.00000000 0.00000000 0.25261000 1.0 + Pt Pt3 2 0.50000000 0.00000000 0.34797000 1.0 diff --git a/data/data-release/cifs/symmetry/Zn2Sn3.cif b/data/data-release/cifs/symmetry/Zn2Sn3.cif new file mode 100644 index 0000000000000000000000000000000000000000..a593a53df25b99fdb3e873a1bf1a2651285c2ed6 --- /dev/null +++ b/data/data-release/cifs/symmetry/Zn2Sn3.cif @@ -0,0 +1,36 @@ +# generated using pymatgen +data_Zn2Sn3 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.56841000 +_cell_length_b 4.56812000 +_cell_length_c 13.46300000 +_cell_angle_alpha 89.99080000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00200000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Zn2Sn3 +_chemical_formula_sum 'Zn4 Sn6' +_cell_volume 243.31354963 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Zn Zn1 1 0.83366000 0.66731000 0.84887000 1.0 + Zn Zn2 1 0.16634000 0.33269000 0.15113000 1.0 + Zn Zn3 1 0.16626000 0.33252000 0.34863000 1.0 + Zn Zn4 1 0.83374000 0.66748000 0.65137000 1.0 + Sn Sn1 1 0.16694000 0.33388000 0.56951000 1.0 + Sn Sn2 1 0.49966000 0.99931000 0.24997000 1.0 + Sn Sn3 1 0.83310000 0.66620000 0.06997000 1.0 + Sn Sn4 1 0.83306000 0.66612000 0.43049000 1.0 + Sn Sn5 1 0.16690000 0.33380000 0.93003000 1.0 + Sn Sn6 1 0.50034000 0.00069000 0.75003000 1.0 diff --git a/data/data-release/cifs/symmetry/Zn2Sn3_symmetrized.cif b/data/data-release/cifs/symmetry/Zn2Sn3_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..c045ebd60cf926f0bfe40fba0c54905531d98d21 --- /dev/null +++ b/data/data-release/cifs/symmetry/Zn2Sn3_symmetrized.cif @@ -0,0 +1,52 @@ +# generated using pymatgen +data_Zn2Sn3 +_symmetry_space_group_name_H-M P6_3/mmc +_cell_length_a 4.56826500 +_cell_length_b 4.56826500 +_cell_length_c 13.46300000 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 194 +_chemical_formula_structural Zn2Sn3 +_chemical_formula_sum 'Zn4 Sn6' +_cell_volume 243.31845789 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 'x-y, x, z+1/2' + 4 '-x+y, -x, -z+1/2' + 5 '-y, x-y, z' + 6 'y, -x+y, -z' + 7 '-x, -y, z+1/2' + 8 'x, y, -z+1/2' + 9 '-x+y, -x, z' + 10 'x-y, x, -z' + 11 'y, -x+y, z+1/2' + 12 '-y, x-y, -z+1/2' + 13 '-y, -x, -z+1/2' + 14 'y, x, z+1/2' + 15 '-x, -x+y, -z' + 16 'x, x-y, z' + 17 '-x+y, y, -z+1/2' + 18 'x-y, -y, z+1/2' + 19 'y, x, -z' + 20 '-y, -x, z' + 21 'x, x-y, -z+1/2' + 22 '-x, -x+y, z+1/2' + 23 'x-y, -y, -z' + 24 '-x+y, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Zn Zn0 4 0.33333333 0.66666667 0.84887000 1.0 + Sn Sn1 4 0.33333333 0.66666667 0.06951000 1.0 + Sn Sn2 2 0.00000000 0.00000000 0.25000000 1.0 diff --git a/data/data-release/cifs/unconditional/BaLa2Ir.cif b/data/data-release/cifs/unconditional/BaLa2Ir.cif new file mode 100644 index 0000000000000000000000000000000000000000..c2679aa68e3052b6b396187211bc7784fe8a7af9 --- /dev/null +++ b/data/data-release/cifs/unconditional/BaLa2Ir.cif @@ -0,0 +1,30 @@ +# generated using pymatgen +data_BaLa2Ir +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.31195990 +_cell_length_b 4.31195990 +_cell_length_c 10.26642368 +_cell_angle_alpha 78.20801706 +_cell_angle_beta 78.20801706 +_cell_angle_gamma 60.16788176 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural BaLa2Ir +_chemical_formula_sum 'Ba1 La2 Ir1' +_cell_volume 160.90462145 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Ba Ba0 1 0.99717963 0.99717963 0.79013073 1.0 + La La1 1 0.46543049 0.46543049 0.42972222 1.0 + La La2 1 0.22580816 0.22580816 0.13758123 1.0 + Ir Ir3 1 0.84620949 0.84620949 0.28321457 1.0 diff --git a/data/data-release/cifs/unconditional/BaLa2Ir_symmetrized.cif b/data/data-release/cifs/unconditional/BaLa2Ir_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..f717fadb68b4ed89970be1d2be9e106eb4a9ecd5 --- /dev/null +++ b/data/data-release/cifs/unconditional/BaLa2Ir_symmetrized.cif @@ -0,0 +1,33 @@ +# generated using pymatgen +data_BaLa2Ir +_symmetry_space_group_name_H-M Cm +_cell_length_a 7.46220840 +_cell_length_b 4.32289700 +_cell_length_c 10.26642368 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 103.66081034 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 8 +_chemical_formula_structural BaLa2Ir +_chemical_formula_sum 'Ba2 La4 Ir2' +_cell_volume 321.80924291 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 'x, -y, z' + 3 'x+1/2, y+1/2, z' + 4 'x+1/2, -y+1/2, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Ba Ba0 2 0.49717963 0.50000000 0.20986927 1.0 + La La1 2 0.22580816 0.00000000 0.86241877 1.0 + La La2 2 0.46543049 0.00000000 0.57027778 1.0 + Ir Ir3 2 0.34620949 0.50000000 0.71678543 1.0 diff --git a/data/data-release/cifs/unconditional/K3AlCl6.cif b/data/data-release/cifs/unconditional/K3AlCl6.cif new file mode 100644 index 0000000000000000000000000000000000000000..7fa890ab52484c1c4910d94740501f30a70f5a52 --- /dev/null +++ b/data/data-release/cifs/unconditional/K3AlCl6.cif @@ -0,0 +1,36 @@ +# generated using pymatgen +data_K3AlCl6 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 7.33238136 +_cell_length_b 7.34343601 +_cell_length_c 7.34756375 +_cell_angle_alpha 62.44734123 +_cell_angle_beta 62.44859384 +_cell_angle_gamma 62.41862650 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural K3AlCl6 +_chemical_formula_sum 'K3 Al1 Cl6' +_cell_volume 294.95916590 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + K K0 1 0.50000000 0.50000000 0.00000000 1.0 + K K1 1 0.23006284 0.22977339 0.72958001 1.0 + K K2 1 0.76993716 0.77022661 0.27041999 1.0 + Al Al3 1 0.00000000 0.00000000 0.50000000 1.0 + Cl Cl4 1 0.87492148 0.69679512 0.69714610 1.0 + Cl Cl5 1 0.80212326 0.12553601 0.80309122 1.0 + Cl Cl6 1 0.19787674 0.87446399 0.19690878 1.0 + Cl Cl7 1 0.30370222 0.80309155 0.62498254 1.0 + Cl Cl8 1 0.12507852 0.30320488 0.30285390 1.0 + Cl Cl9 1 0.69629778 0.19690845 0.37501746 1.0 diff --git a/data/data-release/cifs/unconditional/K3AlCl6_symmetrized.cif b/data/data-release/cifs/unconditional/K3AlCl6_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..03ea05585f4fcad984f3369649a54921742f9e77 --- /dev/null +++ b/data/data-release/cifs/unconditional/K3AlCl6_symmetrized.cif @@ -0,0 +1,47 @@ +# generated using pymatgen +data_K3AlCl6 +_symmetry_space_group_name_H-M R-3 +_cell_length_a 7.60722965 +_cell_length_b 7.60722965 +_cell_length_c 17.64351281 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 148 +_chemical_formula_structural K3AlCl6 +_chemical_formula_sum 'K9 Al3 Cl18' +_cell_volume 884.23712130 +_cell_formula_units_Z 3 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-y, x-y, z' + 4 'y, -x+y, -z' + 5 '-x+y, -x, z' + 6 'x-y, x, -z' + 7 'x+2/3, y+1/3, z+1/3' + 8 '-x+2/3, -y+1/3, -z+1/3' + 9 '-y+2/3, x-y+1/3, z+1/3' + 10 'y+2/3, -x+y+1/3, -z+1/3' + 11 '-x+y+2/3, -x+1/3, z+1/3' + 12 'x-y+2/3, x+1/3, -z+1/3' + 13 'x+1/3, y+2/3, z+2/3' + 14 '-x+1/3, -y+2/3, -z+2/3' + 15 '-y+1/3, x-y+2/3, z+2/3' + 16 'y+1/3, -x+y+2/3, -z+2/3' + 17 '-x+y+1/3, -x+2/3, z+2/3' + 18 'x-y+1/3, x+2/3, -z+2/3' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + K K0 6 0.00000000 0.00000000 0.27019459 1.0 + K K1 3 -0.00000000 0.00000000 0.00000000 1.0 + Al Al2 3 -0.00000000 0.00000000 0.50000000 1.0 + Cl Cl3 18 0.04803275 0.77384089 0.57704577 1.0 diff --git a/data/data-release/cifs/unconditional/NaNiIO6.cif b/data/data-release/cifs/unconditional/NaNiIO6.cif new file mode 100644 index 0000000000000000000000000000000000000000..e1de2526c93d9f0d0028c7678088c0f8cdbcd2e1 --- /dev/null +++ b/data/data-release/cifs/unconditional/NaNiIO6.cif @@ -0,0 +1,35 @@ +# generated using pymatgen +data_NaNiIO6 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.98851926 +_cell_length_b 4.99761685 +_cell_length_c 5.25109022 +_cell_angle_alpha 89.96540485 +_cell_angle_beta 89.93068350 +_cell_angle_gamma 60.06019962 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural NaNiIO6 +_chemical_formula_sum 'Na1 Ni1 I1 O6' +_cell_volume 113.44295559 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Na Na0 1 0.16534233 0.66931533 0.50000000 1.0 + Ni Ni1 1 0.83237049 0.33525903 0.00000000 1.0 + I I2 1 0.49904121 0.00191759 0.00000000 1.0 + O O3 1 0.79204929 0.04494263 0.79729069 1.0 + O O4 1 0.54162815 0.29437474 0.20288336 1.0 + O O5 1 0.16399711 0.29437474 0.79711664 1.0 + O O6 1 0.79159710 0.66639417 0.20312793 1.0 + O O7 1 0.16300808 0.04494263 0.20270931 1.0 + O O8 1 0.54200873 0.66639417 0.79687207 1.0 diff --git a/data/data-release/cifs/unconditional/NaNiIO6_symmetrized.cif b/data/data-release/cifs/unconditional/NaNiIO6_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..5e3106604c90469cda58eba85298f6753924ff07 --- /dev/null +++ b/data/data-release/cifs/unconditional/NaNiIO6_symmetrized.cif @@ -0,0 +1,35 @@ +# generated using pymatgen +data_NaNiIO6 +_symmetry_space_group_name_H-M P312 +_cell_length_a 4.99306805 +_cell_length_b 4.99306805 +_cell_length_c 5.25109022 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 149 +_chemical_formula_structural NaNiIO6 +_chemical_formula_sum 'Na1 Ni1 I1 O6' +_cell_volume 113.37442114 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-y, x-y, z' + 3 '-x+y, -x, z' + 4 '-y, -x, -z' + 5 '-x+y, y, -z' + 6 'x, x-y, -z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Na Na0 1 0.66666667 0.33333333 0.50000000 1.0 + Ni Ni1 1 0.00000000 0.00000000 0.00000000 1.0 + I I2 1 0.33333333 0.66666667 0.00000000 1.0 + O O3 6 0.03995971 0.33099907 0.79729069 1.0 diff --git a/data/data-release/cifs/unconditional/NaSm(TmTe2)2.cif b/data/data-release/cifs/unconditional/NaSm(TmTe2)2.cif new file mode 100644 index 0000000000000000000000000000000000000000..6e3f2c59844e561293e0456d1e22930541a8412d --- /dev/null +++ b/data/data-release/cifs/unconditional/NaSm(TmTe2)2.cif @@ -0,0 +1,34 @@ +# generated using pymatgen +data_NaSm(TmTe2)2 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.33961221 +_cell_length_b 7.62587056 +_cell_length_c 7.63459219 +_cell_angle_alpha 108.76240059 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural NaSm(TmTe2)2 +_chemical_formula_sum 'Na1 Sm1 Tm2 Te4' +_cell_volume 239.22811179 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Na Na0 1 0.50000000 0.50000000 0.00000000 1.0 + Sm Sm1 1 0.00000000 0.50000000 0.50000000 1.0 + Tm Tm2 1 0.00000000 0.00000000 0.00000000 1.0 + Tm Tm3 1 0.50000000 0.00000000 0.50000000 1.0 + Te Te4 1 0.00000000 0.76075858 0.25327494 1.0 + Te Te5 1 0.00000000 0.23924142 0.74672506 1.0 + Te Te6 1 0.50000000 0.75933998 0.75608487 1.0 + Te Te7 1 0.50000000 0.24066002 0.24391513 1.0 diff --git a/data/data-release/cifs/unconditional/NaSm(TmTe2)2_symmetrized.cif b/data/data-release/cifs/unconditional/NaSm(TmTe2)2_symmetrized.cif new file mode 100644 index 0000000000000000000000000000000000000000..ac80134111d5a4a42de06b8e23ff017151b04aa0 --- /dev/null +++ b/data/data-release/cifs/unconditional/NaSm(TmTe2)2_symmetrized.cif @@ -0,0 +1,35 @@ +# generated using pymatgen +data_NaSm(TmTe2)2 +_symmetry_space_group_name_H-M P2/m +_cell_length_a 7.62587056 +_cell_length_b 4.33961221 +_cell_length_c 7.63459219 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 108.76240059 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 10 +_chemical_formula_structural NaSm(TmTe2)2 +_chemical_formula_sum 'Na1 Sm1 Tm2 Te4' +_cell_volume 239.22811179 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' + 2 '-x, -y, -z' + 3 '-x, y, -z' + 4 'x, -y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Na Na0 1 0.50000000 0.50000000 0.00000000 1.0 + Sm Sm1 1 0.50000000 0.00000000 0.50000000 1.0 + Tm Tm2 1 0.00000000 0.00000000 0.00000000 1.0 + Tm Tm3 1 0.00000000 0.50000000 0.50000000 1.0 + Te Te4 2 0.23924142 0.00000000 0.74672506 1.0 + Te Te5 2 0.24066002 0.50000000 0.24391513 1.0 diff --git a/data/data-release/mp-20/mp_20.zip b/data/data-release/mp-20/mp_20.zip new file mode 100644 index 0000000000000000000000000000000000000000..9ee2ac72b48e49bf94096597bf57eef438d23c53 --- /dev/null +++ b/data/data-release/mp-20/mp_20.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c19680a9e3bd88c500138b3ab503e141959f1afab831e04c19447eb9adb7d0f +size 133 diff --git a/data/data-release/nanoindentation_measurements/LICENSE.md b/data/data-release/nanoindentation_measurements/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..6faa45102268da9ba592923f54cf866e96afc3f7 --- /dev/null +++ b/data/data-release/nanoindentation_measurements/LICENSE.md @@ -0,0 +1,35 @@ +# Community Data License Agreement - Permissive - Version 2.0 + +This is the Community Data License Agreement - Permissive, Version 2.0 (the "agreement"). Data Provider(s) and Data Recipient(s) agree as follows: + +## 1. Provision of the Data + +1.1. A Data Recipient may use, modify, and share the Data made available by Data Provider(s) under this agreement if that Data Recipient follows the terms of this agreement. + +1.2. This agreement does not impose any restriction on a Data Recipient's use, modification, or sharing of any portions of the Data that are in the public domain or that may be used, modified, or shared under any other legal exception or limitation. + +## 2. Conditions for Sharing Data + +2.1. A Data Recipient may share Data, with or without modifications, so long as the Data Recipient makes available the text of this agreement with the shared Data. + +## 3. No Restrictions on Results + +3.1. This agreement does not impose any restriction or obligations with respect to the use, modification, or sharing of Results. + +## 4. No Warranty; Limitation of Liability + +4.1. All Data Recipients receive the Data subject to the following terms: + +THE DATA IS PROVIDED ON AN "AS IS" BASIS, WITHOUT REPRESENTATIONS, WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +NO DATA PROVIDER SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE DATA OR RESULTS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +## 5. Definitions + +5.1. "Data" means the material received by a Data Recipient under this agreement. + +5.2. "Data Provider" means any person who is the source of Data provided under this agreement and in reliance on a Data Recipient's agreement to its terms. + +5.3. "Data Recipient" means any person who receives Data directly or indirectly from a Data Provider and agrees to the terms of this agreement. + +5.4. "Results" means any outcome obtained by computational analysis of Data, including for example machine learning models and models' insights. \ No newline at end of file diff --git a/data/data-release/nanoindentation_measurements/depth_load_measurements_TaCr2O6.csv b/data/data-release/nanoindentation_measurements/depth_load_measurements_TaCr2O6.csv new file mode 100644 index 0000000000000000000000000000000000000000..1c31baba3c950128fa014680d7764b9b8f2d5a1e --- /dev/null +++ b/data/data-release/nanoindentation_measurements/depth_load_measurements_TaCr2O6.csv @@ -0,0 +1,1135 @@ +Time,Depth 1,Load 1,Depth 2,Load 2,Depth 3,Load 3,Depth 4,Load 4 +0,0,0,0,0,0,0,0,0 +0.01021,0.24947,1.48E-04,0.09127,2.54E-04,0.06503,-1.99E-05,0.55201,1.59E-04 +0.02022,0.87581,2.71E-04,0.19293,2.42E-04,-0.3258,1.78E-04,0.51959,2.75E-04 +0.03404,1.00556,0.00211,0.64269,0.00241,0.40009,0.00212,0.50446,0.00202 +0.045,1.92345,0.00428,1.46037,0.00433,0.78408,0.00382,1.00825,0.00454 +0.05501,2.90865,0.00613,1.65564,0.00705,1.38882,0.00617,2.36084,0.0062 +0.06593,4.03017,0.00823,2.53605,0.00836,1.76108,0.00834,3.04099,0.00858 +0.0769,4.76266,0.01041,2.47912,0.01052,1.82675,0.01059,3.36032,0.01054 +0.08787,5.15159,0.01246,2.94021,0.0131,2.12972,0.01267,4.04896,0.01244 +0.09894,5.83471,0.01416,3.9593,0.01482,2.29639,0.0145,4.70517,0.01404 +0.1099,5.75225,0.01676,4.22289,0.01688,2.70922,0.01679,4.67802,0.01689 +0.11994,6.33235,0.01886,4.33918,0.01965,3.2453,0.01911,5.34589,0.01865 +0.12995,6.38235,0.02075,4.60766,0.02086,3.29843,0.02098,5.6323,0.02065 +0.14087,6.54689,0.02234,4.9017,0.02318,4.08737,0.02318,6.33865,0.02286 +0.15089,6.44852,0.02527,4.9205,0.02478,4.07866,0.02507,7.05634,0.02489 +0.16187,7.10933,0.02719,5.8291,0.02738,4.10717,0.02709,7.32488,0.02659 +0.17287,7.15764,0.02992,6.03768,0.02983,4.4953,0.02911,7.42514,0.02925 +0.18381,7.93001,0.03147,6.05234,0.03204,5.03431,0.03141,7.93249,0.03146 +0.1948,7.72724,0.03368,6.0046,0.03351,5.47205,0.03336,8.20199,0.03347 +0.20577,8.07465,0.03579,6.49884,0.03571,6.01234,0.03588,8.71525,0.03554 +0.21682,7.92563,0.038,6.57491,0.03777,6.26749,0.03739,8.96705,0.03748 +0.22776,8.18825,0.03967,6.842,0.03996,6.35355,0.03968,9.24787,0.04005 +0.23865,8.63282,0.04232,6.45619,0.04203,6.606,0.04137,10.08401,0.04178 +0.24957,8.72104,0.04447,7.02037,0.04412,6.73091,0.04405,10.1614,0.04375 +0.25967,8.65599,0.04679,7.45906,0.04617,6.95141,0.04606,10.45163,0.04638 +0.27072,9.00819,0.04868,7.72971,0.04854,7.11721,0.04796,11.1037,0.04786 +0.28074,9.46949,0.05068,7.72673,0.05021,7.1424,0.04999,11.20525,0.05007 +0.29166,9.21108,0.05242,8.03834,0.05263,7.13435,0.05215,11.40204,0.052 +0.30265,9.25562,0.05505,7.88652,0.05492,7.74941,0.05434,11.56603,0.05376 +0.31359,9.56854,0.05717,8.40316,0.05699,7.6668,0.05697,12.23424,0.0564 +0.32366,9.89598,0.05858,8.77589,0.05931,8.11189,0.05862,12.42779,0.0583 +0.33459,9.8283,0.06124,8.87602,0.06127,7.86254,0.06132,12.47852,0.06019 +0.34465,9.93388,0.06335,9.33972,0.06354,8.37345,0.06329,13.03799,0.06265 +0.35553,10.3973,0.06572,9.20294,0.06538,8.0235,0.06469,13.14967,0.06459 +0.36652,10.53363,0.0677,9.42712,0.06827,8.084,0.06708,13.19589,0.0668 +0.37739,10.65138,0.06942,9.55771,0.06992,8.2773,0.06912,13.88675,0.06886 +0.38749,11.1287,0.07172,9.45992,0.07176,8.77647,0.07122,14.08279,0.07046 +0.3985,11.07614,0.07404,9.93337,0.074,8.44034,0.07337,14.3679,0.07319 +0.40941,10.77564,0.07647,10.04803,0.07606,9.04807,0.0754,14.26072,0.07532 +0.41948,11.3243,0.07797,10.29496,0.07821,9.04063,0.07744,14.4821,0.07726 +0.43036,11.26263,0.08038,10.06548,0.0804,9.20998,0.07916,14.8102,0.07906 +0.44135,11.80996,0.08212,10.56664,0.08238,9.24035,0.08156,15.30687,0.08153 +0.45145,12.08772,0.08468,10.17279,0.08434,9.86975,0.08345,15.38092,0.08352 +0.46235,11.88338,0.08668,10.58002,0.08635,10.31227,0.08583,15.67082,0.0859 +0.47327,12.00615,0.08932,10.81852,0.08857,10.18241,0.0879,15.87884,0.088 +0.4833,12.16832,0.09075,11.09706,0.09052,10.73928,0.08988,15.99594,0.09044 +0.4943,12.30177,0.09302,11.06808,0.0933,10.54018,0.09188,16.54343,0.09244 +0.50524,12.4321,0.09548,11.74888,0.09487,10.51425,0.09396,16.93558,0.09415 +0.51526,12.42295,0.0972,11.51255,0.09702,10.76089,0.09616,17.05599,0.09646 +0.52527,12.88865,0.0992,11.54922,0.09918,11.41715,0.09817,17.10382,0.09868 +0.53625,12.9533,0.10112,11.62001,0.10138,11.56796,0.10064,17.60278,0.10079 +0.54625,13.14216,0.10302,11.83997,0.10368,11.29952,0.10242,18.14099,0.10286 +0.55724,13.25303,0.10551,12.02069,0.10553,11.73433,0.10451,18.12021,0.10503 +0.5682,13.06408,0.10756,12.3661,0.10765,11.74237,0.10676,18.6033,0.107 +0.57906,13.0841,0.10978,12.54187,0.10965,11.76985,0.10889,18.84079,0.10932 +0.59004,13.4039,0.11161,12.58503,0.11207,11.78315,0.11089,19.00287,0.11116 +0.60098,13.5263,0.11427,12.98707,0.1141,12.10208,0.11304,19.21194,0.11346 +0.61101,13.5886,0.1162,13.14204,0.11622,11.81745,0.11491,19.01748,0.1154 +0.6219,13.88547,0.11783,13.31788,0.11821,12.31434,0.11707,19.27826,0.11727 +0.63196,13.83171,0.12023,12.81874,0.12028,11.87267,0.11935,19.63101,0.12023 +0.64293,13.77443,0.1225,13.32436,0.12231,11.93543,0.12161,20.09049,0.12173 +0.65395,14.20454,0.12459,13.41627,0.12459,12.41225,0.12369,20.3146,0.12372 +0.66402,14.39058,0.12678,13.88907,0.12667,12.60256,0.12586,20.73793,0.12617 +0.67501,14.17998,0.12894,13.78113,0.12894,12.75346,0.12789,20.89967,0.12846 +0.68591,14.60435,0.13067,14.10476,0.13064,12.16482,0.13051,20.74719,0.13043 +0.69595,14.65562,0.13305,13.97121,0.13307,12.60159,0.13207,21.38734,0.1324 +0.70691,14.71178,0.13528,14.23375,0.13519,12.67704,0.13408,20.90671,0.135 +0.71789,15.14058,0.13719,14.59615,0.13724,13.00138,0.13639,21.23512,0.13679 +0.7279,15.27038,0.13945,14.41118,0.14011,13.12534,0.13839,21.45383,0.13896 +0.7388,15.08456,0.14164,15.1703,0.14157,13.47858,0.14042,22.20391,0.14111 +0.74882,15.44185,0.14332,14.98499,0.14431,13.61944,0.14232,21.87441,0.14329 +0.75978,15.34533,0.14576,15.38695,0.14596,14.04415,0.14451,22.41974,0.14551 +0.77078,15.42188,0.14796,14.77894,0.14799,13.80201,0.14653,22.37729,0.14743 +0.7817,15.88119,0.15017,15.55267,0.14979,14.42452,0.14878,22.42683,0.14952 +0.79173,15.51574,0.15212,15.32188,0.15235,14.27812,0.15088,22.50541,0.1517 +0.80173,15.63925,0.15412,15.45061,0.15427,14.3959,0.15304,22.99766,0.15376 +0.81268,16.04326,0.15685,15.77066,0.15657,14.30528,0.1545,23.0048,0.15562 +0.82363,16.11892,0.15849,15.89873,0.15851,14.57328,0.15716,23.27238,0.15769 +0.83468,16.10275,0.16071,15.4606,0.1602,14.31068,0.15971,23.48753,0.16003 +0.8455,16.68087,0.1629,16.11645,0.1629,14.93253,0.16155,23.26654,0.16195 +0.85552,16.41283,0.16488,16.17076,0.16463,15.13588,0.16359,23.54641,0.16408 +0.86559,16.49862,0.1668,16.09888,0.16678,14.69228,0.16566,24.2952,0.16628 +0.87573,16.35938,0.16886,16.08517,0.16931,14.9742,0.16802,24.30095,0.16845 +0.88666,16.39921,0.17136,16.55537,0.17119,15.00879,0.17013,24.32979,0.1706 +0.89666,16.99657,0.17311,16.53883,0.17317,15.07801,0.17229,24.58936,0.17256 +0.90768,17.196,0.17509,16.93558,0.17526,15.18197,0.17433,24.94689,0.17458 +0.91849,16.98261,0.17689,16.81755,0.17754,14.90931,0.17698,25.08124,0.17654 +0.92859,16.96744,0.17944,16.99113,0.17955,15.23948,0.17866,24.8443,0.17867 +0.93955,17.32243,0.18147,17.38658,0.18163,15.62275,0.18082,25.10354,0.18077 +0.94964,17.63482,0.18355,17.23509,0.1839,15.57129,0.18237,25.35851,0.18347 +0.96046,17.6152,0.18579,17.49934,0.18586,16.06082,0.18486,26.00124,0.18472 +0.97052,17.67935,0.18767,17.66923,0.18806,16.3175,0.18698,25.59147,0.18705 +0.98149,17.59911,0.1899,17.97664,0.1902,16.56769,0.18896,26.00824,0.18908 +0.99234,17.76684,0.19208,17.87788,0.1922,16.66031,0.19106,26.07259,0.19136 +1.00341,17.99959,0.19422,18.0118,0.1942,16.23874,0.19335,26.72107,0.19344 +1.01434,18.10567,0.19598,17.80831,0.19636,16.51614,0.19558,26.74334,0.19557 +1.02437,17.98943,0.19838,18.31564,0.19834,16.96221,0.19765,26.69675,0.19768 +1.03526,18.31232,0.20063,18.29122,0.20057,16.78927,0.19996,26.93746,0.19994 +1.04527,18.37424,0.2026,18.41507,0.20215,16.62418,0.20182,27.3264,0.20184 +1.05625,18.78525,0.2049,18.44622,0.2047,16.91192,0.2041,27.03315,0.20414 +1.06725,18.74896,0.20699,18.68349,0.2066,17.22977,0.20613,27.2144,0.2062 +1.07823,18.65115,0.20924,18.78581,0.20864,17.57491,0.20828,27.33085,0.20856 +1.08827,18.97162,0.21116,18.93004,0.21106,17.38743,0.21042,27.91007,0.21055 +1.09924,19.01681,0.21334,18.93779,0.21316,17.40461,0.21217,27.90904,0.2129 +1.11027,18.75532,0.21556,19.24136,0.21562,17.25564,0.21458,27.8559,0.21491 +1.12121,18.87999,0.21766,19.08994,0.21717,17.59129,0.21669,28.27073,0.2171 +1.13121,19.61147,0.21967,19.65537,0.21942,17.28667,0.21862,27.95707,0.21929 +1.14206,19.06813,0.22198,19.49672,0.22171,17.95808,0.22092,28.22854,0.2215 +1.15317,19.51418,0.22401,19.35473,0.22399,17.96684,0.22288,28.26287,0.22346 +1.16408,19.57288,0.22622,19.589,0.2257,18.01025,0.22543,29.0845,0.22534 +1.17499,19.73463,0.22837,20.17921,0.22769,18.55829,0.22707,28.58022,0.22781 +1.18499,19.8958,0.23037,19.9159,0.22975,18.31121,0.22925,29.13098,0.23041 +1.19598,20.33782,0.23252,20.5044,0.23204,18.59992,0.23151,29.10156,0.23166 +1.2069,20.19692,0.2348,20.06635,0.23408,18.96117,0.23361,29.47398,0.23424 +1.21691,20.41382,0.2367,20.2886,0.23601,19.26941,0.23559,29.68364,0.2364 +1.22785,20.3672,0.23886,20.52936,0.23841,18.72642,0.23801,29.33113,0.23856 +1.2388,20.52071,0.2411,20.40686,0.24046,19.12943,0.23994,30.11427,0.24073 +1.24887,20.6901,0.24309,20.74513,0.24276,18.96588,0.24257,29.83337,0.2427 +1.2597,20.59423,0.2446,20.77693,0.24479,19.22715,0.24405,30.422,0.2449 +1.26972,20.72177,0.24693,20.8624,0.24687,19.57352,0.24633,30.36272,0.24701 +1.27978,21.04351,0.24916,21.00989,0.24903,19.24745,0.24858,31.17205,0.24897 +1.2906,20.9928,0.25135,21.36026,0.25137,19.40061,0.25047,30.91568,0.25142 +1.30069,21.03214,0.25286,21.05675,0.25296,19.62261,0.25269,30.98714,0.2533 +1.31163,20.7153,0.25553,21.6342,0.25517,19.64814,0.25542,30.85156,0.25561 +1.32165,21.3186,0.2576,21.21784,0.25766,20.24288,0.25697,31.38874,0.25776 +1.33258,21.50238,0.25921,21.87815,0.2595,19.91099,0.25908,30.91659,0.25963 +1.3436,21.41893,0.2619,21.96357,0.26171,20.09772,0.26121,31.35603,0.26168 +1.35446,21.73595,0.26407,22.08377,0.26387,20.31886,0.26366,31.85896,0.26386 +1.36452,21.41669,0.26633,21.86994,0.26585,20.32204,0.26542,31.85082,0.26602 +1.37552,21.83639,0.26826,21.96609,0.26829,20.77781,0.26721,31.77664,0.26816 +1.38637,21.60191,0.27098,21.90463,0.27015,20.56029,0.27005,32.21519,0.27014 +1.39647,22.07507,0.27219,22.54616,0.27221,20.69232,0.27178,32.1543,0.27236 +1.4075,21.91506,0.27457,22.65954,0.27443,20.9154,0.2738,32.36525,0.27453 +1.41836,22.22167,0.27631,22.32507,0.27662,20.97695,0.27573,32.54489,0.27651 +1.42839,22.36242,0.27882,22.73484,0.27878,20.83,0.27788,32.85518,0.27869 +1.43839,22.51666,0.28076,22.51248,0.28079,20.89276,0.27989,32.85611,0.28087 +1.44927,22.26714,0.28322,22.87479,0.28309,21.31001,0.28183,33.1571,0.28282 +1.46025,22.31951,0.28514,23.1526,0.2854,20.99949,0.28428,32.9072,0.28556 +1.47134,22.66382,0.28724,22.98095,0.28752,21.53618,0.28644,33.11597,0.28724 +1.48221,22.79504,0.28957,23.24771,0.28935,21.28683,0.28853,33.78486,0.28918 +1.49225,22.97134,0.29138,23.81118,0.2918,21.29521,0.29081,33.73754,0.29096 +1.50328,22.93007,0.29365,23.00687,0.29383,21.46775,0.29289,33.67737,0.29329 +1.51423,23.16375,0.2958,23.54433,0.29569,21.79499,0.29501,33.74204,0.29553 +1.52525,22.99523,0.29801,23.7396,0.29821,22.33464,0.29717,33.911,0.29756 +1.53526,23.48383,0.30005,23.58842,0.30033,22.05681,0.2994,34.4595,0.2997 +1.54623,23.21886,0.30229,23.65303,0.30262,21.89658,0.30095,34.40509,0.30187 +1.55724,23.7046,0.3044,24.44206,0.30478,22.10599,0.30351,34.53618,0.30384 +1.56821,23.61869,0.30654,23.87466,0.30681,22.45718,0.30569,34.19728,0.30607 +1.57823,23.992,0.30874,24.27053,0.30864,22.723,0.30742,34.84706,0.30817 +1.58922,23.75527,0.31079,24.32279,0.31093,23.05543,0.30988,35.13438,0.31017 +1.59923,24.39784,0.31274,24.63319,0.31294,23.02817,0.31201,35.1709,0.31263 +1.61023,23.69579,0.31489,24.69716,0.31498,22.98644,0.31463,35.41552,0.31507 +1.62122,24.12243,0.31712,24.30874,0.31732,23.10908,0.31611,35.1673,0.3168 +1.63123,24.26946,0.31972,24.76106,0.31938,23.03886,0.31815,35.30715,0.31878 +1.64125,24.59375,0.32102,25.15815,0.32171,23.48912,0.32038,35.75152,0.32072 +1.65198,24.24079,0.32331,24.70515,0.32367,23.64025,0.32255,35.76126,0.32276 +1.66297,24.67903,0.32501,25.30665,0.32588,23.89173,0.32478,35.94826,0.32487 +1.67298,25.11168,0.32731,25.29694,0.3279,23.43358,0.32693,36.08162,0.32687 +1.683,24.55116,0.32941,25.4285,0.32993,23.72758,0.32892,36.1149,0.32896 +1.69392,24.84451,0.33181,25.60273,0.33193,23.60296,0.33092,36.64267,0.33111 +1.70491,24.91291,0.33373,25.90687,0.33414,23.69776,0.33318,36.64229,0.3334 +1.71585,25.04041,0.33595,25.22703,0.33616,23.83658,0.33526,36.60277,0.33551 +1.72687,25.10189,0.33808,25.52434,0.33871,23.96506,0.33728,37.0015,0.3375 +1.73785,25.29791,0.34031,25.73692,0.34015,24.30005,0.33966,36.87846,0.33971 +1.74883,25.43515,0.34259,26.13724,0.34246,24.3534,0.3414,37.69525,0.34184 +1.75978,25.55127,0.34473,25.8512,0.34406,24.34891,0.34378,37.88882,0.34381 +1.77074,25.4318,0.34691,26.66914,0.34682,24.39871,0.34597,37.7208,0.34543 +1.78177,25.90455,0.34889,26.5096,0.3488,24.65481,0.34796,38.0341,0.34808 +1.79271,25.803,0.35131,26.64246,0.35144,24.93414,0.35018,38.59069,0.35013 +1.80363,25.80041,0.35364,26.93207,0.35316,24.86059,0.35233,38.28683,0.35217 +1.81365,26.13346,0.35555,26.75879,0.35522,25.28851,0.35475,38.37124,0.35427 +1.8246,26.5635,0.35763,26.49321,0.35774,25.19942,0.35674,38.94045,0.35652 +1.83559,26.5298,0.35992,26.99981,0.3596,25.22018,0.35867,38.87728,0.35886 +1.8456,26.11692,0.36179,27.10278,0.36156,25.16411,0.36053,39.53647,0.36083 +1.85657,26.4307,0.36397,26.90002,0.36379,25.24927,0.36292,38.92613,0.3628 +1.8675,26.70872,0.36636,26.95823,0.36585,25.66003,0.36516,39.19273,0.36505 +1.87842,26.6967,0.36824,27.29323,0.368,25.80598,0.36704,39.43152,0.36724 +1.88859,26.76356,0.37037,27.47949,0.36996,25.68201,0.36926,39.88778,0.36903 +1.89947,26.50336,0.37255,27.24414,0.37211,25.8163,0.37148,39.68092,0.37148 +1.90958,27.26751,0.37469,27.40146,0.3741,25.93896,0.37353,40.14108,0.37375 +1.92052,26.9953,0.37666,27.92594,0.37627,25.83075,0.37579,39.65921,0.37566 +1.93148,27.54883,0.37844,27.61779,0.37838,25.68274,0.37814,40.07179,0.37795 +1.94245,27.49221,0.38108,28.11172,0.38073,25.92234,0.37999,40.08954,0.37995 +1.95247,27.3093,0.38304,28.32486,0.38347,26.10777,0.38217,40.50082,0.38218 +1.96335,27.27625,0.38487,28.49843,0.38475,26.32009,0.38386,40.54875,0.38418 +1.97342,27.60396,0.38711,28.03885,0.38704,26.68043,0.38638,40.32311,0.38642 +1.98438,27.62486,0.38934,28.50166,0.38904,26.10542,0.38849,40.33146,0.3886 +1.99531,27.65249,0.39147,28.13437,0.39117,26.48964,0.39094,40.58319,0.3909 +2.00544,27.80831,0.39357,28.50002,0.39318,26.67939,0.39267,40.80102,0.39273 +2.01544,28.02791,0.39551,28.80229,0.39524,27.0529,0.39495,41.49883,0.39482 +2.02637,27.77589,0.39771,28.62771,0.39802,26.61267,0.3974,40.94049,0.39693 +2.03729,28.156,0.39986,29.15293,0.39916,27.49964,0.39915,41.56214,0.39914 +2.04733,28.59459,0.40184,29.18156,0.40128,27.46372,0.40101,41.49485,0.40113 +2.05818,28.17754,0.40409,29.02551,0.40351,27.52516,0.40266,41.7427,0.40331 +2.06822,28.17596,0.40649,29.03172,0.40548,27.40143,0.40543,41.52557,0.40496 +2.07921,28.30626,0.40823,29.43075,0.40742,28.00848,0.40739,42.0269,0.40728 +2.0902,28.73541,0.41038,29.31443,0.40975,27.8171,0.40987,41.8346,0.40944 +2.10022,28.72468,0.41289,29.55389,0.41188,27.95892,0.41169,42.3243,0.41136 +2.11121,29.14814,0.41464,29.54863,0.41368,28.25443,0.41375,42.31746,0.41374 +2.12122,29.11484,0.41663,29.48293,0.41628,28.15475,0.41573,42.44337,0.4155 +2.132,28.84897,0.4183,30.20476,0.41827,28.61578,0.4174,42.21481,0.41778 +2.14221,29.29915,0.42077,29.89044,0.42009,28.70668,0.41994,42.45976,0.41996 +2.15323,29.65916,0.42294,30.14332,0.4223,28.59656,0.42207,42.7377,0.42212 +2.16408,29.56574,0.42518,30.13384,0.42465,28.71628,0.42441,43.06947,0.4241 +2.17502,29.59898,0.42729,30.48812,0.42667,28.52983,0.42627,42.8432,0.42627 +2.18596,29.41795,0.42982,30.2197,0.42902,29.0076,0.42853,42.88035,0.42848 +2.19597,29.62717,0.43175,30.51247,0.43079,29.05966,0.43054,43.15019,0.43055 +2.20692,29.97175,0.43364,30.62592,0.43274,29.41029,0.43274,43.32134,0.43281 +2.21698,29.83226,0.43571,30.55177,0.4347,29.07419,0.43481,43.85108,0.43513 +2.22793,29.77057,0.43802,30.97104,0.43712,29.14179,0.43706,43.80774,0.43755 +2.23889,29.87324,0.44002,30.99902,0.43895,29.0052,0.43901,44.10996,0.43911 +2.24891,30.39951,0.44199,31.13807,0.44116,29.14595,0.44123,44.19477,0.44116 +2.25988,30.29919,0.44447,30.67271,0.44312,28.95045,0.44321,44.36883,0.44329 +2.26991,30.50908,0.44619,31.12569,0.44517,29.60563,0.44535,44.14483,0.44547 +2.281,30.52878,0.44831,31.45201,0.44728,29.19701,0.4476,44.26677,0.44771 +2.29172,30.60221,0.45043,31.44675,0.44952,29.98524,0.4499,44.60274,0.44942 +2.30262,30.78969,0.45267,31.39438,0.45146,30.22474,0.45198,44.86515,0.45183 +2.31265,31.0998,0.45442,31.83013,0.45393,29.89037,0.45401,45.11688,0.45403 +2.32364,31.01894,0.45688,32.03319,0.45587,29.89969,0.45667,44.83687,0.45616 +2.33365,31.40382,0.45892,31.83466,0.4577,30.25001,0.45825,45.51072,0.45819 +2.34462,30.93969,0.4607,32.14659,0.46021,30.43585,0.46011,45.2935,0.46048 +2.35558,31.10988,0.46321,32.02735,0.46227,30.77214,0.46231,45.15977,0.46257 +2.36657,31.40542,0.46542,31.71562,0.46387,30.27355,0.46458,45.65951,0.46451 +2.37742,31.06324,0.46768,32.36912,0.46666,30.62838,0.46651,45.39212,0.46664 +2.38743,31.49587,0.46963,32.44553,0.46858,30.79051,0.46875,45.53542,0.46941 +2.39846,31.05781,0.47195,32.20497,0.47097,30.49746,0.47138,45.69144,0.47071 +2.40846,31.34747,0.47401,32.69176,0.47294,30.81896,0.47282,46.31021,0.473 +2.41939,31.43723,0.4759,32.40287,0.47497,30.87199,0.47499,46.40895,0.47464 +2.43058,31.55869,0.47836,32.58157,0.47735,31.10253,0.47699,45.92278,0.4772 +2.44127,31.94669,0.48023,32.11198,0.4792,31.19741,0.47944,46.60559,0.47945 +2.45129,31.86185,0.48225,32.64751,0.48135,31.51428,0.48124,46.60036,0.48121 +2.4623,32.00944,0.4846,32.99032,0.4833,31.59904,0.48341,46.41915,0.48349 +2.47323,32.38385,0.48658,33.35402,0.48545,31.35521,0.48563,46.72006,0.4858 +2.48324,31.87203,0.48866,32.92075,0.4877,31.75268,0.48777,47.15929,0.48773 +2.49325,32.03199,0.49078,32.9887,0.48972,31.9107,0.48976,46.91918,0.48999 +2.50422,32.55531,0.49281,32.92853,0.49189,31.86207,0.49183,47.62563,0.4919 +2.51527,32.86846,0.49502,32.98901,0.49393,31.97314,0.49398,47.23395,0.49382 +2.52625,32.64023,0.49712,33.62301,0.49633,32.17671,0.49617,46.8083,0.49629 +2.5372,33.06906,0.49945,33.77278,0.49822,32.7121,0.49848,47.4921,0.49855 +2.54721,32.8912,0.50142,34.16572,0.50025,32.24004,0.50053,47.80338,0.50075 +2.55801,32.7137,0.50356,33.8007,0.50189,32.31776,0.50256,47.92307,0.50281 +2.56806,32.98761,0.50553,33.78741,0.50423,32.28143,0.50481,47.82342,0.50549 +2.57899,33.44936,0.50715,33.45725,0.50648,32.68539,0.50693,48.07968,0.50699 +2.59,33.25292,0.50988,33.88034,0.50858,32.64875,0.50869,48.0878,0.50903 +2.60088,33.47246,0.51162,34.39257,0.51089,32.67752,0.51124,48.50071,0.5106 +2.61093,33.26733,0.51423,33.98472,0.51266,32.7151,0.51328,48.80975,0.51345 +2.62093,33.59717,0.51605,33.81122,0.51456,32.952,0.51582,48.47437,0.51552 +2.63185,33.56882,0.51824,34.29085,0.51681,33.11356,0.51746,48.64788,0.51737 +2.64185,33.50508,0.52024,34.39218,0.51865,33.22788,0.51941,48.84524,0.51974 +2.65284,33.54801,0.52239,34.75784,0.52092,33.31878,0.52155,49.07182,0.5217 +2.6637,33.93591,0.52457,34.53516,0.52306,33.07051,0.52417,48.97726,0.524 +2.67371,33.80116,0.52613,34.89041,0.52503,33.25011,0.52575,49.32383,0.52604 +2.68468,34.49571,0.52875,34.38467,0.52725,33.65438,0.52804,49.26001,0.52884 +2.69573,34.08621,0.531,35.24105,0.52933,33.90426,0.53021,49.79687,0.53042 +2.70665,34.07297,0.53306,35.25073,0.53151,33.46005,0.53233,49.32558,0.53264 +2.7177,34.82249,0.53537,35.23281,0.5337,33.57046,0.53427,49.67182,0.53471 +2.72862,34.58867,0.53731,35.44896,0.5357,33.90158,0.53628,49.71424,0.53681 +2.7396,34.55184,0.53967,35.36904,0.53768,34.18673,0.53865,49.72551,0.53901 +2.74962,34.78056,0.54162,35.37288,0.53956,34.00472,0.5405,50.10323,0.54043 +2.76054,34.64755,0.54367,35.55427,0.54189,34.17795,0.54291,50.20609,0.54311 +2.77137,34.98299,0.54608,35.81128,0.54407,34.21932,0.54511,50.29503,0.54561 +2.7814,34.70717,0.54802,35.75467,0.54643,34.48319,0.54766,50.32119,0.54747 +2.79147,34.87146,0.55055,36.04168,0.54823,34.88271,0.54877,50.82344,0.54963 +2.80248,35.3021,0.55223,35.67015,0.55036,34.57381,0.5513,50.71213,0.55156 +2.81332,35.28322,0.55428,36.25118,0.5524,34.39894,0.55329,50.70948,0.55383 +2.82341,35.34696,0.55654,36.0077,0.55482,34.78031,0.5553,51.11659,0.55624 +2.83435,35.17815,0.55858,36.33598,0.55672,34.94535,0.5576,51.07831,0.55823 +2.84536,35.78223,0.56072,36.29799,0.55825,34.56492,0.55942,51.10674,0.56041 +2.85633,36.06397,0.56293,36.37927,0.56081,35.41699,0.56176,51.21737,0.56262 +2.86634,35.29361,0.56489,36.48321,0.56291,34.79214,0.56407,51.21148,0.56472 +2.87737,35.8725,0.56703,36.7022,0.5646,34.94983,0.56598,51.24841,0.56673 +2.88822,35.86995,0.56911,36.43217,0.56678,35.58072,0.56808,51.22408,0.56883 +2.89823,35.9714,0.57128,36.64173,0.56929,35.64863,0.57038,51.72857,0.57105 +2.90825,36.27396,0.57328,36.57546,0.57129,35.42334,0.57267,51.70175,0.57299 +2.91923,36.55661,0.57526,37.06234,0.57363,35.35054,0.57438,52.08045,0.5751 +2.93023,36.23542,0.5776,36.6961,0.57535,35.5049,0.57643,52.19301,0.57727 +2.94121,36.19957,0.57983,37.03956,0.57753,35.33715,0.5785,52.06351,0.57912 +2.95123,36.3868,0.5818,37.29886,0.57969,36.13216,0.58085,52.05384,0.58138 +2.96222,36.09389,0.58396,37.48738,0.58118,36.08711,0.5831,52.41301,0.58355 +2.97315,36.46201,0.58623,37.67679,0.58384,36.08026,0.58533,52.67642,0.58608 +2.98321,36.98731,0.58815,37.54098,0.58587,35.75905,0.58745,52.77223,0.58771 +2.99404,37.09312,0.59033,37.48372,0.58824,35.81855,0.58948,53.12721,0.58988 +3.00432,36.95924,0.59233,37.92858,0.59016,36.27916,0.59179,53.05563,0.59198 +3.0152,37.06847,0.59456,38.06543,0.59218,36.34653,0.59385,53.29152,0.59423 +3.02604,37.21926,0.59672,38.04555,0.59376,36.12633,0.59608,52.92499,0.59597 +3.03702,36.95836,0.59887,38.21775,0.59655,36.06477,0.59818,53.5706,0.59887 +3.04796,37.62494,0.60119,37.97695,0.59853,36.46126,0.60072,53.56286,0.60081 +3.05895,37.82155,0.60327,38.29734,0.60032,36.49756,0.60232,54.00361,0.60286 +3.0699,37.5573,0.60597,37.74643,0.60292,36.55867,0.60451,54.0615,0.60525 +3.08086,37.44967,0.60758,38.33298,0.60508,36.40551,0.60699,53.47346,0.60721 +3.09181,37.54572,0.60975,38.70472,0.60713,36.8976,0.60868,53.94235,0.60918 +3.10269,37.97076,0.61179,38.83466,0.60948,36.86289,0.61091,54.17153,0.61141 +3.11278,37.91388,0.61393,38.66138,0.61151,36.99557,0.61305,54.22875,0.61356 +3.12282,37.93275,0.61596,38.44585,0.61379,36.89945,0.61505,54.32417,0.61565 +3.13372,38.10166,0.61798,38.37332,0.61609,36.99554,0.61693,54.71767,0.61786 +3.14377,38.24336,0.61982,38.76173,0.61858,37.00877,0.61944,54.34089,0.62051 +3.15471,37.93414,0.62235,39.05946,0.61997,36.9722,0.62147,54.56812,0.62173 +3.16476,38.29101,0.62434,39.29348,0.62209,37.47295,0.62339,54.69439,0.62413 +3.17569,38.49262,0.62632,39.14849,0.62421,37.49555,0.62578,54.61794,0.62619 +3.18668,38.46396,0.62869,38.97033,0.62622,37.65089,0.628,54.69296,0.62832 +3.19674,38.61413,0.63072,39.26675,0.62829,37.56601,0.63022,54.67154,0.63057 +3.2076,38.84964,0.63282,39.23226,0.63056,37.76383,0.63219,55.05274,0.63318 +3.21762,38.46389,0.63479,39.4948,0.63208,37.35069,0.63435,55.1993,0.63496 +3.22763,38.95239,0.63677,39.63741,0.63489,37.51508,0.63659,55.20345,0.63721 +3.23863,38.89293,0.63879,39.95943,0.6371,37.86627,0.63865,55.34265,0.63896 +3.2496,38.91075,0.64118,40.12935,0.63927,37.67853,0.6407,55.97985,0.64123 +3.2596,39.21551,0.64312,39.86775,0.64124,37.99226,0.64295,56.03328,0.64323 +3.27058,38.8984,0.64501,39.99412,0.64389,38.30815,0.64486,55.69542,0.64527 +3.28153,39.15941,0.64752,40.56834,0.64552,38.28326,0.6469,56.0051,0.64756 +3.29156,39.35576,0.64948,39.96063,0.64755,38.25958,0.64916,56.18402,0.64957 +3.30245,39.345,0.65134,40.53029,0.65032,38.50336,0.6511,56.10217,0.65155 +3.31346,39.50198,0.65388,40.11521,0.65199,38.74059,0.65325,56.49049,0.65406 +3.32347,39.6066,0.65591,40.38263,0.65414,38.67578,0.6556,56.30757,0.6559 +3.33446,39.69099,0.65828,40.64485,0.65673,38.49508,0.65762,56.68562,0.65798 +3.34447,39.7997,0.65995,40.94614,0.65827,38.78509,0.65978,56.69818,0.66038 +3.35542,39.58848,0.66227,41.18626,0.6605,38.74975,0.66196,57.02987,0.66225 +3.36642,39.72035,0.66465,40.95936,0.6623,38.49045,0.66431,57.20013,0.66428 +3.3774,40.00017,0.66662,40.70817,0.66468,39.17638,0.66613,57.20103,0.6665 +3.38743,39.93456,0.66871,41.16636,0.66693,39.24657,0.66822,57.36152,0.6686 +3.39841,39.93066,0.67083,40.94369,0.66929,38.91825,0.67047,57.40063,0.67049 +3.4094,40.28653,0.67302,41.47208,0.67123,38.96967,0.6722,57.58019,0.67296 +3.42036,40.06117,0.67493,41.56733,0.67322,39.4025,0.67447,57.89418,0.6749 +3.43133,40.17856,0.67741,41.32256,0.67525,39.13149,0.67685,57.85592,0.67723 +3.44135,40.57628,0.67935,41.58964,0.67761,39.6812,0.67888,57.99244,0.67936 +3.45233,40.71035,0.68125,42.03525,0.67959,39.8715,0.68101,58.08948,0.68149 +3.4633,40.64307,0.6838,41.64585,0.68183,39.75953,0.68308,58.21703,0.68413 +3.47426,40.70767,0.6865,42.22924,0.68374,39.50729,0.68524,58.91744,0.68553 +3.4843,40.34983,0.68823,42.12073,0.6858,40.16082,0.68727,58.37397,0.68768 +3.49521,41.15087,0.69012,42.56495,0.68754,39.55097,0.68941,58.57844,0.6897 +3.50522,41.12921,0.69208,42.10154,0.68989,39.85326,0.69157,59.03476,0.69204 +3.51615,40.60637,0.69419,42.28226,0.69198,40.07569,0.69357,58.81113,0.694 +3.5262,41.16713,0.69626,42.25818,0.69469,40.15624,0.69568,59.26484,0.69629 +3.53621,41.07003,0.69839,42.34401,0.69624,40.5207,0.69791,59.03823,0.69841 +3.54648,41.51675,0.70034,42.38685,0.69823,40.71066,0.70009,59.28284,0.70035 +3.55742,41.22014,0.70207,42.76022,0.69988,40.67499,0.70234,59.91294,0.70273 +3.56824,41.60395,0.70466,42.92169,0.70256,40.67242,0.70435,59.59827,0.70437 +3.57825,41.63695,0.70659,42.85533,0.70487,40.52346,0.70702,59.41091,0.70718 +3.58922,41.63182,0.70897,43.06165,0.70699,41.16413,0.70847,59.47429,0.70904 +3.59924,41.89635,0.71078,43.0555,0.70884,40.7212,0.71075,59.86909,0.71063 +3.60925,41.85301,0.71273,43.22446,0.71138,40.51171,0.71288,60.26009,0.71288 +3.61925,42.10274,0.71481,43.12958,0.71285,41.10049,0.715,60.17329,0.71546 +3.63021,42.34927,0.71694,43.78211,0.7153,41.20757,0.71753,60.17106,0.7175 +3.64122,42.12834,0.71919,43.47851,0.71784,41.18973,0.71942,60.23959,0.71998 +3.65225,42.30103,0.72121,43.49503,0.71966,41.30361,0.7216,60.6797,0.72181 +3.66321,42.26389,0.72357,43.73037,0.7217,41.59589,0.72375,60.61394,0.72396 +3.67419,42.52673,0.72573,43.68352,0.7235,41.45931,0.72577,60.94563,0.72618 +3.6842,42.76078,0.72744,43.96653,0.72603,41.62757,0.72804,61.15433,0.72835 +3.69519,42.62437,0.72997,43.74873,0.72815,41.61684,0.73009,61.18145,0.73074 +3.7062,43.04399,0.73213,44.35845,0.73034,41.38476,0.73212,61.74876,0.73276 +3.71718,42.78814,0.73428,44.12799,0.73242,41.58185,0.73402,61.63356,0.7351 +3.7272,42.50827,0.73634,44.37956,0.73434,41.96573,0.73649,62.19828,0.73684 +3.73816,42.84772,0.73791,44.18841,0.73654,41.72782,0.7385,61.94868,0.73903 +3.74817,42.73433,0.74027,44.37464,0.73857,42.08547,0.74107,62.22308,0.74142 +3.7582,43.16943,0.74247,44.66644,0.74072,42.26355,0.74288,62.82762,0.74344 +3.76914,43.17221,0.74466,44.65087,0.74278,42.46971,0.74481,62.24109,0.74494 +3.77918,42.75841,0.74647,44.44153,0.74487,42.19909,0.74683,62.76212,0.7478 +3.79018,43.14637,0.74885,44.75153,0.74775,42.2862,0.74931,62.31389,0.74979 +3.80115,43.68913,0.75099,44.77129,0.74921,42.471,0.751,62.46432,0.75245 +3.81117,43.35864,0.75295,44.7229,0.75123,42.40465,0.75297,62.60375,0.75421 +3.82117,43.73904,0.75532,45.3735,0.75375,42.8018,0.7554,62.74544,0.75629 +3.83204,43.61552,0.75718,45.27115,0.75539,42.67518,0.75742,62.86546,0.75859 +3.843,43.88942,0.75919,45.3842,0.75759,42.4702,0.75961,62.94867,0.76053 +3.85307,43.86234,0.76143,45.45889,0.76006,42.87156,0.76171,63.24119,0.76272 +3.86308,44.26984,0.76346,45.44332,0.76193,42.91229,0.76348,63.29,0.76494 +3.8742,44.29704,0.76559,45.43157,0.76395,43.23087,0.76609,63.35013,0.76711 +3.88501,43.92286,0.76781,45.89886,0.76558,43.36101,0.76747,63.88151,0.76864 +3.89597,44.10714,0.76991,45.89044,0.76806,43.54813,0.7698,63.81867,0.7714 +3.90601,44.22338,0.77196,45.54727,0.77012,43.71543,0.77208,63.99865,0.77348 +3.91698,44.18398,0.77431,46.37076,0.77235,44.22588,0.77467,64.00732,0.77575 +3.927,44.54968,0.77589,46.26354,0.77392,43.72932,0.77637,64.58856,0.77771 +3.93796,44.40227,0.77829,45.90795,0.77654,44.07143,0.77841,65.17862,0.7797 +3.94799,44.46382,0.78032,46.27814,0.77849,44.08594,0.78028,64.63717,0.78155 +3.95896,44.38839,0.78229,46.33106,0.78058,44.48609,0.78267,64.93788,0.78385 +3.96899,44.68083,0.78452,46.6365,0.78289,44.26721,0.7848,65.42751,0.78593 +3.97996,44.76084,0.78664,46.71713,0.78476,44.68473,0.78669,65.10768,0.78808 +3.98999,44.87051,0.7884,46.62836,0.7864,44.30916,0.78918,65.24259,0.79028 +4.00098,45.07931,0.79074,46.67161,0.78903,44.62546,0.79117,65.48893,0.79225 +4.01196,44.76603,0.79301,46.96902,0.79101,44.61805,0.79273,66.02127,0.7949 +4.02201,45.21839,0.795,46.79964,0.7932,44.83003,0.79535,65.54747,0.79612 +4.03299,45.27324,0.79726,47.26661,0.79551,44.68364,0.79759,65.71765,0.79862 +4.04399,44.99513,0.79938,46.72609,0.79754,44.75868,0.79981,66.0682,0.8006 +4.05496,45.64442,0.801,46.81833,0.80043,45.13541,0.80191,65.9419,0.80279 +4.06594,45.57552,0.80376,47.19624,0.80189,45.22372,0.80442,66.21091,0.80466 +4.07597,45.11747,0.80578,47.31156,0.8041,45.23921,0.8064,66.29981,0.8071 +4.08695,45.59175,0.8076,47.41657,0.80634,45.48517,0.80881,66.15641,0.80977 +4.09792,45.50465,0.81014,47.98493,0.80826,45.59915,0.81076,66.55024,0.81134 +4.10798,45.80369,0.81225,47.67255,0.81046,45.74905,0.81246,66.83111,0.81354 +4.11894,46.17778,0.81426,47.7141,0.81299,46.21938,0.81459,66.71948,0.81606 +4.12894,45.47035,0.81667,47.84437,0.81474,45.97294,0.81677,66.73699,0.81741 +4.1399,45.92388,0.81843,48.35888,0.81681,45.79097,0.8191,67.28133,0.81969 +4.14995,46.47895,0.82048,48.05203,0.8191,45.74374,0.82102,67.23476,0.82172 +4.15997,46.51226,0.82252,47.93798,0.82103,46.37688,0.8229,67.13695,0.82365 +4.17092,46.26057,0.82459,48.11895,0.82312,46.16001,0.8252,67.25083,0.82596 +4.18192,46.18914,0.82679,48.46599,0.82531,46.58855,0.82735,67.40255,0.82827 +4.19293,46.4105,0.82967,48.38023,0.82739,46.37905,0.82948,67.52233,0.83003 +4.20393,46.52823,0.83129,48.47833,0.82955,46.44738,0.83147,67.67083,0.83241 +4.21493,46.26015,0.83344,48.42019,0.83152,46.42271,0.83376,67.71035,0.83438 +4.22591,46.30345,0.83551,48.54753,0.83378,46.6953,0.83576,67.76346,0.83648 +4.23596,46.67723,0.8376,49.09314,0.8359,46.81179,0.83792,68.19193,0.83858 +4.24696,47.10978,0.83985,48.93091,0.83785,46.9247,0.84014,67.80226,0.8406 +4.25698,46.74561,0.84233,48.87625,0.84023,47.28341,0.8421,68.17872,0.84259 +4.26796,46.97648,0.844,49.42911,0.84227,46.91756,0.8443,68.19678,0.84407 +4.27897,46.80645,0.84617,49.17435,0.84428,47.27044,0.84633,68.37796,0.8469 +4.28996,47.15219,0.84848,49.19184,0.8464,47.23962,0.84856,68.30995,0.84912 +4.30096,47.12349,0.85047,48.83266,0.84859,47.23447,0.85008,68.76235,0.85091 +4.31196,47.16428,0.85255,49.67402,0.85043,47.30011,0.85265,68.41509,0.85331 +4.32197,47.21326,0.85475,49.49499,0.85283,47.448,0.85481,68.47816,0.85549 +4.33295,47.30053,0.85691,49.29547,0.85474,47.22887,0.85635,68.82634,0.85805 +4.34301,47.45819,0.85944,49.88594,0.85686,47.51693,0.85907,69.19913,0.85985 +4.35394,47.66171,0.86108,49.82943,0.85906,47.29317,0.8611,69.23185,0.86189 +4.36397,47.45877,0.86308,50.27404,0.86096,47.30292,0.86318,69.36127,0.86404 +4.37494,47.24128,0.86535,49.6686,0.86295,48.22577,0.8654,68.98065,0.86601 +4.38592,47.65081,0.86742,49.90775,0.86514,47.98592,0.86737,69.37741,0.8682 +4.39597,47.68226,0.86955,50.18426,0.86727,48.15743,0.86958,69.49582,0.87026 +4.40597,47.64048,0.87149,50.24433,0.8695,48.57691,0.87181,69.54505,0.87217 +4.41696,48.04779,0.87363,49.58291,0.87155,48.43902,0.87373,70.22542,0.8744 +4.42796,48.23273,0.87586,49.98853,0.87378,48.20071,0.87592,69.96092,0.87656 +4.43893,47.84249,0.87863,50.27164,0.87576,48.28547,0.87807,69.81109,0.87882 +4.44897,48.35546,0.87987,50.14517,0.87788,48.75868,0.88029,70.29038,0.8807 +4.45897,48.46765,0.88207,50.2778,0.88031,48.52918,0.88234,69.87247,0.88299 +4.46996,48.59449,0.88428,50.41855,0.88176,48.62439,0.88421,70.44603,0.88544 +4.47996,48.25986,0.88625,50.23659,0.88384,48.81273,0.88646,70.1868,0.88688 +4.49092,48.49574,0.88842,50.83389,0.88598,48.66052,0.88866,70.5202,0.88893 +4.50093,48.53623,0.89038,50.65443,0.88822,48.68927,0.89138,70.57688,0.89092 +4.51193,48.62635,0.89311,50.93095,0.89045,49.09751,0.89288,70.45578,0.89307 +4.52199,48.54747,0.89454,51.29563,0.89239,49.1324,0.89502,70.74936,0.89531 +4.53203,48.59332,0.8966,51.28875,0.89452,49.05045,0.89773,71.30309,0.89729 +4.543,48.86308,0.89884,51.08784,0.89678,49.06666,0.89937,71.12242,0.89893 +4.55398,49.12879,0.90096,51.43944,0.8987,49.59005,0.90144,70.96127,0.90148 +4.564,48.97798,0.90295,51.5437,0.90108,49.28731,0.90354,70.80293,0.90362 +4.57402,49.20698,0.90493,51.55379,0.90319,49.52074,0.90579,71.2327,0.90574 +4.58405,48.90194,0.90736,51.41041,0.9059,49.61294,0.90781,71.45866,0.9078 +4.59497,49.01274,0.90913,51.33203,0.90751,49.45241,0.9098,71.37411,0.91006 +4.60595,49.15656,0.91133,51.828,0.90962,49.78479,0.91183,71.68605,0.91254 +4.61596,49.76877,0.91327,51.38214,0.91153,50.0055,0.91419,71.45952,0.91435 +4.62694,49.40995,0.9155,51.76729,0.91415,50.1673,0.91698,71.62106,0.91627 +4.637,49.4304,0.91748,51.74221,0.91566,49.94776,0.91861,71.63694,0.91822 +4.647,49.81584,0.91949,52.1277,0.91773,49.6749,0.92057,71.82664,0.92024 +4.65797,49.92192,0.92183,52.04542,0.91961,50.52985,0.92259,71.92151,0.92271 +4.66898,49.51657,0.92387,52.01384,0.92209,50.47929,0.92505,71.81269,0.92439 +4.67996,49.76878,0.92649,52.64405,0.92402,49.94098,0.92675,71.88869,0.92657 +4.69096,49.69016,0.92826,52.31867,0.92602,50.60625,0.92871,72.01981,0.92843 +4.70097,50.40473,0.93025,52.49866,0.92836,50.82965,0.93073,72.68811,0.9307 +4.71195,49.99095,0.93196,52.45051,0.93096,50.61464,0.93268,72.78741,0.93291 +4.72198,50.49769,0.93439,52.74457,0.93283,50.3748,0.9349,72.2067,0.93498 +4.73297,50.41843,0.93656,52.7459,0.93477,50.60652,0.93701,72.37179,0.93713 +4.74396,50.22139,0.93901,53.04322,0.93658,50.71459,0.93927,72.66766,0.93908 +4.75492,50.44433,0.94093,53.17448,0.93912,50.76997,0.94127,72.97379,0.94113 +4.76493,50.50906,0.94307,53.32293,0.94188,50.90975,0.94279,73.4644,0.94346 +4.77493,50.42177,0.94495,53.21822,0.94355,51.3332,0.94556,73.40899,0.94531 +4.78494,51.14043,0.94687,53.51003,0.94565,51.25131,0.94746,73.11473,0.94776 +4.7959,51.22394,0.94926,53.51647,0.94777,51.04376,0.94962,73.26776,0.94997 +4.8059,50.86928,0.95114,53.15056,0.94982,51.36523,0.9511,73.36067,0.95156 +4.81592,50.91358,0.95319,53.80885,0.95204,51.19402,0.95363,73.54939,0.95431 +4.82592,51.17622,0.95515,53.70968,0.95442,51.13829,0.95576,73.55938,0.95623 +4.83695,50.98885,0.95746,53.59466,0.95643,51.79297,0.95626,73.61983,0.95879 +4.84791,51.18484,0.95956,54.11071,0.95852,51.5068,0.95618,73.93728,0.96059 +4.85797,50.94288,0.9615,54.01965,0.96078,51.74959,0.95664,74.22207,0.96272 +4.86895,51.31192,0.96346,54.06932,0.96337,51.05685,0.95617,74.24054,0.96518 +4.87896,51.07007,0.96573,53.97728,0.96519,51.27275,0.95617,74.25925,0.96691 +4.88897,51.3575,0.96769,54.26356,0.96693,51.80592,0.95614,74.39231,0.96896 +4.89995,51.506,0.96988,54.58135,0.96948,51.65021,0.95622,74.37259,0.97093 +4.90997,52.07082,0.97138,54.20982,0.97168,52.05161,0.95617,74.16903,0.97298 +4.92099,51.77699,0.97407,54.88381,0.97354,51.83019,0.95619,74.49943,0.97508 +4.93193,51.67537,0.97622,54.4255,0.97609,51.51522,0.95598,74.67708,0.97736 +4.94194,52.01592,0.97868,54.41765,0.97862,51.38865,0.95612,74.69126,0.97945 +4.95291,52.51062,0.98032,54.71571,0.98016,51.50971,0.95617,74.62517,0.98164 +4.96392,52.58779,0.98258,54.87597,0.98228,51.74894,0.95639,75.04822,0.98367 +4.97398,51.95609,0.98464,54.71016,0.98446,51.66187,0.95614,75.08579,0.98624 +4.98492,52.54403,0.98682,55.16023,0.98672,51.73762,0.95613,75.16211,0.98783 +4.9959,52.41517,0.98897,55.21217,0.98875,51.5217,0.95622,75.46112,0.99 +5.00593,52.19687,0.99099,54.88484,0.99096,51.51231,0.95618,75.38857,0.99252 +5.0169,52.56743,0.99327,55.0256,0.99327,52.31997,0.9561,75.57825,0.99424 +5.02693,52.8715,0.9952,55.83837,0.9952,51.73536,0.95639,75.77402,0.99632 +5.03792,52.52022,0.9974,55.67353,0.99725,51.87357,0.95619,75.7711,0.99632 +5.04793,52.69452,0.99937,55.94194,0.99951,51.69456,0.95617,75.5659,0.99651 +5.06093,52.53628,0.9999,55.42026,1.00029,51.99691,0.95617,76.05756,0.9963 +5.07097,53.02793,0.9999,56.07481,1.00027,52.0445,0.95619,75.34613,0.99635 +5.08203,52.86738,0.99989,56.37219,1.00063,51.96389,0.95552,75.85687,0.99631 +5.093,53.25658,0.99991,56.36666,1.00023,51.65928,0.95642,76.16889,0.9964 +5.10399,53.1272,1.0005,55.91232,1.00025,51.72273,0.95609,76.14365,0.99633 +5.11495,53.26284,0.99993,56.07351,1.00016,51.91533,0.95615,76.21939,0.99634 +5.12593,52.90413,0.99989,56.38811,1.0002,52.10924,0.95677,76.02648,0.99631 +5.13597,52.93933,0.99997,56.24479,1.00013,51.7114,0.95615,76.00739,0.99634 +5.147,53.11267,1,56.40729,1.00027,51.81498,0.95608,76.33396,0.99637 +5.15705,53.45762,0.99991,56.46936,1.00018,51.92926,0.95673,76.12488,0.99634 +5.16792,52.96009,0.99993,56.30459,1,51.96065,0.95622,76.06888,0.9965 +5.17799,53.34358,1.0003,56.47358,1.00022,51.69164,0.95613,76.36116,0.99633 +5.18892,53.26382,0.99991,56.00754,1.00022,51.95904,0.9562,76.04751,0.99631 +5.19895,52.80989,0.99982,56.14761,1.00023,52.45626,0.9563,76.01742,0.99575 +5.20999,53.5726,1.00041,56.33936,1.00021,52.33357,0.95613,76.66929,0.9963 +5.22091,53.58419,0.99988,56.38584,1.00024,52.13288,0.95615,76.177,0.99626 +5.23094,53.65302,0.9999,56.49081,1.00064,52.39507,0.95574,76.45891,0.99631 +5.24193,53.27797,0.99991,56.13981,1.0002,52.13481,0.95605,76.31261,0.99636 +5.25292,53.41932,0.9999,56.88276,1.00025,52.06328,0.95618,76.17473,0.99626 +5.26295,53.32853,0.99994,56.54281,1.00037,52.23452,0.95617,76.1935,0.99629 +5.2739,53.38259,0.99986,56.62211,1.00016,52.24649,0.95628,76.09898,0.99626 +5.28391,53.08101,0.99974,56.60261,1.00017,51.9584,0.9561,76.41553,0.99623 +5.29492,53.10829,0.99992,56.64422,1.00027,51.93864,0.95676,76.50033,0.99593 +5.30496,53.36181,0.99989,56.67118,1.00019,52.0296,0.95615,76.56507,0.99632 +5.31496,53.38698,1.00006,56.50023,1.00022,52.52586,0.95608,76.757,0.99621 +5.32591,53.46553,0.99979,56.56393,1.0002,52.25394,0.95633,76.77417,0.99632 +5.33594,53.84146,0.99994,56.75991,1.00018,52.27401,0.9556,76.86835,0.99616 +5.34692,53.08008,0.99979,56.55581,1.0006,52.41612,0.9561,77.37812,0.99621 +5.35693,53.66434,0.99991,56.14208,1.00017,52.18726,0.95562,77.26647,0.99611 +5.3679,53.61092,0.99988,56.59221,0.99974,52.17268,0.95642,77.63059,0.99624 +5.37791,53.58799,0.99988,56.80411,1.00019,52.26463,0.95614,77.3202,0.99628 +5.38889,53.15072,1.00008,56.78428,1.00015,52.43457,0.95607,77.38557,0.99646 +5.3989,53.31093,0.99985,57.11123,0.99966,52.745,0.95611,77.34545,0.99622 +5.4099,53.46674,0.99957,56.56946,1.00017,52.47827,0.9561,77.54611,0.99611 +5.42091,53.451,0.99986,56.97896,0.99952,52.45237,0.95613,77.25838,0.99627 +5.43184,53.44887,0.99986,56.80249,1.00044,52.29407,0.95559,77.53835,0.99612 +5.44186,53.3637,0.99993,56.99196,1.00021,52.60711,0.95605,77.40792,0.9962 +5.45288,53.53487,0.99988,56.58668,1.00063,52.27919,0.95685,77.52022,0.99621 +5.46386,53.83613,0.99991,56.73196,1.00033,52.13384,0.95614,77.84455,0.9967 +5.47488,53.59111,0.99963,56.70271,1.0002,52.04579,0.95607,77.44546,0.99613 +5.48584,53.58424,0.99986,56.72676,1.00013,52.31739,0.95602,77.90572,0.99622 +5.49686,53.61187,0.99948,56.57076,1.00051,52.39735,0.95608,77.89892,0.99581 +5.50781,53.3832,0.99984,56.64551,1.00016,52.54885,0.9562,77.86624,0.99617 +5.51784,53.39607,0.99993,56.79111,1.0002,52.16686,0.95606,77.83807,0.99602 +5.52884,53.28959,0.99947,56.86326,1.00048,52.35786,0.95623,77.762,0.99574 +5.53981,53.4485,0.99984,56.64551,1.00023,52.31091,0.95618,77.92319,0.99608 +5.54984,53.4759,0.99986,56.83369,1.00022,52.21574,0.95608,77.55226,0.99552 +5.56087,53.58703,0.99994,57.15414,1.00029,52.465,0.95617,77.7413,0.99623 +5.57186,53.57727,0.99988,56.73066,1.00017,52.4705,0.95616,77.58626,0.99626 +5.58281,53.64986,0.99992,56.52461,1.00017,52.68449,0.95607,77.74259,0.99601 +5.59288,53.58139,0.99959,56.48009,1.00047,52.61455,0.9554,77.46907,0.99612 +5.60378,53.39797,0.99993,57.05111,1.00027,52.49672,0.95614,77.52928,0.99614 +5.61379,53.35458,0.99988,56.91104,1.00016,52.48992,0.9561,77.79729,0.99667 +5.62382,53.68757,0.99986,56.70823,1.00018,52.38117,0.95609,77.51084,0.99613 +5.63478,53.7086,0.99986,56.37869,1.00048,52.68124,0.95599,78.10283,0.99613 +5.64479,53.72749,0.99982,56.34228,1.00022,52.33584,0.95605,78.21288,0.99618 +5.65582,53.74031,1.00005,56.89706,1.00039,52.47666,0.9559,77.80473,0.99659 +5.66677,53.65175,0.99986,56.81743,1.00022,52.56761,0.95612,78.2391,0.99617 +5.67779,53.58203,0.99984,56.52201,1.00024,52.76832,0.95613,77.829,0.9961 +5.68883,53.44631,1.00008,57.05436,1.00017,52.39927,0.95597,77.79147,0.99615 +5.69977,53.60151,0.99992,56.74041,1.00022,52.67152,0.95607,78.09022,0.9961 +5.70979,53.50447,0.99991,56.70498,1.00061,52.33324,0.95606,78.06626,0.99614 +5.72072,53.35431,0.99974,56.53208,1.0002,52.64239,0.95597,77.77528,0.99668 +5.7308,53.82763,0.99988,56.78299,1.00011,52.27271,0.95602,78.17955,0.9958 +5.74175,53.47366,0.99992,56.79403,0.9999,52.64984,0.95606,77.78402,0.99611 +5.75178,53.49848,1.00005,56.69394,1.00015,52.54787,0.95581,77.73741,0.9961 +5.76278,53.17583,0.99984,56.82653,1.00025,52.38504,0.95608,78.11773,0.99625 +5.77279,53.19942,0.99985,56.99814,1.00044,52.57506,0.9561,78.3061,0.99623 +5.78282,53.49502,0.99988,57.12457,1.00016,52.4472,0.95608,77.85362,0.99616 +5.79374,53.49973,0.99962,57.02153,1.00015,52.60742,0.95609,77.8688,0.99613 +5.80377,53.66088,0.99981,56.59806,1.00002,52.76409,0.95601,77.92837,0.99617 +5.81472,53.91281,0.9998,56.62991,1.00021,52.78029,0.95604,78.06594,0.99615 +5.82474,53.50471,0.99984,56.70726,1.00005,52.64368,0.9562,78.08892,0.99579 +5.83571,53.67975,0.99978,56.53404,1.00019,52.81525,0.95601,78.16725,0.99608 +5.84572,53.66995,0.99988,56.83108,1.0002,52.50869,0.95611,77.90896,0.99617 +5.85674,53.72653,0.9999,57.04916,1.00031,52.38439,0.95589,77.96819,0.99609 +5.8676,53.67561,0.99976,56.88601,1.0002,52.58121,0.95612,78.20025,0.99614 +5.87859,53.84524,0.99988,56.40534,1.00013,52.39928,0.95615,78.05622,0.99612 +5.88953,53.17362,1.00012,57.00723,0.99981,52.50157,0.95602,78.45047,0.99608 +5.89955,53.34801,0.99983,56.80281,1.0002,52.89586,0.95601,77.8727,0.99611 +5.91052,53.39606,0.99984,56.86748,1.00019,53.09494,0.95547,78.32876,0.99565 +5.92147,53.84902,0.99998,56.70661,1.00028,53.01659,0.95602,78.06853,0.99617 +5.93246,53.50316,0.99988,56.97311,1.00008,52.7081,0.95607,78.0627,0.99579 +5.94341,54.01708,1.00007,56.56101,1.00017,52.70033,0.95579,78.43557,0.99608 +5.95345,53.79655,0.99961,56.53956,1.00015,52.78773,0.956,78.26047,0.9961 +5.96435,53.24873,0.99986,56.81321,1.00025,52.76797,0.95603,78.08049,0.99612 +5.97533,53.32884,0.99988,56.75731,1.00012,52.88939,0.95602,77.80603,0.99584 +5.98538,53.8032,0.99964,56.83856,1.00015,52.4637,0.95601,77.92675,0.99609 +5.99626,53.91185,0.99994,57.09466,1.00038,52.65858,0.9561,78.4346,0.9961 +6.0063,53.4027,0.99987,57.03031,0.99983,52.31479,0.95611,78.43267,0.99614 +6.01631,53.7928,1.00042,56.71603,1.00023,52.50415,0.95605,77.87238,0.99614 +6.02725,53.83241,0.99982,56.73163,1.00018,52.70066,0.95618,77.86008,0.99613 +6.03828,53.93446,0.99986,56.84344,1.00016,53.00527,0.95607,78.23198,0.99613 +6.0492,53.81197,0.99978,56.76154,1.00013,53.28237,0.95609,78.26694,0.99593 +6.05923,53.57322,0.99993,57.003,1.00014,52.82496,0.95608,78.36694,0.99613 +6.07022,53.83205,0.99991,56.98026,1.0005,52.62134,0.95605,78.26144,0.99587 +6.08121,53.72556,1.00014,56.74724,1.00018,53.14155,0.95597,78.30934,0.99606 +6.09121,53.63289,0.99987,56.69133,1.00016,53.0412,0.95652,78.49026,0.99603 +6.10221,53.83299,0.99988,56.80411,1.00046,52.99168,0.95589,78.00832,0.99577 +6.11323,53.34452,0.99984,56.63251,1.00047,52.84631,0.95616,77.60081,0.99605 +6.12419,53.78684,0.99988,56.94581,1.00021,53.04475,0.95609,78.46469,0.99611 +6.13422,53.49532,0.99983,57.04916,0.99971,52.8405,0.95602,78.07694,0.99578 +6.14503,53.53551,0.99929,56.97278,1.00021,52.51872,0.95611,78.14199,0.99642 +6.15595,53.76139,0.99985,56.74854,1.00031,52.73658,0.95617,78.5045,0.99608 +6.16595,53.77301,0.99991,56.86619,1.00011,52.79064,0.956,78.26046,0.99583 +6.17688,53.75541,0.99982,56.98416,1.00013,52.6686,0.95546,78.4003,0.99613 +6.18707,53.63856,0.99988,56.78948,0.9999,53.11047,0.9561,78.28215,0.99606 +6.19791,53.58424,0.9999,57.17753,1.00017,52.82592,0.95597,78.16176,0.99645 +6.20888,53.63197,0.99983,56.94678,1.00019,52.9253,0.95617,78.46761,0.99606 +6.21987,53.67094,0.99991,56.99099,0.99999,52.71651,0.95607,78.16273,0.99618 +6.23085,53.92407,0.99993,57.01373,1.00024,52.85797,0.95624,78.29348,0.99603 +6.2418,53.59112,0.99983,56.80768,1.00023,53.05867,0.95593,78.2789,0.99609 +6.25275,53.35402,0.99985,57.27146,0.99957,52.77284,0.95604,78.26887,0.9955 +6.26275,53.60936,0.9997,56.78363,1.00019,52.78223,0.95608,78.35011,0.9961 +6.27375,53.81071,0.99982,57.17104,1.00017,52.80683,0.95585,78.13909,0.99608 +6.28468,53.57826,0.99988,56.96888,1.00024,52.93502,0.95598,78.57313,0.99603 +6.29568,53.86096,1.00011,57.07029,1.00004,52.43781,0.95603,78.34915,0.99613 +6.30663,53.26479,0.99986,57.15316,1.00016,52.65631,0.95607,78.09506,0.9961 +6.31749,53.84904,0.99946,56.84571,1.0004,53.16583,0.95597,78.42068,0.99585 +6.32757,53.84806,0.9998,57.22401,1.00019,53.04604,0.956,78.1886,0.99619 +6.33856,53.97594,0.9998,57.35011,1.00016,53.15546,0.95648,78.13164,0.99607 +6.3495,53.67811,1.00001,57.14699,1.00012,53.60413,0.95577,78.71295,0.99609 +6.3605,53.45352,0.99982,57.42844,1.00012,52.75827,0.95602,78.23132,0.99611 +6.37138,53.47022,1.00004,56.92924,1.00015,53.18719,0.95563,78.07727,0.99608 +6.38238,53.82738,0.99984,56.77519,1.0001,52.91139,0.95625,78.06755,0.99634 +6.39241,53.28548,0.99991,57.1213,1.00058,53.05609,0.95604,78.05525,0.99608 +6.40342,53.63698,0.99985,57.10734,1.00015,53.362,0.95535,78.51422,0.99611 +6.41438,53.43847,0.99996,57.21653,1.00016,53.14964,0.95599,78.46826,0.99597 +6.42532,53.71522,1.00009,56.86066,1.00002,53.48435,0.95602,78.22065,0.99613 +6.43533,54.02089,0.99983,57.23993,1.00025,53.45717,0.95602,78.51422,0.99609 +6.44536,53.6618,0.99983,56.80476,1.00018,53.16227,0.95605,78.60194,0.99604 +6.45631,53.36811,0.99984,56.87138,1.00023,53.22053,0.95607,78.18019,0.99643 +6.4673,53.72148,0.99986,56.85253,1.0002,52.60775,0.95554,78.57022,0.9961 +6.47826,53.93823,0.99992,57.05729,1.00013,53.20661,0.95612,78.61941,0.99543 +6.48828,53.80441,0.99984,56.64453,1.00012,53.14802,0.95604,78.40903,0.99609 +6.4992,53.44193,0.99978,56.69393,1.00006,53.16905,0.95601,78.6233,0.99608 +6.50923,53.62538,0.99989,57.33678,1.0001,52.99135,0.95609,78.42035,0.99604 +6.52025,53.70672,0.99967,57.08654,1.00034,53.02791,0.95601,78.38929,0.99613 +6.53121,53.69354,0.99986,56.81776,1.00012,53.17651,0.95621,78.41873,0.99604 +6.54122,53.68661,0.99986,57.02868,1.00008,53.03116,0.95612,78.73595,0.99609 +6.55219,53.6417,0.99986,56.76121,1.00008,53.04962,0.95552,78.18893,0.99568 +6.56221,53.6279,0.9997,56.60716,1.00015,53.11371,0.956,78.12225,0.99623 +6.573,53.56442,0.99992,57.31793,1.00011,53.04315,0.95601,78.67962,0.9961 +6.58398,53.61028,0.99979,56.85773,1.00015,52.86089,0.95667,78.58058,0.99613 +6.5949,53.7526,0.99983,57.25066,1.00015,53.16032,0.95562,78.51972,0.99644 +6.60494,53.38158,0.99987,57.18859,1.00011,53.13021,0.95597,78.488,0.99615 +6.61593,53.5795,0.99968,57.10083,1.00048,53.2173,0.95598,78.64466,0.99603 +6.62681,53.54493,0.99988,56.38844,1.00026,53.44745,0.95602,78.38702,0.99663 +6.63688,53.43501,0.99985,56.88016,1.00006,53.30697,0.95604,78.33491,0.99606 +6.64782,53.47302,1.00034,57.30396,1.00015,53.09947,0.95612,78.22163,0.99612 +6.65882,53.27326,0.99993,57.28738,1.00018,53.059,0.95618,78.50257,0.99569 +6.6698,53.5104,1.00047,56.59383,1.00017,53.13184,0.95589,79.22566,0.99602 +6.68073,53.65551,0.99984,56.98156,1.00018,52.8719,0.95607,78.37051,0.99608 +6.69173,53.1947,0.99991,56.89804,1.0001,52.70453,0.95596,78.53687,0.99601 +6.70271,53.61376,0.99989,57.20678,1.00032,52.90946,0.95606,78.27826,0.99616 +6.7137,53.65708,0.99978,57.37643,1.00022,53.13604,0.95603,78.0695,0.99609 +6.72371,53.52169,1.00033,57.11676,1.00019,53.44842,0.956,78.55533,0.99573 +6.73458,53.51984,0.99983,56.68971,1.00023,53.39955,0.95595,78.25237,0.9961 +6.74462,53.64545,0.99988,57.00723,1.0002,52.77834,0.9561,78.28895,0.99615 +6.75463,53.32066,0.99992,56.76803,1.00014,52.86283,0.95633,78.23587,0.99605 +6.76557,53.48277,0.99973,56.96466,1.00037,52.87449,0.95601,78.60064,0.99593 +6.77557,53.64453,0.9999,57.44631,1.0002,53.38303,0.95602,78.3621,0.99605 +6.7865,53.28016,0.99986,57.48791,1.00012,53.40667,0.95579,78.8052,0.99603 +6.79744,53.55122,0.99995,57.29746,1.0003,53.00009,0.95569,78.48963,0.99546 +6.80746,53.64954,0.99992,57.28413,1.00017,53.2474,0.95604,78.37408,0.99623 +6.81844,53.83995,0.99988,57.25065,1.00064,53.06839,0.95595,78.85149,0.99619 +6.82946,53.82701,0.99989,56.82166,1.00016,53.23108,0.95421,78.76767,0.99603 +6.84042,53.52328,0.99983,57.03583,1.0002,53.07286,0.95178,78.3142,0.99617 +6.85143,53.3106,1.00016,56.91623,1.0002,52.96245,0.9501,78.42651,0.99586 +6.86227,53.38974,0.99986,57.3137,1.00018,52.64267,0.94783,78.40515,0.99598 +6.87227,53.64079,0.99985,57.31956,1.00014,52.98675,0.94631,78.924,0.99547 +6.88231,53.37253,0.99939,56.86261,1.00023,53.1467,0.94364,78.77963,0.99608 +6.89332,53.51887,0.99983,56.77778,1.00015,53.36486,0.94172,78.71005,0.99627 +6.90427,53.59398,0.99992,57.16941,1.00007,53.1626,0.93945,78.59838,0.99607 +6.91525,53.60683,0.99973,57.44046,0.9996,53.03438,0.9375,78.8612,0.99608 +6.92529,53.26002,0.99985,57.35141,0.99968,52.67577,0.93473,78.47733,0.99605 +6.93621,53.62189,0.99985,56.83986,1.00016,52.73507,0.93312,78.79679,0.99593 +6.94723,53.8437,0.9995,56.88894,1.00008,52.52592,0.93103,78.62362,0.99599 +6.95724,53.72563,0.99955,57.03096,1.00044,52.79692,0.92844,78.76443,0.99613 +6.96819,53.50662,0.99986,56.91721,1.00008,52.58852,0.92669,79.00134,0.9961 +6.97821,53.51701,0.99986,57.12716,1.00017,52.16451,0.92454,78.60744,0.99605 +6.98921,53.22265,0.99991,56.83011,1.0001,53.0699,0.92216,78.82981,0.99613 +6.99925,53.4231,0.99986,57.01504,1.00037,52.66792,0.92044,78.71135,0.99617 +7.0102,53.69602,0.99988,57.02088,1.00014,52.7213,0.91834,78.26823,0.99609 +7.02021,53.59835,1.00036,57.21426,1.00014,52.44167,0.91642,78.63464,0.99617 +7.03121,53.74693,0.99985,56.78916,1.00008,52.80655,0.914,78.77864,0.99403 +7.04217,53.80758,0.9998,56.83661,0.99955,52.16396,0.91195,78.34165,0.99189 +7.06195,53.75407,0.99807,57.03773,0.99816,52.87488,0.90992,78.78707,0.98985 +7.07201,53.91145,0.99606,57.28513,0.99595,52.30997,0.90771,78.18639,0.98809 +7.08293,53.71677,0.99396,57.357,0.99377,52.45182,0.9056,78.66893,0.98364 +7.09386,53.39704,0.99168,56.89319,0.99179,52.46992,0.90393,78.46378,0.98164 +7.10387,53.43447,0.98968,56.78838,0.98807,52.63184,0.90142,78.46869,0.97927 +7.11584,53.45494,0.98697,56.65965,0.98596,51.81735,0.89946,78.55065,0.97712 +7.12588,53.49018,0.98553,56.91223,0.98372,52.16993,0.89729,78.13317,0.97495 +7.13682,53.42081,0.98329,56.96647,0.98222,52.39238,0.89506,78.47375,0.97277 +7.14784,53.35497,0.98068,56.81898,0.9796,52.45352,0.89308,78.13776,0.97073 +7.15878,53.23438,0.97892,56.90678,0.97737,52.43481,0.8905,78.04653,0.96878 +7.16879,53.24005,0.97692,56.63579,0.97536,52.19879,0.88889,78.03388,0.96653 +7.17972,53.52128,0.97495,56.95239,0.97307,52.03755,0.88684,78.45698,0.96435 +7.19066,53.22233,0.97257,56.65476,0.97116,52.00331,0.8846,78.16768,0.96236 +7.20162,53.63957,0.97024,56.58322,0.96885,52.38956,0.88251,77.99813,0.95997 +7.21167,53.32699,0.968,56.64762,0.96667,51.73109,0.88046,77.50289,0.95795 +7.22265,53.09399,0.96612,57.06854,0.96415,52.19729,0.87777,77.95932,0.95554 +7.23366,53.51252,0.96365,56.29274,0.9627,51.90042,0.87628,77.64218,0.95359 +7.24462,53.10294,0.96172,56.56092,0.96032,52.18471,0.87417,77.82446,0.95103 +7.25558,53.27177,0.95962,56.71633,0.95797,51.53312,0.87193,77.74524,0.94922 +7.26653,53.10096,0.95759,56.80437,0.95608,51.56587,0.8697,77.97274,0.94725 +7.27753,53.00806,0.95515,56.39557,0.95398,51.95567,0.86755,77.732,0.94437 +7.28849,53.14731,0.95281,56.48371,0.9516,51.96634,0.86549,77.93273,0.94281 +7.29937,53.03492,0.95087,56.80388,0.94949,51.87996,0.86338,77.51557,0.94072 +7.3094,52.6354,0.94889,56.35804,0.9473,51.76998,0.86118,77.79713,0.93873 +7.3204,52.98382,0.94689,56.47087,0.94511,51.54471,0.85881,77.40265,0.93645 +7.33138,52.74833,0.94448,56.84361,0.94313,51.69433,0.85681,77.54835,0.93427 +7.34139,52.68546,0.94252,55.90052,0.94092,51.36346,0.85487,77.74552,0.9321 +7.35236,52.92178,0.94025,56.6029,0.93875,51.47293,0.85277,77.3083,0.92997 +7.36237,52.48359,0.93824,56.69549,0.9368,51.55101,0.85037,77.38984,0.92795 +7.37338,52.71833,0.93615,56.08618,0.93461,51.52184,0.84846,77.09438,0.92568 +7.38431,52.20702,0.93392,56.57958,0.93241,51.87669,0.8464,77.68117,0.92378 +7.39526,52.53789,0.93166,56.28227,0.93012,51.20624,0.84421,77.06755,0.9215 +7.40623,52.62156,0.92968,56.13835,0.9277,51.67212,0.84208,77.07982,0.91965 +7.41628,52.51566,0.92749,56.06593,0.92573,51.70285,0.83985,77.43881,0.91737 +7.42721,52.4435,0.92529,55.96327,0.92358,51.0665,0.83785,77.26378,0.91519 +7.43823,52.83718,0.92316,56.00159,0.9216,51.43785,0.83576,76.87316,0.91291 +7.44825,52.35728,0.9211,55.95029,0.91943,50.95558,0.8336,76.86287,0.91086 +7.45923,52.52312,0.9189,56.19661,0.91748,51.47843,0.83134,76.79433,0.90845 +7.46923,52.4308,0.91647,56.18594,0.91525,51.13244,0.82899,77.18958,0.90642 +7.48015,52.22358,0.91471,56.06314,0.91312,50.93334,0.82712,76.6271,0.90437 +7.49104,52.42752,0.91247,55.71601,0.91172,50.93298,0.82514,77.15148,0.90205 +7.50188,52.04185,0.91045,56.01474,0.90886,50.98128,0.82337,76.53164,0.90004 +7.51195,51.84929,0.90838,55.75609,0.90667,50.71492,0.82063,76.71771,0.89815 +7.52196,52.41975,0.90642,55.82918,0.90437,50.68002,0.81856,76.7906,0.8958 +7.5329,52.01927,0.90419,55.34824,0.90256,50.90789,0.81652,76.7654,0.89369 +7.5429,52.16511,0.90223,55.58457,0.90033,50.86555,0.8146,76.21515,0.89219 +7.55292,52.11422,0.90029,55.91906,0.89817,50.79341,0.81219,76.60167,0.88951 +7.56387,51.86357,0.89755,55.49108,0.89594,50.84162,0.81013,76.58976,0.88729 +7.57483,52.25477,0.89585,55.63934,0.89393,50.75977,0.80804,76.49465,0.88494 +7.58578,51.64985,0.89365,55.68847,0.89155,50.68505,0.80576,76.18463,0.88295 +7.59584,51.5418,0.89145,55.63457,0.88919,51.01046,0.80316,76.3009,0.88066 +7.60662,52.0486,0.88947,55.22254,0.88719,51.01398,0.80192,76.61873,0.87878 +7.61765,51.86206,0.88733,55.76827,0.88493,50.81982,0.79941,75.95201,0.8766 +7.6277,51.99869,0.88538,55.70778,0.8829,50.59383,0.79744,76.10387,0.87414 +7.63865,51.61902,0.88318,55.38837,0.88079,50.65605,0.79518,75.84726,0.87223 +7.64875,51.6894,0.88119,55.34715,0.87911,50.40523,0.79307,76.4762,0.87051 +7.65983,51.72435,0.87894,54.94095,0.87654,50.54018,0.79102,75.85441,0.86816 +7.67059,51.46177,0.87677,55.18183,0.8745,50.7348,0.78867,75.86741,0.86587 +7.6806,51.83846,0.87421,55.23347,0.87261,50.56134,0.7866,76.01175,0.86384 +7.69158,51.45592,0.87256,55.11003,0.87008,49.9771,0.78493,75.48841,0.86161 +7.70258,51.69001,0.87035,55.05353,0.86842,50.52285,0.78249,76.03193,0.85943 +7.71354,51.64647,0.86807,55.04677,0.86567,50.02948,0.78048,75.83188,0.85738 +7.72449,51.79954,0.86601,54.69842,0.86341,50.31238,0.77843,75.67494,0.85526 +7.7345,51.26302,0.86404,55.16996,0.86136,50.44871,0.77603,75.46228,0.85325 +7.74548,51.31118,0.86179,54.66757,0.85928,50.06672,0.77434,75.34354,0.85114 +7.75551,51.51912,0.85977,54.98938,0.85765,50.21397,0.77223,75.64646,0.84887 +7.76645,51.62194,0.85756,54.88826,0.85515,50.01104,0.77046,75.23547,0.84685 +7.77648,51.63917,0.85612,55.21494,0.85291,50.11728,0.76786,76.04504,0.84466 +7.78739,51.48252,0.85348,54.78754,0.85094,50.28297,0.76589,75.65831,0.84243 +7.79742,51.31162,0.85136,54.77353,0.84943,49.83397,0.76344,75.43793,0.84032 +7.8083,51.05665,0.84967,54.69526,0.84669,50.33774,0.76176,75.71949,0.83872 +7.81836,50.80003,0.84742,54.96245,0.84443,49.6771,0.75953,75.38933,0.83646 +7.82932,51.25244,0.84503,54.42294,0.84257,50.07403,0.75743,75.04888,0.8342 +7.83936,51.40796,0.84301,54.95761,0.8403,49.58691,0.75383,75.24111,0.83211 +7.85036,51.51358,0.84053,54.39215,0.83878,49.87984,0.75184,74.96014,0.83062 +7.86038,51.09136,0.83882,54.29105,0.8361,49.69894,0.74938,74.74431,0.82799 +7.87133,51.00664,0.8366,54.53843,0.83409,49.60935,0.74738,75.04174,0.82595 +7.88245,50.91816,0.83417,54.5297,0.83218,49.67933,0.74524,75.29329,0.82381 +7.89338,51.1724,0.83228,54.2453,0.83011,49.38578,0.74303,74.87744,0.82161 +7.90338,51.11271,0.8303,54.91258,0.82768,49.90249,0.74086,74.71177,0.81996 +7.91436,50.58222,0.8281,54.57594,0.82556,49.88952,0.73877,75.04328,0.81723 +7.92527,50.50222,0.82594,54.44762,0.82329,49.47706,0.73665,74.69207,0.8152 +7.93527,50.78242,0.82384,54.46611,0.82127,49.20617,0.73461,74.71931,0.8129 +7.94621,50.96373,0.82134,54.51947,0.81916,49.68857,0.73241,74.80968,0.81086 +7.95623,50.59651,0.81953,54.80389,0.81692,49.00883,0.73037,74.47732,0.80882 +7.96721,50.69087,0.81755,54.15038,0.81462,49.3844,0.72803,74.32323,0.80691 +7.97724,51.08039,0.81554,54.16668,0.81249,49.50973,0.72585,74.44983,0.80439 +7.98823,50.64287,0.81336,54.33281,0.81034,49.26142,0.72389,74.64952,0.80247 +7.99933,50.87042,0.81115,53.90215,0.80827,48.92933,0.72185,74.39775,0.80059 +8.01021,50.88998,0.8083,54.03806,0.80645,49.13811,0.71944,73.87087,0.79816 +8.02022,50.71843,0.80697,54.22402,0.80391,49.51586,0.71772,74.68034,0.79617 +8.03023,50.30476,0.80494,53.88316,0.80113,49.57873,0.71548,74.41058,0.79373 +8.04119,50.43769,0.80281,53.93639,0.79779,49.46774,0.7135,74.22345,0.79173 +8.05226,50.50692,0.80048,53.72291,0.79603,48.9217,0.71105,74.12513,0.79003 +8.06807,50.33115,0.79755,53.96997,0.79339,49.07906,0.70946,73.98924,0.78737 +8.07828,50.30322,0.79548,54.26569,0.79137,49.35582,0.70696,73.88346,0.78545 +8.08917,50.10853,0.79333,54.03921,0.78879,49.0761,0.70493,74.18324,0.783 +8.09923,50.49648,0.79127,53.94469,0.78704,49.19594,0.70276,73.77451,0.78079 +8.10924,50.47667,0.78939,53.88982,0.78483,48.62778,0.70042,74.14936,0.77879 +8.12029,49.83598,0.78768,53.6415,0.78315,49.21894,0.69857,74.18687,0.7766 +8.13103,50.05309,0.78497,53.33183,0.78062,48.80205,0.69669,73.75381,0.77459 +8.14109,50.01886,0.78301,53.12226,0.77839,48.80525,0.69443,73.55245,0.77259 +8.1512,49.82756,0.78097,53.04724,0.77604,48.72439,0.69226,73.53211,0.76988 +8.16199,49.83106,0.77887,53.27674,0.77404,48.52245,0.68988,73.3671,0.76817 +8.17292,49.73318,0.77674,53.54428,0.7722,48.58563,0.68781,73.54347,0.76614 +8.18303,49.90465,0.77464,53.38727,0.76994,48.71163,0.6856,73.61538,0.76401 +8.19394,49.9896,0.77247,53.54852,0.76763,48.45628,0.68336,73.70923,0.76203 +8.2049,50.01414,0.77021,53.62552,0.76573,48.61195,0.68144,73.81674,0.75991 +8.21588,49.68471,0.76761,53.24758,0.76374,48.72814,0.67934,73.28015,0.75799 +8.22681,49.60503,0.76592,52.99579,0.7613,48.49122,0.67733,73.51973,0.75542 +8.23776,50.01504,0.7637,52.69749,0.75911,48.42452,0.67506,73.18641,0.75325 +8.24779,49.72605,0.76118,53.43432,0.75693,48.61331,0.6731,72.79021,0.75191 +8.25791,49.84822,0.75952,52.96054,0.75457,48.36994,0.67095,73.64022,0.74915 +8.26885,49.42772,0.75742,52.96382,0.75258,48.15084,0.66874,73.18196,0.74684 +8.27887,49.68655,0.75552,52.79878,0.75038,48.36033,0.66655,72.94317,0.7447 +8.28979,49.38445,0.75329,53.14552,0.74833,48.36678,0.66454,73.07076,0.74254 +8.30077,49.54662,0.75111,53.0367,0.74603,47.7809,0.66233,72.92248,0.74048 +8.31172,49.12924,0.74883,52.92625,0.74401,47.65657,0.66032,73.30091,0.73851 +8.32174,49.3975,0.74693,52.45701,0.74166,48.33829,0.65833,73.06137,0.73638 +8.33266,49.3646,0.74474,53.27012,0.73965,48.19493,0.65598,72.67746,0.73437 +8.34267,49.45007,0.74221,52.74401,0.73756,48.02399,0.65411,72.90799,0.73218 +8.35268,49.17303,0.74088,52.91296,0.73562,48.15263,0.65181,72.96178,0.72998 +8.36363,49.21578,0.73853,52.89896,0.73402,48.32905,0.64948,72.88837,0.72777 +8.37365,48.93463,0.73686,52.86749,0.7314,48.38186,0.64765,72.7227,0.72591 +8.38461,48.96299,0.73439,53.07294,0.72867,47.9335,0.6456,72.64993,0.72337 +8.39549,48.91623,0.73221,52.97508,0.72669,47.65192,0.64339,72.27648,0.72131 +8.40552,48.75321,0.7303,52.49348,0.72505,48.13713,0.64142,72.28042,0.71902 +8.41552,49.00921,0.72806,52.68488,0.72307,48.03456,0.63926,72.63869,0.717 +8.4264,48.95122,0.72607,52.64487,0.72119,47.92521,0.63665,72.58817,0.71504 +8.4364,49.14471,0.72458,52.5302,0.71889,47.76859,0.63484,71.86774,0.71308 +8.4474,49.46177,0.72186,52.51424,0.71685,47.57369,0.63281,72.5526,0.71092 +8.45759,48.82032,0.7198,52.53736,0.71498,47.53749,0.6308,72.21604,0.70871 +8.46854,48.92278,0.71765,51.97517,0.7125,48.11019,0.6285,71.91024,0.70658 +8.47954,48.63956,0.71546,51.91511,0.71037,47.89912,0.62644,72.64559,0.70448 +8.49052,48.69868,0.7132,52.43939,0.7082,47.81468,0.62436,72.05592,0.70227 +8.5015,48.60899,0.71132,52.3179,0.70597,47.45663,0.62229,72.49261,0.70012 +8.51154,48.70159,0.70888,52.40203,0.70395,47.55315,0.62016,72.15186,0.69788 +8.52155,48.46757,0.70706,52.06572,0.70176,47.71895,0.61797,72.22961,0.69545 +8.53157,48.7509,0.70507,52.39304,0.69958,47.31889,0.61573,71.94419,0.69356 +8.54252,48.43747,0.70258,52.25465,0.69739,47.15894,0.61373,71.70215,0.69079 +8.55351,48.20134,0.70067,51.80905,0.69536,47.60994,0.61169,72.35473,0.68911 +8.56439,48.07043,0.69802,51.65765,0.69376,47.38048,0.60937,72.102,0.68693 +8.5744,48.82369,0.69632,51.71978,0.69103,47.56497,0.60743,71.72532,0.68472 +8.5853,48.45285,0.69429,52.09944,0.68879,47.32377,0.60499,72.03157,0.68252 +8.59633,48.20977,0.69165,51.71405,0.68651,46.86934,0.6032,71.79308,0.68005 +8.60733,48.53846,0.68988,51.27698,0.68442,47.40893,0.60126,71.64134,0.67813 +8.61829,48.09534,0.68775,51.92736,0.68231,47.13537,0.59922,71.58315,0.67641 +8.62925,48.25715,0.68565,51.32617,0.68007,47.25585,0.59703,71.60092,0.67369 +8.64028,47.84319,0.68329,51.30534,0.67808,47.03309,0.595,71.31316,0.67201 +8.65126,48.20518,0.68076,51.72822,0.67549,46.85178,0.59305,71.67054,0.66981 +8.66236,48.57883,0.67895,51.60924,0.67389,46.90808,0.59096,71.59616,0.66708 +8.67338,48.33012,0.67624,51.29731,0.67167,46.60182,0.589,70.9382,0.66544 +8.68342,48.36656,0.67473,51.41013,0.6695,47.01332,0.58672,71.10098,0.6633 +8.69442,48.2221,0.67256,51.34413,0.66742,46.49347,0.58474,71.32888,0.66128 +8.70539,48.48203,0.6706,51.7501,0.66527,46.81401,0.58253,70.83924,0.65905 +8.71627,48.40516,0.66816,51.63729,0.66333,46.37308,0.5805,71.60013,0.65645 +8.72631,48.12674,0.66619,51.14424,0.66145,46.96902,0.57844,71.41087,0.65487 +8.7373,48.17186,0.66383,51.1365,0.65921,46.65668,0.57613,70.99049,0.65337 +8.74733,47.54041,0.66217,51.23501,0.65756,46.84118,0.57432,71.05364,0.6505 +8.75827,47.86658,0.65977,51.04812,0.6548,46.71586,0.57235,70.85984,0.64831 +8.76827,47.67808,0.65777,51.00625,0.65264,46.58159,0.57009,70.98323,0.64617 +8.77922,48.02685,0.65545,51.32342,0.65068,46.71728,0.56795,71.0587,0.64386 +8.79025,47.8504,0.65343,51.21589,0.64851,46.18417,0.56571,70.77837,0.64175 +8.8012,47.62495,0.65127,50.96016,0.6464,46.31664,0.56353,70.8477,0.63976 +8.81123,47.4242,0.64965,50.96338,0.6444,46.59986,0.56157,70.86805,0.63774 +8.82223,47.50506,0.64705,51.1113,0.64221,46.39233,0.5596,70.73281,0.63507 +8.83227,47.62656,0.64504,50.8803,0.64,46.33671,0.55751,70.45703,0.63349 +8.84297,47.35744,0.64311,51.10037,0.63822,45.97227,0.55509,70.64837,0.63143 +8.85299,47.3213,0.64088,50.88073,0.63562,46.11249,0.55257,70.71933,0.629 +8.86421,47.33904,0.63869,51.1433,0.63365,45.75289,0.55077,70.34523,0.62697 +8.87519,47.55115,0.63662,50.63051,0.63164,45.9268,0.5487,70.47571,0.62478 +8.88602,47.65675,0.63423,50.65396,0.62926,45.91099,0.54632,70.10897,0.6232 +8.89602,47.4595,0.6322,50.64848,0.62695,45.81977,0.54418,70.35881,0.62081 +8.907,47.66001,0.62983,50.48824,0.6257,45.89969,0.54222,70.26955,0.61863 +8.91795,47.2747,0.62789,51.05759,0.62302,45.78215,0.54015,70.18999,0.61649 +8.92796,47.06919,0.62593,50.39173,0.62089,45.66503,0.53807,69.73627,0.61424 +8.93796,47.45624,0.62386,50.60294,0.61895,45.59215,0.53602,69.84604,0.61248 +8.94888,46.87859,0.62181,50.58706,0.61692,45.60895,0.53422,69.79261,0.61002 +8.95889,47.33347,0.61984,50.32745,0.61443,45.74692,0.53186,69.91561,0.60851 +8.96983,47.11835,0.61772,50.68727,0.61243,45.37365,0.52993,69.34861,0.60586 +8.97984,47.18843,0.61573,50.18122,0.61032,45.45107,0.52801,69.85996,0.60382 +8.99078,47.0374,0.61339,50.53715,0.60809,45.40807,0.5255,69.6778,0.60186 +9.00172,47.25831,0.61084,50.3045,0.60592,45.76391,0.52384,69.4224,0.59943 +9.01265,47.16697,0.60903,50.66498,0.60383,45.74681,0.52113,69.55872,0.5975 +9.02271,47.0021,0.60701,49.9845,0.60154,45.77268,0.51905,69.53161,0.59462 +9.03273,47.02064,0.60507,50.28778,0.59942,45.61347,0.51694,69.05038,0.59308 +9.0436,46.74549,0.6031,50.1757,0.59708,45.61548,0.51477,69.16438,0.59087 +9.05455,47.11565,0.60063,49.75327,0.59545,45.17755,0.51255,69.66805,0.58856 +9.06552,46.72433,0.59852,50.47938,0.59278,45.29641,0.51048,69.44631,0.58679 +9.07558,46.99797,0.59658,50.26721,0.59054,45.69594,0.5081,69.4098,0.58448 +9.08652,46.87486,0.59425,49.93283,0.58841,45.41761,0.50641,69.3024,0.5819 +9.09752,47.14672,0.59253,50.07547,0.58642,45.26713,0.50376,69.34315,0.58042 +9.10847,46.74659,0.58976,50.0037,0.58417,44.87905,0.50102,69.35186,0.5783 +9.11848,46.65767,0.58784,49.91917,0.58234,45.11447,0.49942,69.29972,0.57639 +9.12938,46.90592,0.58566,49.95465,0.58001,45.06176,0.4972,68.98356,0.57384 +9.13942,46.75573,0.58345,49.9859,0.57832,45.05567,0.49522,69.07384,0.57199 +9.1504,46.09396,0.58152,49.79065,0.57566,45.14921,0.49297,68.64245,0.56989 +9.16134,46.64633,0.57936,49.66004,0.57352,44.73749,0.49084,69.18661,0.56772 +9.17138,46.45848,0.5768,49.78253,0.57104,45.03528,0.4884,69.05266,0.5656 +9.18225,46.15284,0.57518,49.54533,0.56934,44.71162,0.4867,68.79144,0.56358 +9.19319,46.26325,0.57287,49.60616,0.56719,44.85475,0.48445,68.7012,0.56112 +9.20325,45.688,0.57105,49.21484,0.56515,44.86483,0.48236,68.4446,0.55912 +9.21327,46.03109,0.56904,49.82881,0.56292,44.47255,0.48018,68.25337,0.55695 +9.22424,46.26147,0.56678,49.42619,0.56078,44.27546,0.47781,68.66254,0.55473 +9.23523,46.33189,0.56471,49.3592,0.55812,44.92943,0.47578,68.50554,0.55281 +9.24525,46.30456,0.56277,49.44279,0.5566,44.59889,0.47376,68.53862,0.55057 +9.25621,45.79669,0.56039,49.37557,0.55444,44.13603,0.47186,68.62339,0.54853 +9.26622,46.03291,0.55838,49.28105,0.55207,44.61414,0.46955,68.56875,0.54657 +9.27725,45.45649,0.55662,49.03531,0.55016,44.52517,0.46733,68.18356,0.5444 +9.28821,45.89765,0.55401,49.1085,0.54798,44.32679,0.46539,68.40459,0.54239 +9.29924,45.65869,0.5521,48.69647,0.54595,44.28726,0.4632,68.21369,0.53977 +9.31023,45.70463,0.54962,49.26907,0.54381,44.0005,0.46091,68.34644,0.53802 +9.32125,45.59919,0.54795,49.21543,0.54175,44.11743,0.4591,67.97916,0.53578 +9.33196,45.52542,0.54528,48.79395,0.53965,44.15212,0.4566,68.22091,0.53383 +9.34221,45.95049,0.54324,49.32765,0.53765,44.36324,0.45424,67.95103,0.53158 +9.35302,45.96883,0.54143,49.11418,0.53523,43.76636,0.45229,68.08761,0.52959 +9.36396,45.58684,0.53888,49.01544,0.53304,44.08843,0.45029,68.08507,0.5279 +9.37496,45.78111,0.53668,48.8803,0.53086,43.57142,0.44825,68.03754,0.52528 +9.38593,45.89838,0.53459,48.85044,0.52889,43.72038,0.44602,67.3016,0.52309 +9.39688,45.61608,0.53233,48.996,0.52672,44.14282,0.44409,67.34235,0.5211 +9.40779,45.16564,0.53047,48.46112,0.5245,43.90527,0.44188,67.4214,0.51892 +9.41786,45.28471,0.52816,48.94631,0.52278,43.88558,0.43976,67.50528,0.51668 +9.42883,45.49805,0.52603,48.75624,0.52036,43.74732,0.43766,67.13337,0.51477 +9.4398,45.11777,0.52389,48.51799,0.51833,43.93221,0.43552,67.61373,0.51248 +9.45068,45.39562,0.52172,48.66624,0.51622,43.29132,0.43357,67.33448,0.51031 +9.46071,45.08488,0.51965,48.44325,0.51439,43.37296,0.43125,67.2244,0.50823 +9.47175,45.09848,0.51738,48.79204,0.512,43.91297,0.42887,67.24162,0.50636 +9.48265,44.97134,0.51522,48.80867,0.50937,43.30994,0.42681,67.02959,0.50415 +9.49368,45.50204,0.51301,48.30749,0.50766,43.5304,0.42468,67.47404,0.50188 +9.50468,45.16566,0.51081,48.34687,0.50559,43.45214,0.42251,67.21929,0.49955 +9.51557,45.18962,0.50883,48.49285,0.50295,43.15492,0.4207,67.04715,0.49773 +9.5266,44.99207,0.50645,48.29629,0.50109,42.80795,0.41833,67.32202,0.49553 +9.53663,44.98772,0.50444,48.53619,0.49872,42.94745,0.41627,67.04104,0.49321 +9.54755,45.31387,0.50224,48.33564,0.49707,43.48099,0.41447,66.75239,0.49137 +9.55849,44.94138,0.50004,48.35909,0.49484,43.13103,0.41255,66.99026,0.48941 +9.5685,45.16005,0.49807,47.96167,0.4929,43.20296,0.40992,66.8327,0.48676 +9.57948,44.51831,0.49554,47.84236,0.49079,43.01979,0.40785,67.05641,0.48497 +9.59046,44.62206,0.4937,47.80666,0.48845,42.92336,0.40557,66.8735,0.48299 +9.60134,44.33752,0.49205,47.91031,0.4865,42.93736,0.40342,66.80291,0.48125 +9.61135,44.7723,0.48939,47.86941,0.48426,42.75063,0.40122,66.46045,0.479 +9.62135,44.14621,0.4875,47.53627,0.48226,42.78298,0.39921,66.87804,0.47677 +9.63226,44.63482,0.48536,47.90552,0.48007,42.67783,0.39699,66.41397,0.4742 +9.64322,44.44545,0.48317,47.83472,0.47794,42.42854,0.39498,66.72767,0.47247 +9.65323,44.44073,0.48119,47.81949,0.47571,42.50241,0.39258,66.28326,0.47047 +9.66324,44.48535,0.47915,47.71815,0.47363,42.73361,0.39063,66.37167,0.46769 +9.67325,44.08732,0.47762,47.53687,0.47132,42.65686,0.38867,66.32124,0.46607 +9.68421,44.15525,0.47493,47.42577,0.46943,42.45944,0.38642,65.80562,0.46409 +9.69423,44.25362,0.47306,47.69362,0.46701,42.25062,0.38438,65.86427,0.46141 +9.70522,44.21501,0.471,47.34357,0.46493,42.20502,0.38225,66.05335,0.45977 +9.71623,44.37002,0.4686,47.1314,0.46263,42.83085,0.38004,65.67992,0.45746 +9.72721,44.25981,0.46595,47.4207,0.46058,42.61585,0.37808,65.86437,0.45554 +9.73817,44.20121,0.46425,47.05961,0.45859,42.65307,0.37607,65.8424,0.45329 +9.749,43.96218,0.46198,47.46038,0.45628,42.46343,0.37433,65.8758,0.45077 +9.75996,43.79829,0.45988,46.90752,0.45446,42.25923,0.37166,65.24464,0.44917 +9.76996,43.64214,0.45794,47.26573,0.45208,42.25474,0.3693,65.31557,0.44697 +9.78094,44.08549,0.45579,46.89626,0.44993,42.25246,0.36716,65.67901,0.44507 +9.79191,43.81791,0.45359,47.21123,0.4478,42.33401,0.36545,65.91525,0.44267 +9.80287,44.06903,0.4514,47.09234,0.44553,42.12326,0.36321,65.57838,0.44084 +9.81382,43.58342,0.44911,47.01961,0.44349,41.97659,0.36143,65.33853,0.43875 +9.82384,43.12258,0.44718,46.7808,0.44088,41.70182,0.35923,65.46513,0.43631 +9.83476,43.61499,0.44497,46.83764,0.43906,42.24888,0.35665,65.42635,0.43438 +9.84577,43.17458,0.44264,46.77952,0.43711,41.93848,0.35498,65.49655,0.43247 +9.85669,43.54569,0.4406,46.95735,0.43497,41.6051,0.35273,65.02439,0.43018 +9.86761,43.65036,0.43788,46.32659,0.4327,42.10263,0.35059,64.86003,0.42806 +9.87859,43.23518,0.43617,46.51287,0.42993,42.09687,0.34871,64.95386,0.42606 +9.88863,43.58007,0.43418,46.59092,0.42837,41.62558,0.34698,65.38051,0.42389 +9.89865,43.21036,0.43213,46.58317,0.42607,42.00592,0.34414,65.04679,0.42184 +9.90958,43.45294,0.43025,46.18502,0.4242,41.59098,0.34236,64.79883,0.41988 +9.92054,43.55324,0.42787,46.14673,0.42189,41.49197,0.34023,64.8429,0.41785 +9.93154,43.2009,0.4254,46.12078,0.41966,41.64667,0.33807,64.53096,0.41549 +9.94249,43.07649,0.4234,46.04145,0.41761,41.41885,0.33596,64.82481,0.4135 +9.95348,43.28238,0.42114,46.04379,0.41532,41.0395,0.33421,64.65558,0.41139 +9.9643,43.15464,0.41913,46.2437,0.41338,41.13181,0.3315,64.31355,0.40915 +9.9744,43.20615,0.41713,45.75562,0.41147,41.33768,0.32952,64.50675,0.4071 +9.98537,42.69136,0.41482,45.87454,0.40918,41.3536,0.32713,64.29246,0.4047 +9.99635,42.80861,0.41273,45.78879,0.40704,41.67932,0.32523,64.28442,0.403 +10.00725,42.80584,0.41057,46.23539,0.40487,40.85318,0.32317,64.66146,0.40097 +10.01823,42.67181,0.40869,46.34359,0.40286,41.21059,0.32103,64.18639,0.3989 +10.02848,42.87382,0.40624,45.89872,0.40065,41.07695,0.31885,64.25369,0.3966 +10.03852,42.76893,0.40424,45.53251,0.39875,40.86782,0.31683,64.05371,0.39458 +10.04858,42.30524,0.40232,45.76039,0.39626,40.85396,0.31438,64.26642,0.39226 +10.05949,43.08816,0.40017,45.66132,0.39413,41.0392,0.31239,64.4075,0.39053 +10.06949,42.64143,0.39852,45.68088,0.39172,40.95628,0.31097,64.12791,0.38829 +10.08052,42.63962,0.396,45.38737,0.38994,40.72553,0.30823,63.98071,0.38552 +10.09157,42.71982,0.39373,45.32494,0.3879,40.55198,0.30621,63.88099,0.38407 +10.10247,42.39921,0.39168,44.99082,0.38587,40.41026,0.30363,64.0801,0.38187 +10.11249,42.23707,0.38956,45.34276,0.38386,40.75864,0.3018,63.58561,0.38023 +10.12349,41.76154,0.38734,45.3022,0.3819,40.81825,0.29971,64.21898,0.37785 +10.13447,42.0632,0.38499,45.21839,0.3795,40.69919,0.29753,63.76139,0.37549 +10.14547,42.22261,0.38306,44.75981,0.37749,40.18671,0.2955,63.71864,0.3735 +10.15549,42.41639,0.38097,44.8684,0.37515,40.70893,0.29309,63.37755,0.37172 +10.16649,42.14473,0.37904,44.97603,0.37309,40.79639,0.29111,63.74466,0.36913 +10.17746,41.90643,0.37661,44.84934,0.37032,40.6808,0.28916,63.54104,0.36718 +10.18747,42.21147,0.3747,44.38693,0.36879,40.18483,0.28712,63.4877,0.36486 +10.19844,42.02745,0.37236,44.48968,0.36664,40.1635,0.28479,63.27577,0.36275 +10.2085,42.05256,0.37021,44.63403,0.36452,39.95348,0.28278,62.88356,0.36054 +10.21947,41.74194,0.36824,44.19299,0.36237,40.49708,0.28053,63.05572,0.35803 +10.22948,41.79789,0.36623,44.48553,0.36022,39.90236,0.27909,63.30629,0.35633 +10.24047,41.26668,0.36417,44.17749,0.35804,39.5486,0.27641,62.72216,0.35412 +10.25143,41.40066,0.36188,44.01863,0.35588,39.92926,0.27432,62.90337,0.35172 +10.26146,41.61051,0.35991,44.2439,0.35307,39.8649,0.27257,62.36098,0.34995 +10.27148,41.4949,0.3579,43.8477,0.35187,40.01346,0.26984,62.98956,0.34724 +10.28247,41.21446,0.35571,44.01342,0.34968,39.78196,0.26816,62.52123,0.34638 +10.29342,40.85258,0.35352,43.95139,0.34756,39.74999,0.26599,62.4925,0.34361 +10.30345,41.29149,0.35117,43.89904,0.34502,39.48977,0.26417,62.38606,0.34151 +10.31347,41.13631,0.34912,43.49318,0.34332,39.70381,0.26163,62.33431,0.33935 +10.3244,41.05218,0.34733,43.50624,0.34121,39.61127,0.26012,62.25531,0.3373 +10.33441,40.48667,0.34536,43.49687,0.33885,39.46332,0.25783,62.42529,0.33513 +10.34442,41.09585,0.34335,43.10009,0.33687,39.68254,0.25526,62.27938,0.33297 +10.35445,40.66735,0.34157,42.88662,0.33511,39.53273,0.25304,62.31344,0.33076 +10.36545,40.67589,0.33913,42.86905,0.33266,39.43727,0.25082,62.1316,0.32891 +10.37639,40.82457,0.33753,43.1876,0.33046,39.53338,0.24887,62.46631,0.3264 +10.38732,40.91924,0.33482,42.36314,0.329,39.57868,0.24689,61.95856,0.32421 +10.3983,40.5734,0.33264,42.55266,0.32604,39.09056,0.24499,61.80295,0.32197 +10.4092,40.692,0.33028,42.74568,0.32408,39.02976,0.2425,61.5194,0.32003 +10.42017,40.33453,0.32828,42.27157,0.32192,38.9055,0.241,61.66865,0.31771 +10.43021,40.27169,0.32618,42.01771,0.31995,38.88,0.23811,61.66344,0.31522 +10.44122,40.41318,0.32402,42.08755,0.31796,38.63306,0.23597,61.05245,0.31361 +10.45222,40.40917,0.32182,41.55136,0.31613,39.11838,0.23378,61.48784,0.31133 +10.46323,39.99741,0.31988,41.64696,0.31364,38.65735,0.23171,61.15419,0.30906 +10.47325,40.24624,0.31766,41.43676,0.31169,38.73058,0.22959,61.31155,0.30708 +10.48419,39.78258,0.31548,41.5083,0.30923,38.34217,0.22792,61.04719,0.30512 +10.4942,39.22591,0.31352,41.42247,0.30736,38.78823,0.22561,60.92742,0.30297 +10.50504,39.75221,0.31134,40.94998,0.30532,38.29202,0.22312,61.18534,0.30089 +10.51604,39.43465,0.30914,41.01568,0.303,37.63912,0.22131,61.14396,0.29873 +10.5262,39.20221,0.30715,40.87794,0.30091,38.29343,0.21881,60.40373,0.29718 +10.53696,38.95911,0.30505,40.42162,0.29894,38.19864,0.21605,61.14271,0.29446 +10.54697,38.8369,0.30297,40.2972,0.29666,38.28472,0.21439,60.83593,0.29228 +10.55792,38.91837,0.30069,40.00304,0.29466,37.99537,0.21254,60.56058,0.29016 +10.5689,38.5823,0.29859,39.44282,0.2925,38.03321,0.21053,60.60014,0.28792 +10.57988,39.02941,0.2963,39.61056,0.29029,37.46773,0.20814,60.27192,0.28622 +10.59083,38.28809,0.2943,39.36809,0.28836,37.62665,0.20628,60.27715,0.28375 +10.60087,38.23684,0.29229,39.06614,0.28598,37.36675,0.20416,60.08746,0.2818 +10.61177,38.45564,0.29015,39.11168,0.28423,37.3477,0.20167,60.4484,0.27906 +10.62179,38.3196,0.28817,38.66414,0.28213,37.33634,0.19996,59.95198,0.27739 +10.63275,38.35516,0.28593,38.4886,0.2802,37.40892,0.19786,59.86367,0.2749 +10.64373,37.49694,0.28348,38.50027,0.27778,37.24219,0.19579,59.9711,0.27314 +10.65373,37.91666,0.28184,38.18508,0.27597,37.59738,0.19348,59.53541,0.27129 +10.66463,37.78196,0.27961,37.82895,0.27387,37.2067,0.1914,59.69246,0.26907 +10.67559,37.53101,0.27749,37.93485,0.2719,37.06335,0.18976,59.78865,0.26654 +10.68654,37.07965,0.27533,37.43052,0.26977,36.60146,0.18702,59.25434,0.2647 +10.6966,37.1293,0.27327,37.55659,0.26772,36.70445,0.18486,59.19831,0.26284 +10.7076,36.84095,0.27111,37.4806,0.26557,36.23609,0.18285,59.15372,0.26058 +10.71852,36.78355,0.26901,37.29086,0.26339,36.50679,0.18056,59.42792,0.25836 +10.72948,36.45286,0.26668,37.16083,0.26147,36.14614,0.1785,58.94055,0.25617 +10.73948,36.17421,0.2648,36.58629,0.25932,35.78588,0.17638,59.15357,0.25399 +10.75046,36.0508,0.26265,36.38875,0.25703,36.2314,0.17413,58.80926,0.2519 +10.76135,35.80363,0.26018,35.62084,0.25518,35.84751,0.17139,58.35418,0.24994 +10.77236,35.67966,0.25835,35.5373,0.25294,35.69475,0.16978,58.38068,0.24791 +10.78335,35.10947,0.25619,35.73681,0.25092,35.41253,0.167,58.0613,0.24566 +10.79433,35.22923,0.25393,35.29162,0.24879,35.5407,0.16597,58.20215,0.24356 +10.80531,34.79991,0.25179,35.22993,0.24662,35.2656,0.16338,57.80185,0.24129 +10.81625,34.68247,0.24976,34.99005,0.2447,35.23586,0.16173,57.90322,0.23871 +10.82724,34.15724,0.24755,34.87214,0.24247,34.8931,0.15905,57.63432,0.2369 +10.83725,34.25182,0.24544,34.68207,0.24031,34.78893,0.15651,57.86537,0.23499 +10.84822,34.20164,0.24319,33.91093,0.23804,35.13821,0.15474,57.29766,0.23338 +10.85923,33.51994,0.24122,33.81706,0.23583,34.45619,0.15274,57.35978,0.23095 +10.86948,33.85837,0.23913,33.40721,0.23407,34.87773,0.15052,57.84208,0.22885 +10.88046,33.82358,0.23696,33.41181,0.23191,34.26262,0.14817,57.18543,0.22613 +10.89132,33.62004,0.23479,33.49798,0.2296,34.04287,0.14629,57.14409,0.2244 +10.90134,33.04323,0.23281,33.10025,0.22752,34.0646,0.14417,56.71918,0.22288 +10.91196,32.8912,0.23106,32.59656,0.22562,33.91471,0.14245,56.40205,0.22014 +10.92219,32.78598,0.22873,32.96452,0.22315,34.09337,0.14036,56.0923,0.21807 +10.93298,32.44706,0.22655,32.50048,0.22104,34.10953,0.13814,56.17715,0.2166 +10.94394,32.36069,0.22446,31.95804,0.21929,33.50228,0.13601,55.94991,0.21379 +10.954,32.38934,0.22236,31.8918,0.21685,33.31004,0.13393,56.26328,0.21182 +10.96495,31.87507,0.22018,31.74398,0.21416,32.78274,0.13166,56.38502,0.20949 +10.97574,31.65146,0.2181,31.62379,0.21255,32.84788,0.13,56.10633,0.20757 +10.98577,31.66308,0.21609,31.22314,0.21035,32.91202,0.12728,55.6562,0.20536 +10.99679,31.29715,0.2139,31.56314,0.20812,33.01179,0.12509,55.52258,0.20313 +11.00777,31.22841,0.21183,30.94106,0.20624,32.42202,0.12295,55.31227,0.20104 +11.01875,31.20089,0.20965,30.79941,0.20407,31.87271,0.12089,55.21288,0.19905 +11.0288,30.69692,0.20757,30.26291,0.20201,31.47222,0.11833,55.15501,0.19715 +11.04071,30.59498,0.20512,30.11598,0.19996,31.79463,0.11688,55.1609,0.19474 +11.05075,30.11084,0.20325,29.89796,0.19771,31.6282,0.11489,55.13529,0.19269 +11.06168,29.8806,0.20053,29.56354,0.19565,31.43208,0.11273,54.10517,0.19114 +11.0717,30.0949,0.19905,29.62175,0.19361,31.2952,0.11074,54.91072,0.18855 +11.08261,29.40126,0.19696,29.20549,0.19145,31.13784,0.10847,54.75574,0.18649 +11.09363,29.2301,0.19468,28.69304,0.18918,30.57201,0.10635,54.48352,0.18444 +11.10461,29.3072,0.19258,28.48307,0.1873,30.90259,0.1037,53.97804,0.18216 +11.11552,29.03988,0.19044,28.37197,0.18508,29.93016,0.10205,54.05158,0.1801 +11.12552,28.89377,0.18871,27.77307,0.18277,30.28268,0.10004,53.58289,0.17812 +11.13561,28.69837,0.18641,28.30871,0.18077,29.73336,0.09766,53.69129,0.17667 +11.1465,28.39176,0.18421,28.16864,0.17868,29.84188,0.09563,53.96678,0.17394 +11.15654,28.1228,0.18231,27.52359,0.17629,29.89762,0.09398,53.46841,0.17176 +11.16654,27.85107,0.17994,27.21286,0.17432,29.45504,0.09136,53.09659,0.16955 +11.17655,27.51679,0.17834,27.09593,0.17232,29.32618,0.08952,53.20533,0.1676 +11.1875,27.51308,0.17621,27.00726,0.1702,28.88369,0.08743,52.75681,0.16534 +11.19852,27.09651,0.17442,26.1356,0.1685,29.32556,0.08531,53.06237,0.16334 +11.20933,27.22229,0.17193,26.13274,0.1661,29.13591,0.08325,53.0727,0.16124 +11.21935,27.12584,0.16987,26.19292,0.16389,28.72257,0.08094,52.01148,0.15913 +11.2294,26.98789,0.16782,25.55493,0.16256,28.32897,0.07846,52.31736,0.157 +11.24034,26.82363,0.16551,26.11421,0.15982,28.35262,0.07672,52.54422,0.15467 +11.25042,26.87076,0.16368,25.18836,0.15777,27.82264,0.07486,52.06971,0.15299 +11.26142,26.3845,0.16158,25.13058,0.15498,27.99039,0.07256,51.73188,0.15084 +11.27143,25.81764,0.15944,25.24331,0.15318,27.37698,0.07039,51.69365,0.14897 +11.28237,25.72037,0.15741,24.49711,0.15162,27.36886,0.06901,51.70367,0.14661 +11.29331,25.33463,0.1552,24.35319,0.14942,27.12677,0.06636,52.03158,0.14466 +11.30426,25.18136,0.15302,24.20116,0.14745,26.21971,0.06409,51.04185,0.14279 +11.31439,25.15903,0.15104,24.15994,0.14517,26.42987,0.06162,51.0198,0.14075 +11.32529,25.16323,0.14893,23.82883,0.14298,25.9152,0.05977,50.91565,0.13821 +11.33628,24.72937,0.14664,23.58084,0.14079,26.10358,0.05636,51.25392,0.13647 +11.3463,24.3734,0.1447,23.50735,0.1388,25.99155,0.0544,50.60563,0.13441 +11.35725,24.32576,0.14233,22.9949,0.13678,25.41504,0.05226,50.27137,0.13274 +11.36729,24.28112,0.14052,23.13502,0.13472,25.01429,0.05009,50.30078,0.13023 +11.37829,24.06628,0.1384,22.89589,0.13248,24.97348,0.04843,49.9208,0.12832 +11.38924,23.62021,0.13556,22.27123,0.13055,24.65563,0.046,49.71502,0.12611 +11.40032,23.84655,0.13399,22.59302,0.12874,24.37104,0.04396,49.8901,0.12416 +11.41124,23.55095,0.13193,22.33625,0.1263,24.33031,0.04121,49.04382,0.12183 +11.42224,22.81863,0.12982,22.0811,0.12431,24.16234,0.03965,49.60241,0.11988 +11.43321,23.2033,0.12753,21.30346,0.1222,23.70323,0.03773,49.48457,0.11796 +11.44323,22.79391,0.12558,21.09228,0.11998,23.50313,0.03575,48.61143,0.11576 +11.45419,22.37297,0.12341,21.17977,0.11785,22.75698,0.03387,48.66577,0.11369 +11.46425,22.76225,0.12136,20.5344,0.11588,22.90791,0.03139,48.40368,0.11163 +11.47504,22.02831,0.11976,19.86261,0.11371,22.63666,0.02923,48.48327,0.10966 +11.48588,21.67053,0.11713,20.22071,0.11175,22.52494,0.02748,48.5047,0.10729 +11.49601,21.83455,0.11512,19.85052,0.1097,22.03875,0.02509,47.98628,0.10536 +11.50697,21.83369,0.11273,20.16516,0.10766,21.77075,0.02292,47.53865,0.10333 +11.5179,20.94799,0.11077,19.96916,0.10562,21.03657,0.02072,47.46687,0.10117 +11.52892,21.29689,0.10877,19.372,0.10123,20.81777,0.01855,47.14245,0.09787 +11.53983,20.81275,0.10648,18.64733,0.09971,21.07423,0.01656,46.85408,0.09602 +11.55078,20.26863,0.10421,19.01357,0.09768,21.09016,0.01422,46.76989,0.09407 +11.56778,20.06574,0.1013,18.46724,0.09575,20.48385,0.01214,46.44205,0.09195 +11.57876,20.08755,0.09908,18.59891,0.0933,19.72702,0.01001,46.44429,0.09002 +11.5897,20.20992,0.09693,18.28501,0.0914,19.88862,0.00772,46.42363,0.08771 +11.59973,20.01598,0.09496,17.8872,0.08944,19.59635,0.00562,45.65245,0.08564 +11.61068,19.50901,0.09329,17.76376,0.08712,19.20144,0.00336,45.55122,0.08322 +11.62164,19.41857,0.09059,17.0677,0.08501,19.24485,0.00161,45.2561,0.0814 +11.63268,19.05257,0.08841,17.22008,0.08304,19.13614,-8.92E-04,44.88334,0.07893 +11.64354,19.05422,0.08625,17.04789,0.08073,19.15563,-0.00305,44.68307,0.07705 +11.65453,18.6967,0.08404,16.43494,0.07887,18.53832,-0.00516,44.07014,0.07488 +11.66459,18.46356,0.08213,16.16167,0.0768,18.69498,-0.00726,43.84268,0.07275 +11.67552,18.22767,0.07994,16.5553,0.07454,17.85912,-0.00943,43.35007,0.07075 +11.68652,17.83782,0.07772,16.04838,0.07241,17.64964,-0.01167,42.80093,0.06866 +11.69655,17.83594,0.07548,15.22946,0.07046,17.37506,-0.01334,42.53172,0.06645 +11.70665,17.84256,0.07366,15.64648,0.06808,16.85551,-0.01543,42.13629,0.06435 +11.7176,17.82128,0.07156,15.38427,0.0664,16.01706,-0.01787,42.29614,0.06276 +11.72868,17.23753,0.0701,14.80455,0.06368,15.37676,-0.01968,41.87191,0.06006 +11.73967,16.62017,0.06728,14.58881,0.06157,15.47815,-0.02183,41.72365,0.05824 +11.74974,16.90771,0.06529,14.51867,0.05953,14.76273,-0.02403,40.81883,0.05631 +11.76065,16.48704,0.06307,14.56706,0.05745,14.54652,-0.02621,40.96258,0.05387 +11.77157,16.03024,0.06099,14.06794,0.05593,14.32181,-0.02818,40.68067,0.05248 +11.78161,16.39097,0.05891,13.48757,0.05312,14.10173,-0.03029,40.17845,0.04971 +11.79259,15.85533,0.05684,13.40109,0.05112,13.83405,-0.03242,39.75995,0.04774 +11.80352,16.07534,0.05472,13.06925,0.04919,13.30469,-0.0347,39.53825,0.04585 +11.81453,15.50604,0.05245,12.72319,0.04688,13.05124,-0.03662,39.18528,0.0436 +11.8255,15.43764,0.04995,12.62153,0.04483,13.08559,-0.03837,38.71145,0.04151 +11.83649,15.11285,0.04812,12.55821,0.04257,12.89748,-0.04067,38.53407,0.0396 +11.84742,15.11571,0.04604,12.17047,0.04062,12.59806,-0.04287,37.86356,0.03752 +11.85839,14.33371,0.04375,12.00478,0.03852,,,37.79233,0.03548 +11.86927,14.36897,0.04161,12.09454,0.03572,,,37.31212,0.03298 +11.87932,14.23826,0.03962,10.78718,0.03421,,,36.54961,0.03152 +11.88934,14.21093,0.0372,11.02838,0.03202,,,36.53931,0.0292 +11.89939,13.80522,0.03572,10.98382,0.02929,,,36.09211,0.02695 +11.91026,13.92664,0.03351,10.62802,0.02775,,,35.62194,0.02495 +11.92027,13.67149,0.03157,10.04041,0.02585,,,35.35565,0.02281 +11.93123,12.96892,0.02944,10.06744,0.02413,,,34.50455,0.02061 +11.9413,13.12038,0.02732,10.07593,0.02159,,,34.45599,0.01866 +11.95229,12.56143,0.02521,9.76522,0.01965,,,34.2634,0.01668 +11.96326,12.71018,0.02278,9.13609,0.01805,,,33.31393,0.0146 +11.97419,12.26343,0.02092,9.08829,0.01553,,,32.71624,0.01241 +11.98426,11.90737,0.01884,9.03992,0.01329,,,32.43895,0.01053 +11.99524,11.70606,0.01707,8.90446,0.01104,,,32.15303,0.00796 +12.00606,11.34852,0.0146,8.00724,0.00897,,,31.18836,0.00524 +12.01615,11.03899,0.01256,8.07846,0.00681,,,30.97799,0.00429 +12.02704,11.06109,0.01041,7.9053,0.00458,,,30.23145,0.00167 +12.03734,10.8336,0.00836,7.66909,0.00252,,,29.61168,-3.07E-04 +12.04826,10.34975,0.00624,7.16339,4.95E-04,,,28.68876,-0.0017 +12.05922,10.287,0.00374,,,,,, +12.0702,9.85755,0.00188,,,,,, +12.08023,9.84368,5.04E-06,,,,,, diff --git a/data/data-release/xps_measurements/C1s Scan.VGD b/data/data-release/xps_measurements/C1s Scan.VGD new file mode 100644 index 0000000000000000000000000000000000000000..bd814deed5faf1b88b8f4bcd8d0163922ba0f93d Binary files /dev/null and b/data/data-release/xps_measurements/C1s Scan.VGD differ diff --git a/data/data-release/xps_measurements/Cr2p Scan.VGD b/data/data-release/xps_measurements/Cr2p Scan.VGD new file mode 100644 index 0000000000000000000000000000000000000000..d352e270cdf0f8b49d4f715a96f66f726fe1cd53 Binary files /dev/null and b/data/data-release/xps_measurements/Cr2p Scan.VGD differ diff --git a/data/data-release/xps_measurements/CrLM2 Scan.VGD b/data/data-release/xps_measurements/CrLM2 Scan.VGD new file mode 100644 index 0000000000000000000000000000000000000000..2f624850e589c366bb55cde371924ca40b6fa056 Binary files /dev/null and b/data/data-release/xps_measurements/CrLM2 Scan.VGD differ diff --git a/data/data-release/xps_measurements/LICENSE.md b/data/data-release/xps_measurements/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..6faa45102268da9ba592923f54cf866e96afc3f7 --- /dev/null +++ b/data/data-release/xps_measurements/LICENSE.md @@ -0,0 +1,35 @@ +# Community Data License Agreement - Permissive - Version 2.0 + +This is the Community Data License Agreement - Permissive, Version 2.0 (the "agreement"). Data Provider(s) and Data Recipient(s) agree as follows: + +## 1. Provision of the Data + +1.1. A Data Recipient may use, modify, and share the Data made available by Data Provider(s) under this agreement if that Data Recipient follows the terms of this agreement. + +1.2. This agreement does not impose any restriction on a Data Recipient's use, modification, or sharing of any portions of the Data that are in the public domain or that may be used, modified, or shared under any other legal exception or limitation. + +## 2. Conditions for Sharing Data + +2.1. A Data Recipient may share Data, with or without modifications, so long as the Data Recipient makes available the text of this agreement with the shared Data. + +## 3. No Restrictions on Results + +3.1. This agreement does not impose any restriction or obligations with respect to the use, modification, or sharing of Results. + +## 4. No Warranty; Limitation of Liability + +4.1. All Data Recipients receive the Data subject to the following terms: + +THE DATA IS PROVIDED ON AN "AS IS" BASIS, WITHOUT REPRESENTATIONS, WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +NO DATA PROVIDER SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE DATA OR RESULTS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +## 5. Definitions + +5.1. "Data" means the material received by a Data Recipient under this agreement. + +5.2. "Data Provider" means any person who is the source of Data provided under this agreement and in reliance on a Data Recipient's agreement to its terms. + +5.3. "Data Recipient" means any person who receives Data directly or indirectly from a Data Provider and agrees to the terms of this agreement. + +5.4. "Results" means any outcome obtained by computational analysis of Data, including for example machine learning models and models' insights. \ No newline at end of file diff --git a/data/data-release/xps_measurements/O1s Scan.VGD b/data/data-release/xps_measurements/O1s Scan.VGD new file mode 100644 index 0000000000000000000000000000000000000000..7d29c9cc6e0599c8381eee1ba85d2c47826b5a00 Binary files /dev/null and b/data/data-release/xps_measurements/O1s Scan.VGD differ diff --git a/data/data-release/xps_measurements/OKL1 Scan.VGD b/data/data-release/xps_measurements/OKL1 Scan.VGD new file mode 100644 index 0000000000000000000000000000000000000000..a377514f400820777e903ac4e055c4a1b44a2a57 Binary files /dev/null and b/data/data-release/xps_measurements/OKL1 Scan.VGD differ diff --git a/data/data-release/xps_measurements/Ta4f Scan.VGD b/data/data-release/xps_measurements/Ta4f Scan.VGD new file mode 100644 index 0000000000000000000000000000000000000000..aa425b57d3ff2bfee33d70ac7274e3240f4e7c2c Binary files /dev/null and b/data/data-release/xps_measurements/Ta4f Scan.VGD differ diff --git a/data/data-release/xps_measurements/TaNO1 Scan.VGD b/data/data-release/xps_measurements/TaNO1 Scan.VGD new file mode 100644 index 0000000000000000000000000000000000000000..b62a2d7f86bc652fb5f3dd5d6c2406c4bfe8c15e Binary files /dev/null and b/data/data-release/xps_measurements/TaNO1 Scan.VGD differ diff --git a/data/data-release/xps_measurements/Valence.VGD b/data/data-release/xps_measurements/Valence.VGD new file mode 100644 index 0000000000000000000000000000000000000000..d7db4715f830f4617777c92df79bec11af9e6942 Binary files /dev/null and b/data/data-release/xps_measurements/Valence.VGD differ diff --git a/data/data-release/xps_measurements/XPS Survey.VGD b/data/data-release/xps_measurements/XPS Survey.VGD new file mode 100644 index 0000000000000000000000000000000000000000..18ae0d8cec76711fa3bfa8cbdcafeb6b40e9ab3a Binary files /dev/null and b/data/data-release/xps_measurements/XPS Survey.VGD differ diff --git a/data/data-release/xrd_measurements/LICENSE.md b/data/data-release/xrd_measurements/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..6faa45102268da9ba592923f54cf866e96afc3f7 --- /dev/null +++ b/data/data-release/xrd_measurements/LICENSE.md @@ -0,0 +1,35 @@ +# Community Data License Agreement - Permissive - Version 2.0 + +This is the Community Data License Agreement - Permissive, Version 2.0 (the "agreement"). Data Provider(s) and Data Recipient(s) agree as follows: + +## 1. Provision of the Data + +1.1. A Data Recipient may use, modify, and share the Data made available by Data Provider(s) under this agreement if that Data Recipient follows the terms of this agreement. + +1.2. This agreement does not impose any restriction on a Data Recipient's use, modification, or sharing of any portions of the Data that are in the public domain or that may be used, modified, or shared under any other legal exception or limitation. + +## 2. Conditions for Sharing Data + +2.1. A Data Recipient may share Data, with or without modifications, so long as the Data Recipient makes available the text of this agreement with the shared Data. + +## 3. No Restrictions on Results + +3.1. This agreement does not impose any restriction or obligations with respect to the use, modification, or sharing of Results. + +## 4. No Warranty; Limitation of Liability + +4.1. All Data Recipients receive the Data subject to the following terms: + +THE DATA IS PROVIDED ON AN "AS IS" BASIS, WITHOUT REPRESENTATIONS, WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +NO DATA PROVIDER SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE DATA OR RESULTS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +## 5. Definitions + +5.1. "Data" means the material received by a Data Recipient under this agreement. + +5.2. "Data Provider" means any person who is the source of Data provided under this agreement and in reliance on a Data Recipient's agreement to its terms. + +5.3. "Data Recipient" means any person who receives Data directly or indirectly from a Data Provider and agrees to the terms of this agreement. + +5.4. "Results" means any outcome obtained by computational analysis of Data, including for example machine learning models and models' insights. \ No newline at end of file diff --git a/data/data-release/xrd_measurements/Rietveld_refinment_TaCr2O6.pcr b/data/data-release/xrd_measurements/Rietveld_refinment_TaCr2O6.pcr new file mode 100644 index 0000000000000000000000000000000000000000..44dcf0f6ac07a9de040a5db2b23e0e9c990d9d18 --- /dev/null +++ b/data/data-release/xrd_measurements/Rietveld_refinment_TaCr2O6.pcr @@ -0,0 +1,146 @@ +COMM data_Ta0.66666667Cr1.33333333O4 +! Files => DAT-file: , PCR-file: mattergen-release\data-release\xrd_measurements\Rietveld_refinment_TaCr2O6 +!Job Npr Nph Nba Nex Nsc Nor Dum Iwg Ilo Ias Res Ste Nre Cry Uni Cor Opt Aut + 0 5 2 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 +! +!Ipr Ppl Ioc Mat Pcr Ls1 Ls2 Ls3 NLI Prf Ins Rpa Sym Hkl Fou Sho Ana + 0 0 1 0 1 0 4 0 0 3 0 1 1 0 0 0 1 +! +! Lambda1 Lambda2 Ratio Bkpos Wdt Cthm muR AsyLim Rpolarz 2nd-muR -> Patt# 1 + 1.540560 1.544390 0.50000 40.000 8.0000 0.9100 0.0000 0.00 0.0000 0.0000 +! +!NCY Eps R_at R_an R_pr R_gl Thmin Step Thmax PSD Sent0 + 20 0.10 1.00 1.00 1.00 1.00 5.0000 0.020000 90.0000 0.000 0.000 +! +!2Theta/TOF/E(Kev) Background for Pattern# 1 + 6.2400 107.6667 0.00 + 7.1400 95.0000 0.00 + 8.3000 95.6667 0.00 + 9.5200 92.6667 0.00 + 10.6200 85.3333 0.00 + 12.1400 91.6667 0.00 + 13.7600 119.0000 0.00 + 15.0000 125.6667 0.00 + 15.8400 142.0000 0.00 + 16.9200 141.3334 0.00 + 18.7000 166.0000 0.00 + 20.0800 198.6667 0.00 + 21.0200 188.3334 0.00 + 22.1400 215.6667 0.00 + 23.5000 220.3334 0.00 + 25.0600 219.3334 0.00 + 26.0800 212.6667 0.00 + 27.9200 194.0000 0.00 + 29.2800 183.0000 0.00 + 30.7000 192.3334 0.00 + 32.3800 181.3334 0.00 + 33.0400 166.6667 0.00 + 34.3800 169.3334 0.00 + 35.9800 185.6667 0.00 + 37.2000 142.3334 0.00 + 37.9800 155.6667 0.00 + 39.3400 155.6667 0.00 + 40.9800 147.0000 0.00 + 41.7800 138.3334 0.00 + 43.1800 160.6667 0.00 + 44.6600 148.6667 0.00 + 46.3200 159.3334 0.00 + 47.1600 164.0000 0.00 + 49.4000 175.6667 0.00 + 49.9000 167.3334 0.00 + 51.4200 178.3334 0.00 + 52.1800 173.0000 0.00 + 54.5800 208.3334 0.00 + 55.1200 190.0000 0.00 + 56.9600 173.3334 0.00 + 57.8800 172.3334 0.00 + 59.4600 173.3334 0.00 + 60.6000 158.0000 0.00 + 61.5800 174.6667 0.00 + 63.8200 168.3334 0.00 + 63.9000 151.0000 0.00 + 65.5800 172.6667 0.00 + 66.7800 169.0000 0.00 + 68.9400 177.6667 0.00 + 70.3800 161.6667 0.00 + 70.8000 157.3334 0.00 + 72.6400 161.0000 0.00 + 74.0200 162.3334 0.00 + 75.2600 166.0000 0.00 + 76.2400 169.0000 0.00 + 77.6600 171.0000 0.00 + 78.3000 167.6667 0.00 + 79.7200 169.6667 0.00 + 81.9800 170.0000 0.00 + 82.5600 156.6667 0.00 + 83.7800 187.3334 0.00 + 85.7800 181.6667 0.00 + 86.1800 184.6667 0.00 + 88.1200 164.3334 0.00 + 88.9800 172.6667 0.00 +! +! + 3 !Number of refined parameters +! +! Zero Code SyCos Code SySin Code Lambda Code MORE ->Patt# 1 + -0.01113 11.0 0.00000 0.0 0.00000 0.0 0.000000 0.00 0 +!------------------------------------------------------------------------------- +! Data for PHASE number: 1 ==> Current R_Bragg for Pattern# 1: 0.0000 +!------------------------------------------------------------------------------- +data_Ta0.66666667Cr1.33333333O4 +! +!Nat Dis Ang Pr1 Pr2 Pr3 Jbt Irf Isy Str Furth ATZ Nvk Npr More + 3 0 0 0.0 0.0 1.0 0 0 0 0 0 253.964 0 5 0 +! +! +P 42/M N M <--Space group symbol +!Atom Typ X Y Z Biso Occ In Fin N_t Spc /Codes +O2 O 0.19655 0.19655 0.50000 0.00000 0.25000 0 0 0 0 + 0.00 0.00 0.00 0.00 0.00 +Cr1 Cr 0.00000 0.00000 0.00000 0.00000 0.08333 0 0 0 0 + 0.00 0.00 0.00 0.00 0.00 +Ta0 Ta 0.00000 0.00000 0.00000 0.00000 0.04167 0 0 0 0 + 0.00 0.00 0.00 0.00 0.00 +!-------> Profile Parameters for Pattern # 1 ----> Phase # 1 +! Scale Shape1 Bov Str1 Str2 Str3 Strain-Model + 0.1448695E-02 0.29328 -2.47380 0.00000 0.00000 0.00000 0 + 21.00000 0.000 0.000 0.000 0.000 0.000 +! U V W X Y GauSiz LorSiz Size-Model + 0.197118 -0.159146 0.059143 0.005359 0.000000 0.000000 0.000000 0 + 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +! a b c alpha beta gamma #Cell Info + 4.648826 4.648826 3.028236 90.000000 90.000000 90.000000 + 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +! Pref1 Pref2 Asy1 Asy2 Asy3 Asy4 + 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 + 0.00 0.00 0.00 0.00 0.00 0.00 +!------------------------------------------------------------------------------- +! Data for PHASE number: 2 ==> Current R_Bragg for Pattern# 1: 0.0000 +!------------------------------------------------------------------------------- +data_Cr2O3 +! +!Nat Dis Ang Pr1 Pr2 Pr3 Jbt Irf Isy Str Furth ATZ Nvk Npr More + 2 0 0 0.0 0.0 1.0 0 0 0 0 0 911.926 0 5 0 +! +! +R -3 C <--Space group symbol +!Atom Typ X Y Z Biso Occ In Fin N_t Spc /Codes +Cr0 Cr 0.00000 0.00000 0.15185 0.00000 0.33333 0 0 0 0 + 0.00 0.00 0.00 0.00 0.00 +O1 O 0.00000 0.30380 0.25000 0.00000 0.50000 0 0 0 0 + 0.00 0.00 0.00 0.00 0.00 +!-------> Profile Parameters for Pattern # 1 ----> Phase # 2 +! Scale Shape1 Bov Str1 Str2 Str3 Strain-Model + 0.1331057E-04 2.35966 0.00000 0.00000 0.00000 0.00000 0 + 31.00000 0.000 0.000 0.000 0.000 0.000 +! U V W X Y GauSiz LorSiz Size-Model + 0.002915 -0.006758 0.006255 -0.003048 0.000000 0.000000 0.000000 0 + 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +! a b c alpha beta gamma #Cell Info + 4.956595 4.956595 13.611871 90.000000 90.000000 120.000000 + 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +! Pref1 Pref2 Asy1 Asy2 Asy3 Asy4 + 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 + 0.00 0.00 0.00 0.00 0.00 0.00 +! 2Th1/TOF1 2Th2/TOF2 Pattern to plot + 5.000 90.000 1 diff --git a/data/data-release/xrd_measurements/xrd_measurement_TaCr2O6.dat b/data/data-release/xrd_measurements/xrd_measurement_TaCr2O6.dat new file mode 100644 index 0000000000000000000000000000000000000000..56261f403ae0d1745901001e89982ac9fbc008fd --- /dev/null +++ b/data/data-release/xrd_measurements/xrd_measurement_TaCr2O6.dat @@ -0,0 +1,4252 @@ +5 0.02 90 +133 +153 +133 +157 +195 +197 +150 +185 +195 +145 +122 +153 +148 +180 +158 +163 +147 +142 +167 +143 +165 +147 +137 +163 +182 +150 +163 +163 +147 +152 +133 +177 +137 +155 +140 +130 +132 +138 +117 +138 +157 +137 +135 +115 +130 +153 +152 +135 +135 +163 +140 +128 +122 +132 +123 +110 +110 +123 +125 +135 +127 +118 +82 +123 +103 +123 +127 +152 +120 +138 +140 +167 +127 +112 +103 +127 +110 +118 +135 +105 +113 +123 +102 +125 +93 +110 +133 +108 +108 +93 +105 +112 +115 +118 +98 +113 +150 +103 +133 +105 +108 +100 +112 +97 +108 +113 +112 +83 +90 +113 +107 +103 +117 +102 +95 +110 +108 +112 +107 +113 +98 +98 +108 +105 +102 +118 +108 +130 +103 +103 +92 +103 +102 +88 +117 +98 +107 +92 +108 +107 +135 +78 +125 +82 +87 +83 +103 +108 +113 +108 +105 +107 +85 +102 +97 +125 +83 +92 +95 +92 +80 +110 +98 +123 +113 +72 +102 +102 +108 +88 +90 +103 +98 +115 +93 +82 +85 +112 +105 +112 +92 +100 +107 +87 +102 +73 +85 +82 +87 +105 +103 +80 +98 +102 +105 +77 +90 +87 +97 +112 +127 +113 +105 +97 +108 +120 +98 +97 +92 +102 +72 +83 +88 +75 +93 +122 +120 +120 +88 +80 +98 +80 +105 +82 +100 +107 +63 +108 +88 +95 +93 +98 +88 +107 +102 +118 +93 +92 +78 +97 +98 +93 +100 +98 +125 +107 +98 +102 +108 +98 +85 +103 +125 +103 +102 +90 +90 +112 +103 +80 +102 +80 +100 +90 +92 +118 +117 +103 +117 +98 +125 +92 +102 +97 +90 +115 +107 +113 +148 +132 +83 +73 +100 +97 +117 +97 +102 +98 +115 +123 +132 +98 +102 +130 +120 +110 +117 +107 +105 +107 +112 +110 +92 +103 +118 +98 +120 +123 +88 +120 +90 +117 +102 +110 +112 +140 +107 +115 +127 +113 +125 +127 +143 +112 +117 +107 +110 +133 +105 +95 +117 +112 +98 +135 +100 +110 +85 +108 +98 +103 +113 +140 +110 +132 +132 +102 +112 +130 +110 +82 +113 +122 +110 +100 +118 +108 +82 +80 +113 +123 +120 +98 +120 +115 +117 +103 +105 +97 +143 +128 +95 +110 +117 +127 +118 +112 +122 +127 +122 +122 +135 +140 +130 +113 +110 +108 +123 +130 +115 +137 +117 +110 +117 +147 +115 +127 +107 +122 +150 +120 +125 +115 +107 +127 +132 +123 +120 +110 +127 +142 +132 +135 +123 +107 +115 +122 +102 +117 +153 +92 +117 +117 +105 +118 +110 +97 +143 +108 +143 +123 +115 +160 +143 +143 +97 +112 +123 +145 +90 +122 +148 +128 +138 +132 +125 +133 +143 +138 +110 +155 +137 +118 +117 +133 +150 +148 +142 +122 +143 +123 +130 +137 +115 +110 +158 +158 +167 +135 +155 +155 +115 +125 +148 +123 +143 +115 +118 +117 +127 +140 +123 +125 +167 +142 +118 +137 +125 +160 +137 +158 +137 +118 +115 +143 +168 +158 +135 +143 +143 +123 +107 +147 +123 +140 +140 +133 +150 +145 +137 +117 +140 +150 +160 +165 +135 +148 +142 +165 +168 +148 +157 +113 +140 +137 +132 +177 +142 +145 +172 +152 +165 +145 +143 +147 +178 +140 +115 +135 +158 +148 +135 +122 +112 +192 +145 +162 +137 +158 +182 +157 +153 +162 +143 +130 +140 +118 +142 +147 +162 +168 +147 +152 +168 +125 +187 +163 +143 +152 +142 +158 +162 +147 +168 +145 +138 +153 +182 +172 +162 +148 +155 +143 +135 +155 +192 +178 +170 +152 +152 +185 +178 +135 +137 +153 +167 +160 +117 +147 +133 +160 +187 +193 +188 +140 +178 +130 +140 +148 +150 +178 +188 +155 +200 +170 +188 +172 +167 +168 +173 +197 +200 +182 +173 +177 +182 +198 +187 +155 +178 +178 +163 +170 +150 +188 +195 +215 +165 +187 +165 +182 +163 +147 +140 +183 +188 +170 +165 +172 +172 +175 +182 +187 +162 +188 +168 +205 +163 +182 +177 +190 +165 +170 +193 +205 +170 +168 +190 +175 +168 +170 +192 +190 +185 +205 +205 +192 +172 +172 +187 +185 +168 +190 +182 +162 +192 +148 +158 +187 +167 +200 +173 +210 +208 +168 +198 +187 +193 +200 +205 +200 +175 +192 +187 +162 +198 +212 +175 +208 +205 +200 +202 +192 +222 +205 +190 +190 +182 +207 +190 +197 +188 +167 +218 +210 +187 +198 +208 +218 +222 +177 +202 +218 +177 +225 +220 +197 +193 +202 +202 +215 +195 +208 +207 +220 +233 +228 +215 +187 +228 +237 +237 +238 +230 +213 +163 +220 +197 +183 +173 +217 +272 +195 +190 +228 +212 +207 +200 +193 +202 +225 +208 +178 +210 +215 +238 +233 +228 +208 +207 +238 +187 +192 +223 +177 +187 +193 +213 +225 +205 +200 +240 +220 +205 +213 +222 +237 +222 +222 +203 +217 +198 +175 +192 +207 +245 +232 +223 +265 +245 +227 +210 +220 +257 +242 +198 +240 +227 +260 +208 +210 +217 +213 +215 +235 +193 +202 +233 +228 +195 +240 +232 +237 +208 +242 +240 +208 +253 +208 +180 +215 +207 +197 +195 +248 +267 +218 +242 +278 +232 +257 +247 +238 +193 +230 +230 +243 +235 +175 +237 +225 +195 +198 +197 +227 +233 +212 +238 +260 +203 +275 +218 +212 +202 +252 +245 +237 +243 +237 +257 +265 +238 +253 +193 +255 +212 +228 +215 +222 +190 +230 +182 +223 +238 +217 +213 +248 +235 +268 +222 +220 +233 +237 +215 +218 +217 +250 +248 +217 +232 +268 +220 +222 +220 +243 +223 +238 +233 +233 +252 +233 +210 +227 +230 +257 +268 +190 +203 +255 +193 +223 +235 +272 +245 +233 +232 +235 +232 +278 +233 +235 +262 +228 +237 +235 +215 +220 +243 +238 +235 +242 +202 +250 +208 +215 +237 +240 +250 +242 +285 +245 +243 +200 +230 +228 +230 +238 +240 +233 +240 +220 +257 +232 +260 +283 +302 +287 +285 +255 +277 +238 +273 +255 +225 +247 +233 +237 +187 +232 +237 +278 +230 +258 +247 +243 +215 +220 +238 +195 +215 +232 +202 +225 +270 +178 +210 +225 +242 +250 +238 +252 +230 +210 +200 +248 +213 +213 +233 +253 +255 +240 +230 +223 +223 +222 +235 +220 +230 +220 +208 +237 +212 +233 +218 +233 +218 +208 +188 +275 +228 +233 +237 +243 +223 +265 +220 +225 +243 +212 +248 +220 +240 +240 +228 +245 +160 +233 +258 +260 +197 +257 +193 +223 +240 +232 +265 +220 +197 +215 +207 +235 +230 +222 +220 +230 +257 +237 +262 +242 +223 +252 +255 +243 +247 +257 +257 +257 +288 +307 +313 +302 +357 +358 +357 +365 +458 +495 +585 +645 +862 +978 +1273 +1493 +1825 +2178 +2565 +2762 +2995 +2930 +2860 +2523 +1913 +1418 +1157 +765 +573 +405 +352 +318 +288 +285 +292 +265 +262 +240 +255 +212 +230 +233 +215 +207 +225 +210 +215 +188 +228 +202 +220 +205 +230 +223 +225 +205 +207 +232 +210 +207 +157 +218 +207 +225 +228 +203 +220 +187 +205 +207 +230 +217 +197 +225 +195 +182 +187 +232 +190 +208 +188 +198 +162 +213 +188 +222 +223 +200 +202 +193 +253 +215 +215 +215 +187 +207 +188 +182 +188 +218 +205 +210 +217 +185 +202 +225 +203 +223 +207 +177 +212 +207 +173 +230 +188 +200 +232 +213 +197 +207 +212 +203 +230 +203 +228 +223 +193 +172 +162 +215 +210 +210 +205 +213 +202 +208 +175 +208 +223 +175 +177 +188 +208 +193 +180 +228 +218 +193 +193 +193 +182 +203 +198 +218 +177 +213 +178 +218 +202 +212 +217 +220 +188 +202 +210 +183 +193 +187 +193 +207 +193 +232 +198 +238 +208 +193 +225 +197 +202 +178 +172 +212 +188 +210 +192 +202 +208 +183 +193 +202 +182 +200 +202 +208 +187 +175 +203 +205 +220 +162 +195 +185 +178 +197 +195 +205 +213 +167 +203 +213 +200 +210 +195 +205 +165 +195 +187 +172 +193 +190 +217 +210 +240 +218 +200 +218 +180 +155 +190 +187 +173 +182 +217 +193 +205 +195 +197 +163 +202 +177 +207 +168 +195 +180 +232 +183 +185 +195 +195 +223 +195 +198 +177 +202 +220 +188 +207 +202 +197 +173 +207 +172 +183 +165 +182 +187 +212 +198 +237 +170 +203 +197 +160 +200 +225 +197 +203 +173 +215 +192 +188 +188 +198 +148 +198 +165 +178 +198 +188 +158 +183 +195 +207 +170 +207 +197 +203 +193 +188 +160 +195 +192 +188 +202 +192 +187 +215 +227 +175 +205 +210 +195 +185 +182 +162 +188 +150 +162 +183 +190 +228 +195 +187 +182 +177 +168 +223 +207 +157 +163 +188 +185 +188 +183 +180 +170 +197 +215 +170 +220 +210 +257 +227 +247 +288 +270 +287 +287 +235 +233 +182 +207 +207 +207 +213 +168 +178 +187 +187 +197 +178 +172 +163 +190 +190 +160 +157 +158 +157 +173 +203 +188 +182 +195 +185 +178 +157 +182 +193 +165 +167 +165 +165 +145 +198 +157 +178 +200 +178 +162 +195 +188 +180 +152 +162 +210 +157 +180 +190 +217 +182 +192 +155 +190 +205 +205 +208 +170 +203 +200 +220 +240 +225 +235 +248 +245 +272 +305 +322 +395 +458 +487 +573 +688 +710 +982 +1117 +1395 +1600 +1907 +2105 +2467 +2487 +2538 +2380 +2093 +1808 +1527 +1190 +968 +805 +517 +367 +357 +267 +265 +265 +202 +245 +213 +240 +218 +193 +188 +213 +172 +180 +157 +172 +165 +183 +200 +198 +152 +207 +192 +193 +178 +195 +200 +213 +202 +232 +247 +288 +253 +255 +275 +258 +230 +222 +218 +203 +193 +153 +175 +152 +150 +180 +178 +137 +165 +175 +162 +140 +140 +170 +162 +182 +197 +192 +137 +198 +157 +142 +183 +170 +168 +155 +133 +158 +162 +163 +163 +155 +167 +152 +150 +147 +177 +162 +155 +167 +162 +112 +153 +155 +158 +155 +152 +148 +165 +165 +157 +162 +155 +145 +215 +160 +163 +167 +150 +132 +165 +172 +143 +150 +168 +142 +160 +142 +187 +173 +178 +187 +190 +155 +180 +150 +185 +143 +157 +185 +137 +145 +173 +162 +177 +170 +190 +165 +178 +178 +177 +140 +157 +147 +152 +180 +178 +158 +165 +175 +223 +190 +177 +217 +190 +213 +220 +255 +270 +308 +400 +425 +470 +592 +665 +778 +915 +940 +862 +975 +745 +602 +510 +547 +455 +380 +277 +258 +188 +220 +178 +177 +193 +190 +197 +160 +183 +150 +183 +148 +178 +177 +195 +173 +135 +173 +155 +162 +133 +172 +167 +175 +178 +175 +148 +168 +158 +148 +148 +142 +195 +160 +182 +162 +170 +162 +155 +202 +185 +165 +160 +155 +190 +177 +148 +198 +167 +160 +145 +137 +165 +188 +175 +150 +185 +168 +172 +202 +195 +172 +180 +180 +148 +183 +195 +190 +183 +223 +167 +235 +273 +258 +285 +300 +297 +347 +347 +385 +345 +313 +293 +282 +262 +210 +190 +167 +215 +168 +192 +167 +177 +167 +163 +182 +157 +138 +182 +155 +175 +165 +128 +148 +170 +145 +155 +180 +160 +157 +130 +160 +148 +160 +148 +148 +178 +153 +170 +182 +163 +167 +157 +180 +200 +200 +200 +247 +200 +242 +185 +192 +230 +192 +183 +188 +162 +188 +158 +168 +157 +155 +127 +133 +167 +163 +207 +142 +170 +183 +173 +158 +177 +163 +170 +145 +163 +185 +192 +182 +133 +170 +157 +170 +165 +160 +152 +183 +155 +163 +147 +182 +170 +178 +157 +163 +162 +177 +162 +170 +190 +193 +145 +162 +183 +180 +177 +157 +163 +173 +172 +183 +173 +175 +180 +170 +145 +153 +175 +170 +173 +170 +163 +175 +162 +197 +157 +162 +175 +157 +172 +172 +148 +162 +185 +162 +180 +168 +197 +187 +210 +168 +207 +190 +212 +218 +223 +217 +228 +238 +220 +212 +228 +217 +202 +175 +167 +228 +155 +158 +180 +178 +197 +202 +187 +168 +170 +165 +175 +175 +157 +172 +177 +180 +162 +215 +177 +150 +183 +168 +152 +185 +182 +173 +200 +157 +197 +155 +195 +167 +197 +157 +160 +163 +187 +165 +152 +165 +173 +183 +185 +170 +182 +158 +177 +142 +137 +167 +163 +172 +187 +168 +165 +167 +158 +183 +182 +195 +203 +182 +183 +165 +182 +157 +195 +168 +197 +150 +185 +225 +177 +155 +158 +177 +200 +162 +173 +185 +210 +207 +183 +142 +157 +175 +160 +170 +163 +163 +207 +160 +177 +177 +202 +185 +162 +190 +157 +210 +168 +177 +190 +175 +215 +168 +177 +182 +178 +157 +178 +207 +187 +183 +165 +187 +203 +173 +163 +155 +182 +150 +163 +208 +190 +160 +177 +157 +183 +180 +157 +138 +183 +155 +185 +188 +140 +183 +183 +167 +162 +182 +203 +207 +170 +173 +185 +173 +177 +148 +198 +187 +185 +185 +212 +185 +213 +170 +158 +220 +172 +155 +168 +188 +180 +168 +182 +188 +157 +165 +188 +180 +167 +148 +177 +160 +175 +178 +192 +168 +190 +198 +178 +173 +183 +165 +177 +157 +170 +197 +175 +183 +185 +190 +217 +162 +155 +172 +183 +185 +180 +203 +178 +177 +190 +173 +160 +167 +200 +163 +207 +167 +178 +193 +168 +163 +182 +180 +188 +173 +165 +200 +162 +188 +160 +142 +158 +185 +178 +170 +162 +153 +185 +182 +178 +193 +185 +158 +183 +148 +150 +172 +180 +172 +180 +190 +180 +183 +172 +160 +198 +188 +190 +173 +192 +188 +190 +185 +202 +167 +193 +152 +157 +180 +215 +185 +197 +170 +157 +178 +187 +172 +178 +147 +160 +205 +188 +177 +213 +198 +170 +193 +183 +162 +200 +132 +195 +180 +173 +200 +160 +160 +178 +200 +165 +145 +177 +183 +155 +180 +163 +177 +195 +167 +153 +147 +202 +155 +207 +172 +140 +190 +155 +180 +185 +188 +178 +213 +162 +188 +180 +208 +240 +215 +242 +212 +255 +245 +258 +270 +223 +220 +192 +247 +235 +228 +203 +225 +197 +153 +202 +195 +207 +167 +203 +208 +178 +202 +175 +162 +162 +180 +202 +198 +190 +165 +175 +192 +193 +170 +187 +183 +160 +218 +173 +180 +185 +165 +153 +195 +162 +183 +160 +170 +177 +183 +215 +202 +220 +213 +208 +178 +177 +197 +192 +190 +142 +203 +207 +190 +168 +177 +182 +172 +180 +200 +203 +173 +203 +178 +198 +183 +180 +215 +178 +172 +182 +180 +203 +178 +203 +197 +193 +200 +197 +200 +160 +197 +207 +173 +220 +220 +170 +187 +155 +177 +180 +165 +185 +213 +177 +213 +190 +202 +187 +212 +180 +193 +207 +185 +190 +202 +217 +183 +202 +175 +200 +208 +198 +165 +172 +230 +228 +205 +198 +173 +207 +193 +188 +185 +188 +190 +233 +235 +220 +237 +277 +218 +278 +320 +358 +388 +390 +427 +483 +490 +600 +697 +812 +947 +1113 +1390 +1593 +1818 +2153 +2522 +2672 +2593 +2452 +2223 +2012 +1695 +1577 +1485 +1393 +1200 +990 +872 +692 +495 +373 +360 +298 +272 +270 +212 +213 +248 +183 +235 +197 +195 +222 +203 +242 +213 +190 +187 +182 +185 +203 +197 +192 +188 +202 +200 +188 +197 +167 +190 +180 +190 +167 +178 +188 +203 +218 +210 +218 +208 +198 +177 +182 +255 +158 +212 +177 +215 +200 +205 +172 +210 +223 +255 +205 +252 +332 +332 +337 +307 +312 +308 +253 +283 +270 +220 +258 +233 +227 +252 +213 +165 +192 +178 +218 +183 +218 +225 +190 +218 +185 +205 +225 +200 +173 +198 +205 +182 +177 +218 +182 +213 +178 +210 +208 +218 +252 +252 +270 +265 +283 +327 +347 +375 +428 +517 +548 +653 +773 +803 +857 +862 +722 +618 +607 +590 +495 +513 +502 +485 +430 +360 +297 +317 +245 +210 +227 +232 +190 +193 +203 +188 +235 +208 +197 +188 +175 +163 +177 +150 +230 +197 +203 +203 +192 +205 +178 +197 +208 +175 +160 +182 +152 +172 +195 +170 +190 +198 +198 +175 +178 +160 +160 +130 +230 +187 +183 +175 +172 +167 +182 +182 +213 +185 +180 +202 +178 +205 +153 +197 +195 +175 +192 +168 +192 +178 +175 +195 +200 +203 +178 +175 +173 +198 +182 +205 +183 +193 +180 +172 +207 +195 +172 +188 +175 +185 +217 +178 +182 +147 +188 +170 +217 +212 +172 +165 +197 +218 +202 +203 +180 +177 +192 +242 +198 +200 +168 +175 +190 +205 +197 +183 +235 +180 +168 +200 +187 +215 +208 +192 +202 +185 +180 +218 +202 +155 +193 +203 +223 +233 +200 +192 +180 +217 +185 +190 +157 +178 +212 +188 +180 +183 +167 +175 +205 +182 +188 +162 +188 +162 +188 +200 +155 +193 +197 +187 +182 +190 +162 +170 +170 +170 +152 +195 +203 +168 +175 +190 +135 +195 +207 +187 +175 +167 +167 +183 +182 +192 +182 +177 +200 +172 +220 +167 +190 +203 +165 +187 +178 +182 +208 +195 +203 +192 +200 +197 +205 +175 +215 +198 +213 +180 +163 +167 +193 +217 +188 +160 +218 +178 +195 +175 +193 +208 +172 +183 +178 +182 +190 +197 +200 +180 +162 +193 +172 +135 +167 +183 +207 +223 +210 +177 +182 +177 +227 +205 +193 +170 +225 +242 +235 +222 +197 +210 +255 +275 +272 +280 +245 +315 +345 +362 +390 +375 +432 +363 +428 +367 +392 +357 +347 +332 +317 +320 +310 +270 +257 +265 +253 +202 +193 +175 +202 +202 +140 +182 +170 +170 +230 +183 +190 +152 +190 +163 +168 +233 +198 +157 +193 +183 +185 +195 +187 +170 +205 +177 +197 +192 +168 +180 +180 +162 +172 +178 +195 +172 +187 +195 +143 +188 +192 +185 +187 +210 +182 +153 +185 +180 +220 +185 +170 +200 +188 +180 +190 +180 +185 +178 +227 +195 +192 +170 +175 +168 +198 +200 +170 +210 +217 +238 +218 +222 +203 +227 +212 +257 +278 +288 +333 +383 +423 +507 +610 +685 +728 +753 +662 +692 +627 +602 +465 +528 +493 +497 +477 +435 +427 +440 +415 +320 +272 +292 +217 +210 +240 +217 +220 +183 +203 +200 +180 +227 +185 +173 +205 +167 +163 +175 +192 +190 +120 +143 +190 +172 +205 +188 +197 +180 +193 +188 +202 +173 +200 +190 +190 +182 +190 +207 +140 +143 +183 +170 +207 +170 +180 +172 +172 +203 +160 +182 +168 +200 +212 +177 +195 +188 +187 +188 +193 +213 +173 +177 +193 +183 +195 +178 +235 +193 +197 +205 +178 +198 +167 +178 +237 +225 +215 +248 +213 +223 +238 +220 +220 +207 +223 +182 +200 +235 +213 +215 +183 +187 +183 +177 +190 +177 +163 +202 +188 +170 +185 +163 +160 +175 +148 +195 +178 +182 +178 +177 +198 +188 +198 +180 +195 +198 +185 +190 +187 +177 +192 +167 +187 +217 +185 +183 +195 +183 +190 +182 +215 +162 +188 +192 +185 +157 +187 +163 +183 +190 +165 +195 +183 +173 +183 +177 +160 +197 +170 +190 +162 +217 +207 +170 +172 +190 +153 +187 +243 +158 +225 +165 +195 +190 +147 +170 +190 +182 +188 +167 +178 +193 +207 +182 +152 +183 +180 +167 +183 +177 +237 +193 +172 +175 +173 +168 +177 +205 +167 +168 +200 +170 +188 +192 +185 +167 +195 +203 +213 +227 +202 +213 +232 +225 +235 +253 +250 +315 +285 +288 +330 +373 +400 +455 +483 +588 +700 +777 +873 +928 +863 +857 +882 +767 +733 +698 +732 +818 +837 +913 +838 +907 +887 +788 +715 +675 +530 +472 +543 +488 +442 +397 +423 +358 +352 +332 +293 +297 +275 +228 +220 +188 +205 +202 +200 +218 +182 +197 +200 +230 +193 +193 +193 +190 +232 +185 +187 +195 +165 +208 +185 +178 +150 +205 +182 +188 +157 +163 +178 +217 +153 +173 +193 +187 +178 +163 +208 +170 +190 +157 +162 +205 +202 +175 +172 +168 +153 +175 +180 +172 +152 +167 +190 +162 +175 +173 +170 +178 +190 +195 +202 +183 +183 +165 +160 +187 +160 +160 +220 +188 +205 +172 +165 +170 +190 +177 +162 +188 +165 +168 +155 +170 +167 +178 +198 +180 +187 +198 +165 +168 +153 +165 +217 +160 +140 +185 +163 +203 +210 +155 +203 +162 +177 +202 +175 +145 +142 +165 +173 +185 +160 +195 +157 +142 +147 +138 +187 +185 +180 +198 +190 +175 +185 +188 +200 +168 +193 +193 +167 +163 +177 +165 +183 +218 +178 +172 +200 +183 +152 +213 +183 +195 +205 +190 +202 +215 +188 +182 +177 +190 +208 +178 +187 +170 +180 +203 +203 +167 +185 +152 +185 +198 +168 +163 +197 +198 +172 +172 +163 +187 +163 +177 +187 +158 +153 +188 +155 +135 +168 +167 +180 +185 +197 +205 +192 +243 +178 +187 +157 +168 +175 +198 +157 +175 +180 +172 +218 +183 +187 +190 +215 +213 +158 +178 +147 +162 +183 +128 +172 +193 +182 +197 +182 +187 +167 +177 +210 +183 +187 +197 +183 +192 +220 +213 +222 +198 +212 +202 +228 +162 +190 +198 +168 +177 +197 +215 +185 +210 +187 +212 +185 +210 +160 +167 +197 +182 +183 +192 +178 +200 +185 +183 +162 +170 +160 +152 +178 +173 +183 +187 +190 +193 +205 +193 +180 +210 +195 +180 +200 +205 +180 +193 +177 +213 +195 +167 +143 +177 +187 +185 +195 +167 +188 +183 +188 +203 +185 +178 +202 +208 +197 +205 +185 +187 +208 +238 +205 +208 +175 +210 +232 +198 +187 +238 +238 +253 +265 +305 +268 +285 +347 +320 +363 +425 +360 +372 +377 +368 +340 +288 +307 +268 +295 +288 +298 +272 +287 +233 +292 +257 +237 +235 +217 +225 +228 +167 +193 +162 +153 +183 +158 +163 +167 +192 +190 +213 +165 +202 +198 +220 +183 +183 +163 +183 +168 +163 +167 +185 +168 +178 +180 +167 +163 +172 +203 +187 +153 +230 +192 +167 +198 +148 +183 +183 +183 +178 +188 +203 +183 +180 +162 +212 +170 +228 +173 +177 +172 +128 +207 +175 +142 +185 +163 +153 +165 +205 +178 +195 +157 +168 +180 +185 +182 +170 +208 +188 +202 +165 +185 +190 +180 +157 +162 +197 +178 +223 +187 +190 +190 +205 +228 +182 +170 +190 +205 +207 +208 +163 +188 +195 +188 +207 +175 +153 +182 +182 +183 +210 +152 +200 +170 +182 +163 +178 +178 +178 +193 +165 +163 +220 +173 +167 +188 +168 +185 +198 +167 +203 +135 +175 +170 +190 +187 +195 +212 +195 +192 +185 +175 +198 +193 +143 +190 +212 +232 +205 +173 +168 +158 +203 +193 +198 +173 +198 +205 +172 +183 +187 +170 +177 +153 +173 +180 +183 +163 +167 +153 +175 +190 +193 +175 +187 +172 +205 +183 +167 +195 +188 +173 +180 +227 +165 +183 +170 +198 +202 +212 +182 +190 +175 +175 +197 +180 +183 +208 +167 +168 +197 +212 +215 +212 +200 +198 +188 +180 +160 +170 +165 +175 +197 +192 +192 +190 +180 +182 +168 +207 +168 +197 +170 +190 +193 +190 +192 +207 +173 +168 +140 +172 +163 +187 +137 +185 +175 +195 +178 +182 +195 +157 +185 +188 +207 +150 +178 +178 +203 +187 +200 +167 +167 +173 +178 +177 +150 +175 +177 +193 +187 +185 +183 +233 +172 +197 +185 +182 +202 +217 +163 +193 +202 +188 +198 +222 +182 +202 +238 +223 +190 +200 +202 +240 +238 +225 +227 +242 +258 +292 +315 +373 +397 +432 +507 +537 +552 +527 +630 +568 +513 +417 +383 +350 +317 +328 +350 +363 +378 +370 +383 +338 +320 +283 +300 +265 +223 +192 +225 +213 +207 +205 +185 +198 +215 +158 +183 +188 +187 +157 +202 +218 +167 +192 +198 +175 +207 +200 +155 +202 +193 +167 +180 +215 +172 +197 +198 +145 +167 +163 +173 +177 +198 +177 +205 +218 +187 +162 +158 +178 +188 +167 +175 +168 +173 +160 +172 +183 +200 +197 +183 +220 +175 +212 +183 +163 +142 +165 +158 +167 +200 +195 +167 +207 +200 +217 +188 +225 +242 +190 +238 +213 +210 +242 +260 +233 +293 +287 +327 +307 +298 +323 +285 +305 +282 +303 +215 +263 +248 +227 +253 +238 +242 +247 +243 +250 +205 +207 +210 +207 +185 +232 +170 +173 +160 +183 +210 +160 +177 +168 +205 +170 +187 +218 +160 +175 +207 +138 +217 +178 +192 +162 +190 +187 +187 +188 +187 +198 +138 +167 +175 +207 +183 +202 +173 +182 +177 +193 +187 +172 +213 +165 +183 +190 +205 +207 +210 +172 +160 +160 +173 +150 +208 +207 +177 +172 +180 +190 +203 +192 +195 +217 +177 +192 +200 +180 +185 +188 +203 +168 +202 +160 +167 +157 +187 +163 +215 +177 +170 +178 +182 +212 +152 +180 +173 +190 +152 +197 +198 +187 +167 +222 +192 +177 +202 +178 +167 +185 +168 +155 +177 +182 +162 +150 +175 +178 +213 +175 +208 +163 +177 +165 +167 +172 +168 +190 +190 +148 +207 +150 +182 +197 +170 +165 +198 +182 +188 +175 +158 +183 +175 +188 +162 +185 +182 +165 +197 +150 +207 +207 +198 +175 +197 +175 +172 +183 +178 +195 +153 +180 +203 +200 +218 +187 +185 +205 +212 +185 +187 +153 +172 +183 +178 +218 +247 +170 +168 +188 +212 +180 +185 +168 +195 +190 +182 +163 +183 +177 +208 +195 +223 +195 +217 +180 +187 +222 +208 +207 +222 +203 +220 +202 +228 +210 +238 +247 +247 +278 +308 +342 +333 +335 +388 +363 +410 +422 +357 +392 +382 +358 +347 +315 +313 +268 +313 +300 +287 +327 +235 +273 +267 +325 +242 +277 +237 +227 +223 +217 +215 +192 +183 +180 +195 +178 +150 +165 +185 +162 +183 +185 +160 +183 +177 +193 +173 +173 +195 +177 +175 +182 +178 +170 +160 +158 +175 +202 +180 +187 +165 +170 +190 +173 +177 +217 +185 +177 +172 +153 +192 +178 +168 +183 +175 +205 +215 +198 +193 +152 +173 +185 +250 +170 +202 +207 +220 +195 +207 +223 +245 +277 +245 +275 +333 +323 +320 +380 +320 +267 +300 +308 +248 +232 +210 +222 +237 +238 +235 +258 +228 +235 +277 +258 +243 +192 +203 +202 +203 +193 +177 +192 +222 +200 +198 +170 +167 +205 +180 +213 +177 diff --git a/data/mattergen/__init__.py b/data/mattergen/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b501c54de4a476261bb642e197d2d20f2101617f --- /dev/null +++ b/data/mattergen/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +__version__ = "1.0.0" diff --git a/data/mattergen/adapter.py b/data/mattergen/adapter.py new file mode 100644 index 0000000000000000000000000000000000000000..5c544ad5db8ca95cbe6d775552e17106a13bc3d6 --- /dev/null +++ b/data/mattergen/adapter.py @@ -0,0 +1,128 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Callable + +import torch + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.data.types import PropertySourceId +from mattergen.denoiser import GemNetTDenoiser, get_chemgraph_from_denoiser_output +from mattergen.property_embeddings import ( + ZerosEmbedding, + get_property_embeddings, + get_use_unconditional_embedding, +) + +BatchTransform = Callable[[ChemGraph], ChemGraph] + + +class GemNetTAdapter(GemNetTDenoiser): + """ + Denoiser layerwise adapter with GemNetT. On top of a mattergen.denoiser.GemNetTDenoiser, + additionally inputs <property_embeddings_adapt> that specifies extra conditions to be conditioned on. + """ + + def __init__(self, property_embeddings_adapt: torch.nn.ModuleDict, *args, **kwargs): + super().__init__(*args, **kwargs) + + # ModuleDict[PropertyName, PropertyEmbedding] -- conditions adding by this adapter + self.property_embeddings_adapt = torch.nn.ModuleDict(property_embeddings_adapt) + + # sanity check keys are required by the adapter that already exist in the base model + assert all( + [ + k not in self.property_embeddings.keys() + for k in self.property_embeddings_adapt.keys() + ] + ), f"One of adapter conditions {self.property_embeddings_adapt.keys()} already exists in base model {self.property_embeddings.keys()}, please remove." + + # we make the choice that new adapter fields do not alter the unconditional score + # we therefore need the unconditional embedding for all properties added in the adapter + # to return 0. We hack the unconditional embedding module here to achieve that + for property_embedding in self.property_embeddings_adapt.values(): + property_embedding.unconditional_embedding_module = ZerosEmbedding( + hidden_dim=property_embedding.unconditional_embedding_module.hidden_dim, + ) + + def forward( + self, + x: ChemGraph, + t: torch.Tensor, + ) -> ChemGraph: + """ + augment <z_per_crystal> with <self.condition_embs_adapt>. + """ + (frac_coords, lattice, atom_types, num_atoms, batch,) = ( + x["pos"], + x["cell"], + x["atomic_numbers"], + x["num_atoms"], + x.get_batch_idx("pos"), + ) + # (num_atoms, hidden_dim) (num_crysts, 3) + t_enc = self.noise_level_encoding(t).to(lattice.device) + z_per_crystal = t_enc + + # shape = (Nbatch, sum(hidden_dim of all properties in condition_on_adapt)) + conditions_base_model: torch.Tensor = get_property_embeddings( + property_embeddings=self.property_embeddings, batch=x + ) + + if len(conditions_base_model) > 0: + z_per_crystal = torch.cat([z_per_crystal, conditions_base_model], dim=-1) + + # compose into a dict + conditions_adapt_dict = {} + conditions_adapt_mask_dict = {} + for cond_field, property_embedding in self.property_embeddings_adapt.items(): + conditions_adapt_dict[cond_field] = property_embedding.forward(batch=x) + try: + conditions_adapt_mask_dict[cond_field] = get_use_unconditional_embedding( + batch=x, cond_field=cond_field + ) + except KeyError: + # no values have been provided for the conditional field, + # interpret this as the user wanting an unconditional score + conditions_adapt_mask_dict[cond_field] = torch.ones_like( + x["num_atoms"], dtype=torch.bool + ).reshape(-1, 1) + + output = self.gemnet( + z=z_per_crystal, + frac_coords=frac_coords, + atom_types=atom_types, + num_atoms=num_atoms, + batch=batch, + lengths=None, + angles=None, + lattice=lattice, + # we construct the graph on the fly, hence pass None for these: + edge_index=None, + to_jimages=None, + num_bonds=None, + cond_adapt=conditions_adapt_dict, + cond_adapt_mask=conditions_adapt_mask_dict, # when True use unconditional embedding + ) + + pred_atom_types = self.fc_atom(output.node_embeddings) + + return get_chemgraph_from_denoiser_output( + pred_atom_types=pred_atom_types, + pred_lattice_eps=output.stress, + pred_cart_pos_eps=output.forces, + training=self.training, + element_mask_func=self.element_mask_func, + x_input=x, + ) + + @property + def cond_fields_model_was_trained_on(self) -> list[PropertySourceId]: + """ + We adopt the convention that all property embeddings are stored in torch.nn.ModuleDicts of + name property_embeddings or property_embeddings_adapt in the case of a fine tuned model. + + This function returns the list of all field names that a given score model was trained to + condition on. + """ + return list(self.property_embeddings) + list(self.property_embeddings_adapt) diff --git a/data/mattergen/common/__init__.py b/data/mattergen/common/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f63beed9d314ccd7ca1ae4705b6701b98dc89b92 --- /dev/null +++ b/data/mattergen/common/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +__version__ = "0.1.0" diff --git a/data/mattergen/common/data/__init__.py b/data/mattergen/common/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/common/data/callback.py b/data/mattergen/common/data/callback.py new file mode 100644 index 0000000000000000000000000000000000000000..9191e8c3bda5abfe832b451fe857764a1b800e8b --- /dev/null +++ b/data/mattergen/common/data/callback.py @@ -0,0 +1,62 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from collections import defaultdict +from typing import TypeVar + +import pytorch_lightning as pl +import torch +from pytorch_lightning.callbacks import Callback +from tqdm.auto import tqdm + +from mattergen.denoiser import GemNetTDenoiser +from mattergen.diffusion.lightning_module import DiffusionLightningModule +TensorOrStringType = TypeVar("TensorOrStringType", torch.Tensor, list[str]) + + +def maybe_to_tensor(values: list[TensorOrStringType]) -> TensorOrStringType: + if isinstance(values[0], torch.Tensor): + return torch.cat(values) + # chemical system is str and therefore cannot be converted to tensor + return [el for x in values for el in x] + + +class SetPropertyScalers(Callback): + """ + Utility callback; at the start of training, this computes the mean and std of the property data and adds the property + scalers to the model. + """ + + @staticmethod + def _compute_property_scalers( + datamodule: pl.LightningDataModule, property_embeddings: torch.nn.ModuleDict + ): + property_values = defaultdict(list) + + # property names may be distinct from keys in this dictionary + property_names = [p.name for p in property_embeddings.values() if not isinstance(p.scaler, torch.nn.Identity)] + if len(property_names) == 0: + return + for batch in tqdm(datamodule.train_dataloader(), desc=f"Fitting property scalers"): + for property_name in property_names: + # concat all values in train dataset for this given property + property_values[property_name].append(batch[property_name]) + + for property_name in property_names: + property_embeddings[property_name].fit_scaler( + all_data=maybe_to_tensor(values=property_values[property_name]) + ) + + def on_fit_start(self, trainer: pl.Trainer, pl_module: DiffusionLightningModule): + model: GemNetTDenoiser = pl_module.diffusion_module.model + + # model.property_embeddings: torch.nn.ModuleDict always exists + self._compute_property_scalers( + datamodule=trainer.datamodule, property_embeddings=model.property_embeddings + ) + + if hasattr(model, "property_embeddings_adapt"): + # this is a fine tune model + self._compute_property_scalers( + datamodule=trainer.datamodule, property_embeddings=model.property_embeddings_adapt + ) diff --git a/data/mattergen/common/data/chemgraph.py b/data/mattergen/common/data/chemgraph.py new file mode 100644 index 0000000000000000000000000000000000000000..88a9db9dbe4b0bec73f49242aeb192be4c137e77 --- /dev/null +++ b/data/mattergen/common/data/chemgraph.py @@ -0,0 +1,158 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import copy + +import torch +import torch_geometric.data as pyg_data +from torch import IntTensor, LongTensor, Tensor +from torch_geometric import utils +from torch_geometric.typing import OptTensor + + +class ChemGraph(pyg_data.Data): + r"""A ChemGraph is a Pytorch Geometric Data object describing a MLPotential molecular graph with atoms in 3D space. + The data object can hold node-level, and graph-level attributes, as well as (pre-computed) edge information. + In general, :class:`~torch_geometric.data.Data` tries to mimic the + behaviour of a regular Python dictionary. + In addition, it provides useful functionality for analyzing graph + structures, and provides basic PyTorch tensor functionalities. + See `here <https://pytorch-geometric.readthedocs.io/en/latest/notes/ + introduction.html#data-handling-of-graphs>`__ for the accompanying + tutorial. + + Args: + atomic_numbers (LongTensor, optional): Atomic numbers following ase.Atom, (Unknown=0, H=1) with shape + :obj:`[num_nodes]`. (default: :obj:`None`) + pos (Tensor, optional): Node position matrix, only set one position value. + :obj:`[num_nodes, 3]`. (default: :obj:`None`) + cell (Tensor, optional): Cell matrix if pbc = True, has shape + :obj:`[1, 3, 3]`. (default: :obj:`None`) + edge_index (LongTensor, optional): Edge indexes (sender, receiver) + :obj:`[2, num_edges]`. (default: :obj:`None`) + edge_attr (Tensor, optional): Edge attributes + :obj:`[num_edges, num_edge_attr]`. (default: :obj:`None`) + **kwargs (optional): Additional attributes to be stored in the data object. + """ + + def __init__( + self, + atomic_numbers: IntTensor | None = None, + pos: OptTensor = None, + cell: OptTensor = None, + edge_index: LongTensor | None = None, + edge_attr: OptTensor = None, + **kwargs, + ): + super().__init__(x=None, edge_index=edge_index, edge_attr=edge_attr, pos=pos, **kwargs) + + if atomic_numbers is not None: + self.atomic_numbers = atomic_numbers + if cell is not None: + self.cell = cell + self.__dict__["_frozen"] = True + + def __setattr__(self, attr, value): + if self.__dict__.get("_frozen", False) and attr not in ( + "_num_graphs", + "_slice_dict", + "_inc_dict", + "_collate_structure", + ): + raise AttributeError( + f"Replacing ChemGraph.{attr} in-place. Consider using the self.replace method to create a shallow copy." + ) + return super().__setattr__(attr, value) + + def replace(self, **kwargs: OptTensor | str | int | float | list) -> "ChemGraph": + """Returns a shallow copy of the ChemGraph with updated fields.""" + out = self.__class__.__new__(self.__class__) + for key, value in self.__dict__.items(): + out.__dict__[key] = value + out.__dict__["_store"] = copy.copy(self._store) + for key, value in kwargs.items(): + out._store[key] = value + out._store._parent = out + return out + + def get_batch_idx(self, field_name: str) -> LongTensor | None: + """Used by diffusion library to retrieve batch indices for a given field.""" + assert isinstance( + self, pyg_data.Batch + ) # ChemGraphBatch subclass is dynamically defined by PyG + if field_name == "cell": + # Graph-level attributes become 'dense' fields where the first dimension is batch dimension. + return None + elif field_name in [ + "pos", + "atomic_numbers", + ]: + # per-node attributes + return self.batch + else: + try: + # This happens if 'follow_batch' kwarg was used when constructing the batch + return self[f"{field_name}_batch"] + except KeyError: + raise NotImplementedError(f"Unable to determine batch index for {field_name}") + + def get_batch_size(self): + # For diffusion library. Only works if self is a ChemGraphBatch + assert isinstance(self, pyg_data.Batch) + return self.num_graphs + + def subgraph(self, subset: Tensor) -> "ChemGraph": + """ + Returns the induced subgraph given by the node indices :obj:`subset`. If no edge indices are + present, subsets will only be created for node features. + + Args: + subset (LongTensor or BoolTensor): The nodes to keep. + """ + # Check for boolean mask or index array. + if subset.dtype == torch.bool: + num_nodes = int(subset.sum()) + else: + num_nodes = subset.size(0) + subset = torch.unique(subset, sorted=True) + + # If edge indices are provided, determine subgraph components. Otherwise use only `subset` + # to select relevant nodes of node attributes. + if self.edge_index is not None: + out = utils.subgraph( + subset, + self.edge_index, + relabel_nodes=True, + num_nodes=self.num_nodes, + return_edge_mask=True, + ) + edge_index, _, edge_mask = out + else: + edge_index = None + edge_mask = None + + # Create dictionary of the subsets of all quantities. + masked_data = {} + for key, value in self: + if value is None: + continue + if key == "edge_index": + masked_data[key] = edge_index + if key == "num_nodes": + masked_data[key] = num_nodes + elif self.is_node_attr(key): + cat_dim = self.__cat_dim__(key, value) + masked_data[key] = utils.select(value, subset, dim=cat_dim) + elif self.is_edge_attr(key) and edge_index is not None: + cat_dim = self.__cat_dim__(key, value) + masked_data[key] = utils.select(value, edge_mask, dim=cat_dim) + + # Generate final graph. + data = self.replace(**masked_data) + + return data + + +# Retrieve a pointer for the DynamicInheritance-based PYG Batch class. +# For typing reasons only, use isinstance(pyg_data.Batch) for runtime checks. +ChemGraphBatch = pyg_data.Batch(_base_cls=ChemGraph).__class__ diff --git a/data/mattergen/common/data/collate.py b/data/mattergen/common/data/collate.py new file mode 100644 index 0000000000000000000000000000000000000000..b99db774d58dadfa2424bf449727cd1989bf9a06 --- /dev/null +++ b/data/mattergen/common/data/collate.py @@ -0,0 +1,423 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import warnings +from typing import Any, Callable, Iterable, Iterator, Sequence, TypeVar, overload + +from torch import Tensor +from torch_geometric.data import Batch, Data +from typing_extensions import TypeGuard + +warnings.filterwarnings( + "ignore", "TypedStorage is deprecated", module="torch_geometric" +) # Till https://github.com/pyg-team/pytorch_geometric/pull/7034 is released. + +__all__ = ["collate", "find_structure", "separate"] + +TreeTypes = Data | Batch | Tensor | int | float | str | bool | None +T = TypeVar("T", bound=TreeTypes) +PyTree = T | list["PyTree[T]"] | tuple["PyTree[T]", ...] | dict[Any, "PyTree[T]"] +IterPyTree = list[PyTree[T]] | tuple[PyTree[T], ...] | dict[Any, PyTree[T]] + + +@overload +def collate(x: PyTree[T]) -> T: + ... + + +@overload +def collate(x: PyTree[T], depth: int | None) -> PyTree[T]: + ... + + +def collate(x: PyTree[T], depth: int | None = None) -> T | PyTree[T]: + """Collate over the `depth` outermost layers of a `PyTree[Data]`, where `depth = None` collates + over the whole structure. + + The type `PyTree[T]` is defined recursively, in the following way:: + + PyTree[T] = Union[T, list[PyTree[T]], tuple[PyTree[T], ...], dict[Any, PyTree[T]]]] + + The following are examples of a `PyTree[int]`:: + + 1 + [1, 2] + [1, (2, 3)] + [(1, 2), (3, 4)] + [{"key": [1, 2]}, 3, (4, 5)] + [{"key": [1, 2]}, {"key": [3, 4]}, {"key": [5, 6]}] + + If every `Union` in a `PyTree` consists of one and only one element, then the `PyTree` is + called _consistent_. A consistent `PyTree[T]` can be decomposed into layers, where the first + layer is also referred to as the outermost layer and the last layer is referred to as the + innermost layer. This decomposition into layers is also defined recursively. + + If `list[U]` is a consistent `PyTree`, then the outermost/first layer of `list[U]` is `list`, + and the `n`th layer of `list[U]` is the `n - 1`th layer of `U`. Similarly, if `tuple[U, ...]` is + a consistent `PyTree`, then the outermost/first layer is `tuple` and the `n`th layer is the + `n - 1`th layer of `U`. Finally, if `dict[Any, U]` is a consistent `PyTree`, then the + outermost/first layer is `dict` and the `n`th layer is the `n - 1`th layer of `U`. + + For the above examples of a `PyTree[int]`:: + + # Consistent, but has no layers: + 1 + + # Consistent with one layer `list`: + [1, 2] + + # Inconsistent: + [1, (2, 3)] + + # Consistent with outermost layer `list` and innermost layer `tuple`: + [(1, 2), (3, 4)] + + # Inconsistent: + [{"key": [1, 2]}, 3, (4, 5)] + + # Consistent with outermost layer `list`, second layer `dict`, and innermost layer `list`: + [{"key": [1, 2]}, {"key": [3, 4]}, {"key": [5, 6]}] + + A few examples of how `collate` would work for various values of `depth`:: + + # Collate over everything: + collate(x: list[dict[str, tuple[Data, Data]]]) -> Data + + # Collate only over the outermost `list`: + collate(x: list[dict[str, tuple[Data, Data]]], depth=1) -> dict[str, tuple[Data, Data]] + + # Collate over the outermost layer `list` and the second layer `dict`: + collate(x: list[dict[str, tuple[Data, Data]]], depth=2) -> tuple[Data, Data] + + The inverse function of :func:`collate` is :func:`separate`. + + Args: + x (PyTree[Data]): The data structure to collate. + depth (int, optional): Number of outermost layers to collate over. If given, `x` must be + a consistent `PyTree`. If not given, `x` needs not to be consistent, and this function + will collate over the whole structure. + + Raises: + ValueError: If `x` is not a `PyTree`. Also raised if `depth` is specified but `x` is not a + consistent `PyTree`. + + Returns: + PyTree[T]: Collated structure. + """ + ys, structure, _ = _flatten(x, depth, 0) + return _merge(ys, structure) + + +def _flatten_iterable( + xs: Iterable[PyTree[T]], + depth: int | None, + offset: int, +) -> tuple[list[PyTree[T]], list[PyTree[int]], int]: + ys, ss = [], [] + for x in xs: + y, s, offset = _flatten(x, depth, offset) + ys.append(y) + ss.append(s) + return sum(ys, []), ss, offset + + +def iter_leaves(x: PyTree[T]) -> Iterator[T]: + """Iterate over the leaves of a `DataTree`. + + Args: + x (PyTree[T]): The data structure to iterate over. + + Yields: + T: The leaves of `x`. + """ + if isinstance(x, (list, tuple)): + for y in x: + yield from iter_leaves(y) + elif isinstance(x, dict): + for y in x.values(): + yield from iter_leaves(y) + else: + yield x + + +def len_tree(x: PyTree[T]) -> int: + """Number of nodes in a `PyTree`. + + Args: + x (PyTree[T]): The data structure to iterate over. + + Returns: + int: Number of nodes in `x`. + """ + total = 0 + if isinstance(x, (list, tuple)): + for y in x: + total += len_tree(y) + elif isinstance(x, dict): + for y in x.values(): + total += len_tree(y) + else: + total = 1 + return total + + +def _flatten( + xs: PyTree[T], + depth: int | None = None, + offset: int = 0, +) -> tuple[list[PyTree[T]], PyTree[int], int]: + depth = None if depth is None else depth - 1 + + if isinstance(xs, Data) or depth == -1: + return [xs], offset, offset + 1 + + if isinstance(xs, list): + ys, ss, offset = _flatten_iterable(xs, depth, offset) + return ys, list(ss), offset + + if isinstance(xs, tuple): + ys, ss, offset = _flatten_iterable(xs, depth, offset) + return ys, tuple(ss), offset + + if isinstance(xs, dict): + keys = sorted(xs.keys()) + ys, ss, offset = _flatten_iterable([xs[k] for k in keys], depth, offset) + return ys, {k: s for k, s in zip(keys, ss)}, offset + + raise ValueError(f"Cannot flatten item of type `{type(xs)}`.") + + +def is_list_seq(xs: Sequence[PyTree[T]]) -> TypeGuard[Sequence[list[PyTree[T]]]]: + """Check if a sequence of `PyTree`s is a sequence of lists of `PyTree`s.""" + return all(isinstance(x, list) for x in xs) + + +def is_data_seq(xs: Sequence[PyTree[T]]) -> TypeGuard[Sequence[Data]]: + """Check if a sequence of `PyTree`s is a sequence of Data objects.""" + return all(isinstance(x, Data) for x in xs) + + +def is_tuple_seq(xs: Sequence[PyTree[T]]) -> TypeGuard[Sequence[tuple[PyTree[T]]]]: + """Check if a sequence of `PyTree`s is a sequence of `tuple`s of `PyTree`s.""" + return all(isinstance(x, tuple) for x in xs) + + +def is_dict_seq(xs: Sequence[PyTree[T]]) -> TypeGuard[Sequence[dict[Any, PyTree[T]]]]: + """Check if a sequence of `PyTree`s is a sequence of `dict`s with `PyTree` values.""" + return all(isinstance(x, dict) for x in xs) + + +def _merge(xs: list[PyTree[T]], structure: PyTree[int]) -> PyTree[T]: + if len(xs) == 0: + raise ValueError("Cannot merge a sequence of length zero.") + + # Check for consistency. + types = set(type(x) for x in xs) + if len(types) != 1: + raise ValueError(f"`PyTree` is inconsistent. Found a mix of {len(types)} types: `{types}`.") + + if is_data_seq(xs): + # Intersection of attrs: + attrs = set( + xs[0].keys() if callable(xs[0].keys) else xs[0].keys + ) # pyg < 2.4.0 compatibility + for x in xs[1:]: + attrs.intersection_update( + x.keys() if callable(x.keys) else x.keys + ) # pyg < 2.4.0 compatibility + + # Filter attrs that are not in the intersection: + for x in xs: + for attr in list(x.keys() if callable(x.keys) else x.keys): # pyg < 2.4.0 compatibility + if attr not in attrs: + warnings.warn( + f"Attribute `{attr}` is not in the intersection of attributes of " + f"the collated `Data` objects. This attribute will be dropped." + ) + del x[attr] # type: ignore + + try: + batch = Batch.from_data_list(xs) + except Exception as e: + # Check if dtypes do not match: + for attr in attrs: + # Check types: + types = set(type(x[attr]) for x in xs) + if len(types) != 1: + raise ValueError( + f"Attribute `{attr}` has inconsistent types. Found a mix of " + f"{len(types)} types: `{types}`." + ) + + # Check dtypes + if isinstance(xs[0][attr], Tensor): + dtypes = set(x[attr].dtype for x in xs) + if len(dtypes) != 1: + raise ValueError( + f"Attribute `{attr}` has inconsistent dtypes. Found a mix of " + f"{len(dtypes)} dtypes: `{dtypes}`." + ) + + raise e + # Save the structure information as a hidden attribute. This is also what + # :func:`Batch.from_data_list` does. + batch._collate_structure = structure + return batch + + if is_list_seq(xs): + return [_merge(list(ys), structure) for ys in zip(*xs)] + + if is_tuple_seq(xs): + return tuple(_merge(list(ys), structure) for ys in zip(*xs)) + + if is_dict_seq(xs): + return {k: _merge([x[k] for x in xs], structure) for k in xs[0].keys()} + + raise ValueError(f"Cannot merge elements of type `{type(xs[0])}`.") + + +def separate( + x: PyTree[T], + structure: PyTree[int] | None = None, +) -> PyTree[T]: + """Inverse of :func:`collate`. This function guarantees that the following is true for every + value of `depth`:: + + separate(collate(x, depth)) == x + + Args: + x (PyTree[Data] or PyTree[Tensor]): Data structure which is structured like the output of + :func:`collate`. + structure (PyTree[int], optional): If `x` is a `PyTree[Data]`, then this argument can + be ignored (usually). If `x` is a `PyTree[Tensor]`, then :func:`separate` needs to be + told how the result should be separated into the original `PyTree`. In this case, you + should run :func:`find_structure` on the output of :func:`collate` and pass the result + as this argument. + + Raises: + RuntimeError: If :func:`separate` cannot automatically infer how to separate `x`. + ValueError: If `x` is not a `PyTree[Data]` or `PyTree[Tensor]`. + + Returns: + PyTree[Data] or PyTree[Tensor]: `x` separated into the `PyTree` originally given to + :func:`collate`. + """ + if structure is None: + structure = find_structure(x) + return _separate(x, structure) + + +def tree_map( + func: Callable[..., T], + x: PyTree[T], + *x2: PyTree[T], +) -> PyTree[T]: + """Apply `func` to every leaf in `x`. + + Args: + x (PyTree[T]): `PyTree`s to map over. + *x2 (PyTree[Any]): additional matching `PyTree`s possibly of different type to map over. + func (function): Function to apply. + + Returns: + PyTree[T]: `x`, but with `func` applied to every leaf. + """ + + # Nested function to prevent recursively defining of generic T. + def _map(x: PyTree[T], *x2: PyTree) -> PyTree[T]: + if isinstance(x, list): + assert is_list_seq(x2), "All `PyTree`s must of the same form, but they are not." + return [_map(*y) for y in zip(x, *x2)] + elif isinstance(x, tuple): + assert is_tuple_seq(x2), "All `PyTree`s must of the same form, but they are not." + return tuple(_map(*y) for y in zip(x, *x2)) + elif isinstance(x, dict): + assert is_dict_seq(x2), "All `PyTree`s must of the same form, but they are not." + # Check if all keys match + if any( + any(k[0] != k2_k for k2_k in k[1:]) + for k in zip(x.keys(), *map(lambda a: a.keys(), x2)) + ): + raise ValueError("Cannot merge dictionaries with different keys.") + return { + y[0]: _map(y[1], *y[2:]) + for y in zip(x.keys(), x.values(), *map(lambda a: a.values(), x2)) + } + else: + return func(x, *x2) + + return _map(x, *x2) + + +def find_structure(x: PyTree[T]) -> IterPyTree[int]: + """Find the information necessary to structure something back into the original `PyTree` given + to :func:`collate`. The output of this function can be given as the second argument to + :func:`separate`. + + Args: + x (PyTree[Data] or PyTree[Tensor]): Collated data structure. This is usually the output of + :func:`collate`. + + Raises: + RuntimeError: If `x` does not contain the necessary structure information. + + Returns: + PyTree[int]: Structure information. + """ + if isinstance(x, Data): + if not hasattr(x, "_collate_structure"): + raise RuntimeError( + "The attribute `_collate_structure` is necessary to separate the collated batch, " + "but this attribute cannot be found. It might have been lost along the way. " + "You can use `find_structure` to extract the structure information directly from " + "the output of `collate` and then pass this to `separate` as the second argument." + ) + return x._collate_structure + + if isinstance(x, (list, tuple)): + return find_structure(x[0]) + + if isinstance(x, dict): + return find_structure(list(x.values())[0]) + + raise RuntimeError( + "The structure information necessary to separate the collated batch is not contained in " + "the input. " + "You can use `find_structure` to extract the structure information directly from " + "the output of `collate` and then pass this to `separate` as the second argument." + ) + + +def _separate(x: PyTree[T], structure: PyTree[int]) -> PyTree[T]: + if isinstance(structure, int): + return _get_i(x, structure) + + if isinstance(structure, list): + return [_separate(x, s) for s in structure] + + if isinstance(structure, tuple): + return tuple(_separate(x, s) for s in structure) + + if isinstance(structure, dict): + return {k: _separate(x, v) for k, v in structure.items()} + + raise ValueError(f"Cannot reconstruct object of type `{type(structure)}`.") + + +def _get_i(xs: PyTree[T], i: int) -> PyTree[T]: + if isinstance(xs, Data): + return xs.get_example(i) + + if isinstance(xs, Tensor): + return xs[i] # type: ignore # mypy does not understand that this is a Tensor. + + if isinstance(xs, list): + return list(_get_i(x, i) for x in xs) + + if isinstance(xs, tuple): + return tuple(_get_i(x, i) for x in xs) + + if isinstance(xs, dict): + return {k: _get_i(v, i) for k, v in xs.items()} + + raise ValueError(f"Cannot get example for `{type(xs)}`.") diff --git a/data/mattergen/common/data/condition_factory.py b/data/mattergen/common/data/condition_factory.py new file mode 100644 index 0000000000000000000000000000000000000000..13aecb073067ad92c8793b6090e0db5bc4d7f3f1 --- /dev/null +++ b/data/mattergen/common/data/condition_factory.py @@ -0,0 +1,95 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from functools import partial +from typing import Callable, Iterable, Sequence + +import torch +from torch.utils.data import DataLoader, Dataset + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.data.collate import collate +from mattergen.common.data.dataset import NumAtomsCrystalDataset +from mattergen.common.data.num_atoms_distribution import NUM_ATOMS_DISTRIBUTIONS +from mattergen.common.data.transform import SetProperty, Transform +from mattergen.common.data.types import TargetProperty +from mattergen.common.utils.data_utils import create_chem_graph_from_composition +from mattergen.diffusion.data.batched_data import BatchedData + +ConditionLoader = Iterable[tuple[BatchedData, dict[str, torch.Tensor]] | None] + + +def _collate_fn( + batch: Sequence[ChemGraph], + collate_fn: Callable[[Sequence[ChemGraph]], BatchedData], +) -> tuple[BatchedData, None]: + return collate_fn(batch), None + + +def get_number_of_atoms_condition_loader( + num_atoms_distribution: str, + num_samples: int, + batch_size: int, + shuffle: bool = True, + transforms: list[Transform] | None = None, + properties: TargetProperty | None = None, +) -> ConditionLoader: + transforms = transforms or [] + if properties is not None: + for k, v in properties.items(): + transforms.append(SetProperty(k, v)) + assert ( + num_atoms_distribution in NUM_ATOMS_DISTRIBUTIONS + ), f"Invalid num_atoms_distribution: {num_atoms_distribution}" + dataset = NumAtomsCrystalDataset.from_num_atoms_distribution( + num_atoms_distribution=NUM_ATOMS_DISTRIBUTIONS[num_atoms_distribution], + num_samples=num_samples, + transforms=transforms, + ) + return DataLoader( + dataset, + batch_size=batch_size, + collate_fn=partial(_collate_fn, collate_fn=collate), + shuffle=shuffle, + ) + + +def get_composition_data_loader( + target_compositions_dict: list[dict[str, float]], + num_structures_to_generate_per_composition: int, + batch_size: int, +) -> ConditionLoader: + """ + Given a list of target compositions, generate a dataset of chemgraphs + where each chemgraph contains atoms corresponding to the target composition + without positions or cell information. + Returns a torch dataloader equipped with the correct collate function containing such dataset. + """ + + dataset_ = [] + for compostion in target_compositions_dict: + chemgraphs = [ + create_chem_graph_from_composition(compostion) + ] * num_structures_to_generate_per_composition + dataset_.extend(chemgraphs) + + dataset = ChemGraphlistDataset(dataset_) + + return DataLoader( + dataset, + batch_size=batch_size, + collate_fn=partial(_collate_fn, collate_fn=collate), + shuffle=False, + ) + + +class ChemGraphlistDataset(Dataset): + def __init__(self, data: list[ChemGraph]) -> None: + super().__init__() + self.data = data + + def __len__(self) -> int: + return len(self.data) + + def __getitem__(self, index: int) -> ChemGraph: + return self.data[index] diff --git a/data/mattergen/common/data/datamodule.py b/data/mattergen/common/data/datamodule.py new file mode 100644 index 0000000000000000000000000000000000000000..ecf81352015f762e7f6edd9a1b47903efa577ae2 --- /dev/null +++ b/data/mattergen/common/data/datamodule.py @@ -0,0 +1,97 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import random + +import numpy as np +import pytorch_lightning as pl +import torch +from omegaconf import DictConfig +from torch.utils.data import DataLoader + +from mattergen.common.data.collate import collate +from mattergen.common.data.dataset import CrystalDataset + + +def worker_init_fn(id: int): + """ + DataLoaders workers init function. + + Initialize the numpy.random seed correctly for each worker, so that + random augmentations between workers and/or epochs are not identical. + + If a global seed is set, the augmentations are deterministic. + + https://pytorch.org/docs/stable/notes/randomness.html#dataloader + """ + uint64_seed = torch.initial_seed() + ss = np.random.SeedSequence([uint64_seed]) + # More than 128 bits (4 32-bit words) would be overkill. + np.random.seed(ss.generate_state(4)) + random.seed(uint64_seed) + + +class CrystDataModule(pl.LightningDataModule): + def __init__( + self, + train_dataset: CrystalDataset, + num_workers: DictConfig, + batch_size: DictConfig, + val_dataset: CrystalDataset | None = None, + test_dataset: CrystalDataset | None = None, + **_, + ): + super().__init__() + self.num_workers = num_workers + self.batch_size = batch_size + + self.train_dataset = train_dataset + self.val_dataset = val_dataset + self.test_dataset = test_dataset + self.datasets = [train_dataset, val_dataset, test_dataset] + + def train_dataloader(self, shuffle: bool = True) -> DataLoader: + return DataLoader( + self.train_dataset, + shuffle=shuffle, + batch_size=self.batch_size.train, + num_workers=self.num_workers.train, + worker_init_fn=worker_init_fn, + collate_fn=collate, + ) + + def val_dataloader(self, shuffle: bool = False) -> DataLoader | None: + return ( + DataLoader( + self.val_dataset, + shuffle=shuffle, + batch_size=self.batch_size.val, + num_workers=self.num_workers.val, + worker_init_fn=worker_init_fn, + collate_fn=collate, + ) + if self.val_dataset is not None + else None + ) + + def test_dataloader(self, shuffle: bool = False) -> DataLoader | None: + return ( + DataLoader( + self.test_dataset, + shuffle=shuffle, + batch_size=self.batch_size.test, + num_workers=self.num_workers.test, + worker_init_fn=worker_init_fn, + collate_fn=collate, + ) + if self.test_dataset is not None + else None + ) + + def __repr__(self) -> str: + return ( + f"{self.__class__.__name__}(" + f"{self.datasets=}, " + f"{self.num_workers=}, " + f"{self.batch_size=})" + ) diff --git a/data/mattergen/common/data/dataset.py b/data/mattergen/common/data/dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..812c4f21ab0d646fe6a44e3b1bcf7c9523d4b025 --- /dev/null +++ b/data/mattergen/common/data/dataset.py @@ -0,0 +1,594 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import os +from collections import defaultdict +from dataclasses import dataclass, field +from functools import cached_property, lru_cache +from typing import Iterable, Protocol, Sequence, Type, TypeVar + +import numpy as np +import numpy.typing +import pandas as pd +import torch +from pymatgen.core import Structure +from pymatgen.io.cif import CifParser +from pymatgen.symmetry.groups import SpaceGroup +from torch.utils.data import Dataset +from tqdm.auto import tqdm + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.data.transform import Transform +from mattergen.common.data.types import PropertySourceId, PropertyValues +from mattergen.common.globals import PROJECT_ROOT +from mattergen.common.utils.globals import PROPERTY_SOURCE_IDS + +CORE_STRUCTURE_FILE_NAMES = { + "pos": "pos.npy", + "cell": "cell.npy", + "atomic_numbers": "atomic_numbers.npy", + "num_atoms": "num_atoms.npy", + "structure_id": "structure_id.npy", +} + +T = TypeVar("T", bound="BaseDataset") + + +class DatasetTransform(Protocol): + def __call__(self, dataset: "BaseDataset") -> "BaseDataset": ... + + +@lru_cache +def space_group_number_for_symbol(symbol: str) -> int: + return SpaceGroup(symbol).int_number + + +@dataclass(frozen=True) +class BaseDataset(Dataset): + properties: dict[PropertySourceId, numpy.typing.NDArray] + + def __getitem__(self, index: int) -> ChemGraph: + raise NotImplementedError + + def __len__(self) -> int: + raise NotImplementedError + + def get_properties_dict(self, index: int) -> dict[PropertySourceId, torch.Tensor]: + props_dict: dict[PropertySourceId, torch.Tensor] = {} + for prop in self.properties.keys(): + if prop == "chemical_system": + # chemical system is set via a data transform + continue + val = self.properties[prop][index] + if prop == "space_group": + val = space_group_number_for_symbol(val) + props_dict[prop] = ( + torch.from_numpy(val) if isinstance(val, np.ndarray) else torch.tensor(val) + ) + if props_dict[prop].dtype == torch.double: + props_dict[prop] = props_dict[prop].float() + return props_dict + + @classmethod + def from_dataset_name( + cls: Type[T], + dataset_name: str, + split: str, + transforms: list[Transform] | None = None, + properties: list[PropertySourceId] | None = None, + dataset_transforms: list[DatasetTransform] | None = None, + ): + """ + Load a dataset using a dataset name and split. We assume the dataset is stored in the + datasets folder in the project root. + """ + return CrystalDatasetBuilder.from_dataset_name( + dataset_name=dataset_name, + split=split, + transforms=transforms, + properties=properties, + ).build(cls, dataset_transforms=dataset_transforms) + + @classmethod + def from_cache_path( + cls: Type[T], + cache_path: str, + transforms: list[Transform] | None = None, + properties: list[PropertySourceId] | None = None, + dataset_transforms: list[DatasetTransform] | None = None, + ) -> T: + """ + Load a dataset from a specified cache path. + + Args: + name: Name of the reference dataset. + transforms: List of transforms to apply to **each datapoint** when loading, e.g., to make the lattice matrices symmetric. + properties: List of properties to condition on. + dataset_transforms: List of transforms to apply to the **whole dataset**, e.g., to filter out certain entries. + + Returns: + The dataset. + """ + return CrystalDatasetBuilder.from_cache_path( + cache_path=cache_path, + transforms=transforms, + properties=properties, + ).build(cls, dataset_transforms=dataset_transforms) + + def subset(self, indices: Sequence[int]) -> "BaseDataset": + """ + Create a subset of the dataset with the given indices. + """ + raise NotImplementedError + + def repeat(self, repeats: int) -> "BaseDataset": + """ + Repeat the dataset a number of times. + """ + raise NotImplementedError + + +def repeat_along_first_axis( + input_array: numpy.typing.NDArray, repeats: int +) -> numpy.typing.NDArray: + # np.tile by default repeats along the last axis. So we need to pass a tuple + # with the number of repeats for each axis, e.g., (repeats, 1, 1) for the cell. + return np.tile(input_array, (repeats,) + tuple(np.ones(input_array.ndim - 1, dtype=int))) + + +@dataclass(frozen=True, kw_only=True) +class CrystalDataset(BaseDataset): + """ + Dataset for crystal structures. Takes as input numpy arrays for positions, cell, atomic numbers, + number of atoms and structure id. Optionally, properties can be added as well, as a dictionary + of numpy arrays. The dataset can also be transformed using a list of transforms. + The recommended way of creating a CrystalDataset is to use the class method + CrystalDataset.from_preset with a preset name, which will use the CrystalDatasetBuilder class to + fetch the dataset from cache if it exists, and otherwise cache it. + """ + + pos: numpy.typing.NDArray + cell: numpy.typing.NDArray + atomic_numbers: numpy.typing.NDArray + num_atoms: numpy.typing.NDArray + structure_id: numpy.typing.NDArray + properties: dict[PropertySourceId, numpy.typing.NDArray] = field(default_factory=dict) + transforms: list[Transform] | None = None + + def __post_init__(self): + property_names = list(self.properties.keys()) + assert all([s in PROPERTY_SOURCE_IDS for s in property_names]), ( + f"Property names {property_names} are not valid. " + f"Valid property source names: {PROPERTY_SOURCE_IDS}" + ) + + @classmethod + def from_csv( + cls, + csv_path: str, + cache_path: str, + transforms: list[Transform] | None = None, + ): + return CrystalDatasetBuilder.from_csv( + csv_path=csv_path, + cache_path=cache_path, + transforms=transforms, + ).build(cls) + + @cached_property + def index_offset(self): + """ + Returns an array of indices that can be used to offset the indices of the atoms. + That is, for structure index <ix>, the atoms are located at indices + <index_offset[ix]:index_offset[ix]+num_atoms[ix]> in the pos and atomic_numbers arrays. + """ + return np.concatenate([np.array([0]), np.cumsum(self.num_atoms[:-1])]) + + def __getitem__(self, index: int) -> ChemGraph: + pos_offset = self.index_offset[index] + num_atoms = torch.tensor(self.num_atoms[index]) + + props_dict = self.get_properties_dict(index) + data = ChemGraph( + pos=torch.from_numpy(self.pos[pos_offset : pos_offset + num_atoms]).float() % 1.0, + cell=torch.from_numpy(self.cell[index]).float().unsqueeze(0), + atomic_numbers=torch.from_numpy( + self.atomic_numbers[pos_offset : pos_offset + num_atoms] + ), + num_atoms=num_atoms, + num_nodes=num_atoms, # special attribute used for batching in pytorch geometric + # mypy does not like string literals as kwargs, see https://github.com/python/mypy/pull/10237 + **props_dict, # type: ignore + ) + + if self.transforms is not None: + for t in self.transforms: + data = t(data) + return data + + def __len__(self) -> int: + return len(self.num_atoms) + + def subset(self, indices: Sequence[int]) -> "CrystalDataset": + batch_indices: list[int] = [] + for index in indices: + pos_offset = self.index_offset[index] + batch_indices.extend(range(pos_offset, pos_offset + self.num_atoms[index])) + + return CrystalDataset( + pos=self.pos[batch_indices], + cell=self.cell[indices], + atomic_numbers=self.atomic_numbers[batch_indices], + num_atoms=self.num_atoms[indices], + structure_id=self.structure_id[indices], + properties={k: v[indices] for k, v in self.properties.items()}, + transforms=self.transforms, + ) + + def repeat(self, repeats: int) -> "CrystalDataset": + """ + Repeat the dataset a number of times. + """ + + pos = repeat_along_first_axis(self.pos, repeats) + cell = repeat_along_first_axis(self.cell, repeats) + atomic_numbers = repeat_along_first_axis(self.atomic_numbers, repeats) + num_atoms = repeat_along_first_axis(self.num_atoms, repeats) + structure_id = repeat_along_first_axis(self.structure_id, repeats) + properties = {k: repeat_along_first_axis(v, repeats) for k, v in self.properties.items()} + return CrystalDataset( + pos=pos, + cell=cell, + atomic_numbers=atomic_numbers, + num_atoms=num_atoms, + structure_id=structure_id, + properties=properties, + transforms=self.transforms, + ) + + +@dataclass(frozen=True, kw_only=True) +class NumAtomsCrystalDataset(BaseDataset): + """ + A dataset class for crystal structures where the number of atoms is the only property. Optionally, + other properties can be added as well, as a dictionary of numpy arrays. + This is useful for sampling, where only need to condition on the number of atoms in the structure. + Positions and cell are filled with NaNs, and the atomic numbers are filled with -1 for ChemGraphs + that are created from this dataset. + """ + + num_atoms: numpy.typing.NDArray + structure_id: numpy.typing.NDArray | None = None + properties: dict[PropertySourceId, numpy.typing.NDArray] = field(default_factory=dict) + transforms: list[Transform] | None = None + + def __getitem__(self, index: int) -> ChemGraph: + num_atoms = torch.tensor(self.num_atoms[index]) + + props_dict = self.get_properties_dict(index) + data = ChemGraph( + pos=torch.full((num_atoms, 3), fill_value=torch.nan, dtype=torch.float), + cell=torch.full((1, 3, 3), fill_value=torch.nan, dtype=torch.float), + atomic_numbers=torch.full((num_atoms,), fill_value=-1, dtype=torch.long), + num_atoms=num_atoms, + num_nodes=num_atoms, # special attribute used for batching in pytorch geometric + # mypy does not like string literals as kwargs, see https://github.com/python/mypy/pull/10237 + **props_dict, # type: ignore + ) + + if self.transforms is not None: + for t in self.transforms: + data = t(data) + return data + + def __len__(self) -> int: + return len(self.num_atoms) + + def subset(self, indices: Sequence[int]) -> "NumAtomsCrystalDataset": + return NumAtomsCrystalDataset( + num_atoms=self.num_atoms[indices], + structure_id=self.structure_id[indices] if self.structure_id is not None else None, + properties={k: v[indices] for k, v in self.properties.items()}, + transforms=self.transforms, + ) + + def repeat(self, repeats: int) -> "NumAtomsCrystalDataset": + """ + Repeat the dataset a number of times. + """ + num_atoms = repeat_along_first_axis(self.num_atoms, repeats) + structure_id = repeat_along_first_axis(self.structure_id, repeats) + properties = {k: repeat_along_first_axis(v, repeats) for k, v in self.properties.items()} + return NumAtomsCrystalDataset( + num_atoms=num_atoms, + structure_id=structure_id, + properties=properties, + transforms=self.transforms, + ) + + @classmethod + def from_num_atoms_distribution( + cls: Type[T], + num_atoms_distribution: dict[int, float], + num_samples: int, + transforms: list[Transform] | None = None, + ) -> T: + """ + Construct a NumAtomsCrystalDataset from a distribution over number of atoms. + + Args: + num_atoms_distribution: A dictionary with the number of atoms as keys and the probability of that number of atoms as values. + transforms: List of transforms to apply to **each datapoint** when loading, e.g., to make the lattice matrices symmetric. + properties: List of properties to condition on. + dataset_transforms: List of transforms to apply to the **whole dataset**, e.g., to filter out certain entries. + + Returns: + The dataset. + """ + + return NumAtomsCrystalDataset( + num_atoms=np.random.choice( + list(num_atoms_distribution.keys()), + size=num_samples, + p=list(num_atoms_distribution.values()), + ), + transforms=transforms, + ) + + +def structures_to_numpy( + structures: Iterable[Structure], +) -> tuple[dict[str, numpy.typing.NDArray], dict[PropertySourceId, numpy.typing.NDArray]]: + """ + Convert a list of Structures to numpy arrays for positions, cell, atomic numbers, + number of atoms and structure id. Returns a dictionary with the numpy arrays. + """ + structure_infos: dict[str, list[numpy.typing.NDArray]] = { + "pos": [], + "cell": [], + "atomic_numbers": [], + "num_atoms": [], + "structure_id": [], + } + properties = defaultdict(list) + for structure in tqdm(structures, desc="Converting structures to numpy", miniters=5000): + # get primitive structure + # here, structure.properties is not passed to struct if it is not a primitive structure, + # so we keep the structure object to pass material_id below + struct = structure.get_primitive_structure() + # niggli reduction + struct = struct.get_reduced_structure() + + structure_infos["pos"].append(struct.frac_coords) + structure_infos["cell"].append(struct.lattice.matrix) + structure_infos["atomic_numbers"].append(struct.atomic_numbers) + structure_infos["num_atoms"].append(len(struct)) + structure_infos["structure_id"].append(structure.properties["material_id"]) + for prop, prop_val in structure.properties.items(): + if prop in PROPERTY_SOURCE_IDS: + properties[prop].append(prop_val) + structure_infos["pos"] = np.row_stack(structure_infos["pos"]) + structure_infos["cell"] = np.array(structure_infos["cell"]) + structure_infos["atomic_numbers"] = np.concatenate(structure_infos["atomic_numbers"]) + structure_infos["num_atoms"] = np.array(structure_infos["num_atoms"]) + structure_infos["structure_id"] = np.array(structure_infos["structure_id"]) + for prop in properties: + properties[prop] = np.array(properties[prop]) + assert len(properties[prop]) == len(structure_infos["structure_id"]) + return structure_infos, properties + + +class CrystalDatasetBuilder: + """ + Class for building CrystalDatasets. The builder handles the caching of the numpy arrays and + properties, and can be used to add new properties to the cache. + + The most common way to use the CrystalDatasetBuilder is to use the from_preset method, which + only requires the name of the reference dataset. The builder will then check if the dataset is + already cached, and if not, cache it. The builder can also be used to add new properties to the + cache. + """ + + def __init__( + self, + cache_path: str, + transforms: list[Transform] | None = None, + properties: list[PropertySourceId] | None = None, + ): + self.cache_path = cache_path + self.transforms = transforms + self.property_names = properties or [] + assert all([s in PROPERTY_SOURCE_IDS for s in self.property_names]), ( + f"Property names {self.property_names} are not valid. " + f"Valid property source names: {PROPERTY_SOURCE_IDS}" + ) + + def _load_file(self, filename: str) -> numpy.typing.NDArray: + return np.load(f"{self.cache_path}/{filename}") + + @cached_property + def pos(self): + return self._load_file(CORE_STRUCTURE_FILE_NAMES["pos"]) + + @cached_property + def cell(self): + return self._load_file(CORE_STRUCTURE_FILE_NAMES["cell"]) + + @cached_property + def atomic_numbers(self): + return self._load_file(CORE_STRUCTURE_FILE_NAMES["atomic_numbers"]) + + @cached_property + def num_atoms(self): + return self._load_file(CORE_STRUCTURE_FILE_NAMES["num_atoms"]) + + @cached_property + def structure_id(self): + return self._load_file(CORE_STRUCTURE_FILE_NAMES["structure_id"]) + + @property + def properties(self) -> dict[PropertySourceId, numpy.typing.NDArray]: + properties: dict[PropertySourceId, numpy.typing.NDArray] = {} + prop_names = self.property_names + for prop_name in prop_names: + if not os.path.exists(f"{self.cache_path}/{prop_name}.json"): + raise FileNotFoundError( + f"{prop_name}.json does not exist in {self.cache_path}.\n" + f"Available properties: {self.list_available_properties()}" + ) + properties[prop_name] = PropertyValues.from_json( + f"{self.cache_path}/{prop_name}.json" + ).values + assert len(properties[prop_name]) == len(self.structure_id) + return properties + + def build( + self, + dataset_class: Type[T] = CrystalDataset, + dataset_transforms: list[DatasetTransform] | None = None, + ) -> T: + """ + Build a dataset from the cached numpy arrays and properties. The dataset class can be + either CrystalDataset, CrystalStructurePredictionSamplingDataset, or NumAtomsCrystalDataset. + + Args: + dataset_class: The class of the dataset to build. + dataset_transforms: List of transforms to apply to the dataset. + """ + if dataset_class == CrystalDataset: + dataset = self._build_full_dataset() + elif dataset_class == NumAtomsCrystalDataset: + dataset = self._build_num_atoms() + else: + raise ValueError(f"Unknown dataset class {dataset_class}.") + dataset_transforms = dataset_transforms or [] + for t in dataset_transforms: + dataset = t(dataset) + return dataset + + def _build_full_dataset(self) -> CrystalDataset: + """ + Build a CrystalDataset from the cached numpy arrays and properties. + """ + + dataset = CrystalDataset( + pos=self.pos, + cell=self.cell, + atomic_numbers=self.atomic_numbers, + num_atoms=self.num_atoms, + structure_id=self.structure_id, + properties=self.properties, + transforms=self.transforms, + ) + return dataset + + def _build_num_atoms(self) -> NumAtomsCrystalDataset: + """ + Build a NumAtomsCrystalDataset from the cached numpy arrays and properties. + """ + + dataset = NumAtomsCrystalDataset( + num_atoms=self.num_atoms, + structure_id=self.structure_id, + properties=self.properties, + transforms=self.transforms, + ) + return dataset + + @classmethod + def from_dataset_name( + cls, + dataset_name: str, + split: str, + transforms: list[Transform] | None = None, + properties: list[PropertySourceId] | None = None, + ): + return cls.from_cache_path( + f"{PROJECT_ROOT}/datasets/{dataset_name}/{split}", transforms, properties + ) + + @classmethod + def from_cache_path( + cls, + cache_path: str, + transforms: list[Transform] | None = None, + properties: list[PropertySourceId] | None = None, + ) -> "CrystalDatasetBuilder": + """ + Create a CrystalDatasetBuilder from a path that contains cache for the dataset. + """ + + return cls( + cache_path=cache_path, + transforms=transforms, + properties=properties, + ) + + @classmethod + def from_csv(cls, csv_path: str, cache_path: str, transforms: list[Transform] | None = None): + df = pd.read_csv(csv_path) + + structures = [ + CifParser.from_str(s).parse_structures(primitive=True, on_error="ignore")[0] + for s in tqdm(df["cif"], desc="Parsing CIFs", miniters=5000) + ] + for ix, material_id in enumerate(df["material_id"]): + structures[ix].properties["material_id"] = material_id + for prop in df.columns: + if prop in PROPERTY_SOURCE_IDS: + structures[ix].properties[prop] = df[prop][ix] + structure_infos, properties = structures_to_numpy(structures) + + os.makedirs(cache_path, exist_ok=True) + print(f"Storing cached dataset in {cache_path}.") + for k, filename in CORE_STRUCTURE_FILE_NAMES.items(): + np.save(f"{cache_path}/{filename}", structure_infos[k]) + for prop in properties: + PropertyValues( + values=properties[prop], + property_source_doc_id=prop, + ).to_json(f"{cache_path}/{prop}.json") + + return cls( + cache_path=cache_path, + transforms=transforms, + properties=list(properties.keys()), + ) + + def list_available_properties(self) -> list[PropertySourceId]: + """ + List the properties that are available in the cache. + """ + return [ + prop.split(".json")[0] for prop in os.listdir(self.cache_path) if prop.endswith(".json") + ] + + def add_property_to_cache( + self, + property_name: PropertySourceId, + data: dict[str, numpy.typing.NDArray], + ): + """ + Add a new property to the cache. The property will be stored in the blob storage and added + to the properties of the dataset. + + The data should be a dictionary with the structure id as keys and the property values as + values. The properties can be sparse, i.e. some structures can be missing the property. + These properties will be set to NaN in the dataset. + """ + assert ( + property_name not in self.property_names + ), f"Property {property_name} already exists in properties" + property_values_linearized = np.array( + [data.get(structure_id, np.nan) for structure_id in self.structure_id] + ) + property_values = PropertyValues( + values=property_values_linearized, + property_source_doc_id=property_name, + ) + assert property_values.n_entries == len(self.structure_id), ( + f"Property {property_name} has {property_values.n_entries} entries, " + f"but the dataset has {len(self.structure_id)} structures." + ) + property_values.to_json(self.cache_path + "/" + f"{property_name}.json") + self.property_names.append(property_name) diff --git a/data/mattergen/common/data/dataset_transform.py b/data/mattergen/common/data/dataset_transform.py new file mode 100644 index 0000000000000000000000000000000000000000..46620cb049f2ba337dfe7c4063e4d02008ca267a --- /dev/null +++ b/data/mattergen/common/data/dataset_transform.py @@ -0,0 +1,35 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import numpy as np +from numpy.typing import NDArray +from mattergen.common.data.dataset import BaseDataset + +# Dataset transforms +# These transforms are used to modify the dataset in various ways, such as filtering out +# structures with missing properties. + +def is_nan(value: NDArray) -> NDArray: + if value.dtype.kind == "U": + # str dtype, e.g., space group + return np.zeros(value.shape, dtype=bool) + return np.isnan(value) + +def filter_sparse_properties(dataset: BaseDataset) -> BaseDataset: + """ + Filter out structures with missing properties. + Returns a new dataset with only structures that have all properties. + """ + if len(dataset.properties) == 0: + return dataset + indices_with_all_properties = np.where( + np.all([~is_nan(val) for val in dataset.properties.values()], axis=0) + )[0] + return dataset.subset(indices=indices_with_all_properties) + + +def repeat(dataset: BaseDataset, n: int) -> BaseDataset: + """ + Repeat the dataset n times. + """ + return dataset.repeat(n) diff --git a/data/mattergen/common/data/num_atoms_distribution.py b/data/mattergen/common/data/num_atoms_distribution.py new file mode 100644 index 0000000000000000000000000000000000000000..b8a00c13fad8fb2b6a3617727963aa41e4002e8d --- /dev/null +++ b/data/mattergen/common/data/num_atoms_distribution.py @@ -0,0 +1,27 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +NUM_ATOMS_DISTRIBUTIONS = { + "ALEX_MP_20": { + 1: 0.0002303828963737732, + 2: 0.002804088967292211, + 3: 0.019342289742695216, + 4: 0.1636343889258233, + 5: 0.04668051158167732, + 6: 0.07808005476530565, + 7: 0.027247714272549548, + 8: 0.1150400537121267, + 9: 0.048984340545415055, + 10: 0.12620539622566992, + 11: 0.03577352703049611, + 12: 0.14591300741832927, + 13: 0.0060031200426537475, + 14: 0.028628366058675234, + 15: 0.02022761830161729, + 16: 0.04473213051520198, + 17: 0.0013033089566287742, + 18: 0.038699389814443035, + 19: 0.0070135136024644384, + 20: 0.04345679662456145, + } +} diff --git a/data/mattergen/common/data/transform.py b/data/mattergen/common/data/transform.py new file mode 100644 index 0000000000000000000000000000000000000000..765731788a0dcb7a83149b8fa2def701e2039c72 --- /dev/null +++ b/data/mattergen/common/data/transform.py @@ -0,0 +1,54 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Protocol, Sequence + +import torch +from pymatgen.core import Composition + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.utils.data_utils import ( + compute_lattice_polar_decomposition, + get_element_symbol, +) +from mattergen.common.utils.globals import MAX_ATOMIC_NUM + + +class Transform(Protocol): + def __call__(self, sample: ChemGraph) -> ChemGraph: + ... + + +def symmetrize_lattice(sample: ChemGraph) -> ChemGraph: + return sample.replace(cell=compute_lattice_polar_decomposition(sample.cell)) + + +def set_chemical_system(sample: ChemGraph) -> ChemGraph: + chemsys = ( + torch.eye(MAX_ATOMIC_NUM + 1, device=sample.atomic_numbers.device)[ + sample.atomic_numbers + ].sum(0) + > 0 + ).float()[None] + return sample.replace(chemical_system=chemsys) + + +def set_chemical_system_string(sample: ChemGraph) -> ChemGraph: + return sample.replace( + chemical_system=Composition( + {get_element_symbol(Z=i.item()): 1 for i in sample.atomic_numbers} + ).chemical_system + ) + + +class SetProperty: + def __init__(self, property_name: str, value: float | Sequence[str]): + self.property_name = property_name + self.value = ( + torch.tensor(value, dtype=torch.float) + if isinstance(value, float) or isinstance(value, int) + else value + ) + + def __call__(self, sample: ChemGraph) -> ChemGraph: + return sample.replace(**{self.property_name: self.value}) diff --git a/data/mattergen/common/data/types.py b/data/mattergen/common/data/types.py new file mode 100644 index 0000000000000000000000000000000000000000..b1ca1bea4322412c9247b073575a547550e151ae --- /dev/null +++ b/data/mattergen/common/data/types.py @@ -0,0 +1,52 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import json +from dataclasses import dataclass +from typing import Sequence + +import numpy as np +from emmet.core.material import PropertyOrigin + +from mattergen.common.utils.globals import PROPERTY_SOURCE_IDS + +PropertySourceId = str +TargetProperty = dict[PropertySourceId, int | float | Sequence[str]] + + +@dataclass(frozen=True) +class PropertyValues: + "A class for storing the values of a property" + values: np.ndarray + property_source_doc_id: PropertySourceId + origins: list[PropertyOrigin] | None = ( + None # Dictionary for tracking the provenance of properties, emmet-style. + ) + + def __post_init__(self): + assert self.property_source_doc_id in PROPERTY_SOURCE_IDS, ( + f"property_source_doc_id {self.property_source_doc_id} not found in the database. " + f"Available property_source_doc_ids: {PROPERTY_SOURCE_IDS}" + ) + + @property + def n_entries(self) -> int: + return self.values.shape[0] + + def to_json(self, filename): + with open(filename, "w") as f: + json.dump( + { + "values": self.values.tolist(), + "property_source_doc_id": self.property_source_doc_id, + "origins": self.origins, + }, + f, + ) + + @classmethod + def from_json(cls, filename): + with open(filename, "r") as f: + data = json.load(f) + data["values"] = np.array(data["values"]) + return cls(**data) diff --git a/data/mattergen/common/diffusion/__init__.py b/data/mattergen/common/diffusion/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/common/diffusion/corruption.py b/data/mattergen/common/diffusion/corruption.py new file mode 100644 index 0000000000000000000000000000000000000000..654404b48788697fc38d8a9c483b7a7e6f87ff37 --- /dev/null +++ b/data/mattergen/common/diffusion/corruption.py @@ -0,0 +1,284 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import torch +from omegaconf import DictConfig + +from mattergen.diffusion.corruption.corruption import B, BatchedData, maybe_expand +from mattergen.diffusion.corruption.sde_lib import SDE as DiffSDE +from mattergen.diffusion.corruption.sde_lib import VESDE as DiffVESDE +from mattergen.diffusion.corruption.sde_lib import VPSDE +from mattergen.diffusion.wrapped.wrapped_sde import WrappedVESDE + + +def expand(a, x_shape, left=False): + a_dim = len(a.shape) + if left: + return a.reshape(*(((1,) * (len(x_shape) - a_dim)) + a.shape)) + else: + return a.reshape(*(a.shape + ((1,) * (len(x_shape) - a_dim)))) + + +def make_noise_symmetric_preserve_variance(noise: torch.Tensor) -> torch.Tensor: + """Makes the noise matrix symmetric, preserving the variance. Assumes i.i.d. noise for each dimension. + + Args: + noise (torch.Tensor): Input noise matrix, must be a batched square matrix, i.e., have shape (batch_size, dim, dim). + + Returns: + torch.Tensor: The symmetric noise matrix, with the same variance as the input. + """ + assert ( + len(noise.shape) == 3 and noise.shape[1] == noise.shape[2] + ), "Symmetric noise only works for square-matrix-shaped data." + # Var[1/sqrt(2) * (eps_i + eps_j)] = 0.5 Var[eps_i] + 0.5 Var[eps_j] = Var[noise] + # Special treatment of the diagonal elements, i.e., those we leave unchanged via masking. + return (1 / (2**0.5)) * (1 - torch.eye(3, device=noise.device)[None]) * ( + noise + noise.transpose(1, 2) + ) + torch.eye(3, device=noise.device)[None] * noise + + +class LatticeVPSDE(VPSDE): + @staticmethod + def from_vpsde_config(vpsde_config: DictConfig): + return LatticeVPSDE( + **vpsde_config, + ) + + def __init__( + self, + beta_min: float = 0.1, + beta_max: float = 20, + limit_density: float | None = 0.05, + limit_var_scaling_constant: float = 0.25, + **kwargs, + ): + """Variance-preserving SDE with drift coefficient changing linearly over time.""" + super().__init__() + self.beta_0 = beta_min + self.beta_1 = beta_max + + # each crystal is diffused to have expected lattice vectors + # based on the number of atoms per crystal and self.limit_density + # units=(atoms/Angstrom**3) + self.limit_density = limit_density + self.limit_var_scaling_constant = limit_var_scaling_constant + + self._limit_info_key = "num_atoms" + + @property + def limit_info_key(self) -> str: + return self._limit_info_key + + def beta(self, t: torch.Tensor) -> torch.Tensor: + return self.beta_0 + t * (self.beta_1 - self.beta_0) + + def _marginal_mean_coeff(self, t: torch.Tensor) -> torch.Tensor: + log_mean_coeff = -0.25 * t**2 * (self.beta_1 - self.beta_0) - 0.5 * t * self.beta_0 + return torch.exp(log_mean_coeff) + + def marginal_prob( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: BatchedData | None = None, + ) -> tuple[torch.Tensor, torch.Tensor]: + assert batch is not None + mean_coeff = self._marginal_mean_coeff(t) + # x: shape [batch_size, *x.shape[1:]] + # t, limit_info: shape [batch_size,] + limit_mean = self.get_limit_mean(x=x, batch=batch) + limit_var = self.get_limit_var(x=x, batch=batch) + mean_coeff_expanded = maybe_expand(mean_coeff, batch_idx, x) + mean = mean_coeff_expanded * x + (1 - mean_coeff_expanded) * limit_mean + std = torch.sqrt((1.0 - mean_coeff_expanded**2) * limit_var) + return mean, std + + def mean_coeff_and_std( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: BatchedData | None = None, + ) -> tuple[torch.Tensor, torch.Tensor]: + """Returns mean coefficient and standard deviation of marginal distribution at time t.""" + mean_coeff = self._marginal_mean_coeff(t) + std = self.marginal_prob(x, t, batch_idx, batch)[1] + return maybe_expand(mean_coeff, batch=None, like=x), std + + def get_limit_mean(self, x: torch.Tensor, batch: BatchedData) -> torch.Tensor: + # x: shape [batch_size, *x.shape[1:]] + # limit_info: shape [batch_size,], a 1d tensor containing number of atoms per crystal + # self.limit_density = limit_info / mean lattice vector length**3 + + # shape=[Ncrystals,] + n_atoms = batch[self.limit_info_key] + + # shape=[Ncrystals, 3, 3] + return torch.pow( + torch.eye(3, device=x.device).expand(len(n_atoms), 3, 3) + * n_atoms[:, None, None] + / self.limit_density, + 1.0 / 3, + ).to(x.device) + + def get_limit_var(self, x: torch.Tensor, batch: BatchedData) -> torch.Tensor: + """ + Returns the element-wise variance of the limit distribution. + NOTE: even though we have a different limit variance per data + dimension we still sample IID for each element per data point. + We do NOT do any correlated sampling over data dimensions per + data point. + + Return shape=x.shape + """ + + # x: shape [batch_size, *x.shape[1:]] + # limit_info: shape [batch_size,] + # necessary for mypy + n_atoms = batch[self.limit_info_key] + + # expand to fit shape of data, shape = (n_crystals, 1, 1) + n_atoms_expanded = expand(n_atoms, x.shape) + + # shape = (n_crystals, 3, 3) + n_atoms_expanded = torch.tile(n_atoms_expanded, (1, 3, 3)) + + # scale limit standard deviation to be proportional to number atoms = n_atoms**(1/3) + # per lattice vector. We hope that prod_i std_i scales as the standard deviation + # of the actual volume. NOTE: we return variance here, hence 2 in the power + # shape=(Ncrystals, 3, 3) for limit_info.shape=[Ncrystals,] + out = torch.pow(n_atoms_expanded, 2.0 / 3).to(x.device) * self.limit_var_scaling_constant + + return out + + def sample_marginal( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: BatchedData | None = None, + ) -> torch.Tensor: + mean, std = self.marginal_prob(x=x, t=t, batch=batch) + z = torch.randn_like(x) + z = make_noise_symmetric_preserve_variance(z) + return mean + expand(std, z.shape) * z + + def prior_sampling( + self, + shape: torch.Size | tuple, + conditioning_data: BatchedData | None = None, + batch_idx: B = None, + ) -> torch.Tensor: + x_sample = torch.randn(*shape) + x_sample = make_noise_symmetric_preserve_variance(x_sample) + assert conditioning_data is not None + limit_info = conditioning_data[self.limit_info_key] + x_sample = x_sample.to(limit_info.device) + limit_mean = self.get_limit_mean(x=x_sample, batch=conditioning_data) + limit_var = self.get_limit_var(x=x_sample, batch=conditioning_data) + # shape=[Nbatch,...] for shape[0]=Nbatch + return x_sample * limit_var.sqrt() + limit_mean + + def sde( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: BatchedData | None = None, + ) -> tuple[torch.Tensor, torch.Tensor]: + assert batch is not None + # x: shape [batch_size, *x.shape[1:]] + # t, limit_info: shape [batch_size,] + # if a per data-point limit mean is supplied, expand to shape of data + # shape=x.shape + limit_mean = self.get_limit_mean(x=x, batch=batch) + + # if a per data-point limit variance is supplied, shape=[x.shape[0], ] + limit_var = self.get_limit_var(x=x, batch=batch) + + beta_t = self.beta(t) + drift = ( + -0.5 + * expand( + beta_t, + x.shape, + ) + * (x - limit_mean) + ) + diffusion = torch.sqrt(expand(beta_t, limit_var.shape) * limit_var) + # drift.shape=[Nbatch,...], diffusion.shape=[Nbatch,] for x.shape[0]=Nbatch + return maybe_expand(drift, batch_idx), maybe_expand(diffusion, batch_idx) + + +class NumAtomsVarianceAdjustedWrappedVESDE(WrappedVESDE): + """Wrapped VESDE with variance adjusted by number of atoms. We divide the standard deviation by the cubic root of the number of atoms. + The goal is to reduce the influence by the cell size on the variance of the fractional coordinates. + """ + + def __init__( + self, + wrapping_boundary: float | torch.Tensor = 1.0, + sigma_min: float = 0.01, + sigma_max: float = 5.0, + limit_info_key: str = "num_atoms", + ): + super().__init__( + sigma_min=sigma_min, sigma_max=sigma_max, wrapping_boundary=wrapping_boundary + ) + self.limit_info_key = limit_info_key + + def std_scaling(self, batch: BatchedData) -> torch.Tensor: + return batch[self.limit_info_key] ** (-1 / 3) + + def marginal_prob( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: BatchedData | None = None, + ) -> tuple[torch.Tensor, torch.Tensor]: + mean, std = super().marginal_prob(x, t, batch_idx, batch) + assert ( + batch is not None + ), "batch must be provided when using NumAtomsVarianceAdjustedWrappedVESDEMixin" + std_scale = self.std_scaling(batch) + std = std * maybe_expand(std_scale, batch_idx, like=std) + return mean, std + + def prior_sampling( + self, + shape: torch.Size | tuple, + conditioning_data: BatchedData | None = None, + batch_idx=None, + ) -> torch.Tensor: + _super = super() + assert isinstance(self, DiffSDE) and hasattr(_super, "prior_sampling") + assert ( + conditioning_data is not None + ), "batch must be provided when using NumAtomsVarianceAdjustedWrappedVESDEMixin" + num_atoms = conditioning_data[self.limit_info_key] + batch_idx = torch.repeat_interleave( + torch.arange(num_atoms.shape[0], device=num_atoms.device), num_atoms, dim=0 + ) + std_scale = self.std_scaling(conditioning_data) + # prior sample is randn() * sigma_max, so we need additionally multiply by std_scale to get the correct variance. + # We call VESDE.prior_sampling (a "grandparent" function) because the super() prior_sampling already does the wrapping, + # which means we couldn't do the variance adjustment here anymore otherwise. + prior_sample = DiffVESDE.prior_sampling(self, shape=shape).to(num_atoms.device) + return self.wrap(prior_sample * maybe_expand(std_scale, batch_idx, like=prior_sample)) + + def sde( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: BatchedData | None = None, + ) -> tuple[torch.Tensor, torch.Tensor]: + sigma = self.marginal_prob(x, t, batch_idx, batch)[1] + sigma_min = self.marginal_prob(x, torch.zeros_like(t), batch_idx, batch)[1] + sigma_max = self.marginal_prob(x, torch.ones_like(t), batch_idx, batch)[1] + drift = torch.zeros_like(x) + diffusion = sigma * torch.sqrt(2 * (sigma_max.log() - sigma_min.log())) + return drift, diffusion diff --git a/data/mattergen/common/diffusion/predictors_correctors.py b/data/mattergen/common/diffusion/predictors_correctors.py new file mode 100644 index 0000000000000000000000000000000000000000..1818120ee8c32f2fa1cc5d44c8040df749fcc0cf --- /dev/null +++ b/data/mattergen/common/diffusion/predictors_correctors.py @@ -0,0 +1,97 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import torch + +from mattergen.common.diffusion import corruption as sde_lib +from mattergen.common.utils.data_utils import compute_lattice_polar_decomposition +from mattergen.diffusion.corruption.corruption import Corruption, maybe_expand +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.sampling import predictors_correctors as pc +from mattergen.diffusion.sampling.predictors import AncestralSamplingPredictor + +SampleAndMean = tuple[torch.Tensor, torch.Tensor] + + +class LatticeAncestralSamplingPredictor(AncestralSamplingPredictor): + @classmethod + def is_compatible(cls, corruption: Corruption) -> bool: + _super = super() + assert hasattr(_super, "is_compatible") + return _super.is_compatible(corruption) or isinstance(corruption, sde_lib.LatticeVPSDE) + + def update_given_score( + self, + *, + x: torch.Tensor, + t: torch.Tensor, + dt: torch.Tensor, + batch_idx: torch.LongTensor, + score: torch.Tensor, + batch: BatchedData | None, + ) -> SampleAndMean: + x_coeff, score_coeff, std = self._get_coeffs( + x=x, + t=t, + dt=dt, + batch_idx=batch_idx, + batch=batch, + ) + # mean = (x + score * beta**2 - limit_mean)/(1-beta) + limit_mean + # <=> mean = x / (1-beta) + score * beta**2 / (1-beta) + limit_mean * (1 - 1/(1-beta)) + # => mean_coeff = 1 - x_coeff = 1 - 1/(1-beta) + mean_coeff = 1 - x_coeff + # Sample random noise. + z = sde_lib.make_noise_symmetric_preserve_variance(torch.randn_like(x_coeff)) + assert hasattr(self.corruption, "get_limit_mean") # mypy + mean = ( + x_coeff * x + + score_coeff * score + + mean_coeff * self.corruption.get_limit_mean(x=x, batch=batch) + ) + sample = mean + std * z + return sample, mean + + +# create a langevin corrector that accepts LatticeVPSDE +class LatticeLangevinDiffCorrector(pc.LangevinCorrector): + @classmethod + def is_compatible(cls, corruption: Corruption) -> bool: + _super = super() + assert hasattr(_super, "is_compatible") + return _super.is_compatible(corruption) or isinstance(corruption, sde_lib.LatticeVPSDE) + + def step_given_score( + self, + *, + x: torch.Tensor, + batch_idx: torch.LongTensor | None, + score: torch.Tensor, + t: torch.Tensor, + ) -> SampleAndMean: + assert isinstance(self.corruption, sde_lib.LatticeVPSDE) + alpha = self.get_alpha(t) + snr = self.snr + noise = torch.randn_like(x) + noise = sde_lib.make_noise_symmetric_preserve_variance(noise) + + # [batch_size, ] or [num_atoms, ] if batch_idx is not None + grad_norm_square = torch.square(score).reshape(score.shape[0], -1).sum(dim=1) + noise_norm_square = torch.square(noise).reshape(noise.shape[0], -1).sum(dim=1) + # Average over items, leading to scalars. + grad_norm = grad_norm_square.sqrt().mean() + noise_norm = noise_norm_square.sqrt().mean() + + # If gradient is zero (i.e., we are sampling from an improper distribution that's flat over the whole of R^n) + # the step_size blows up. Clip step_size to avoid this. + # The EGNN reports zero scores when there are no edges between nodes. + step_size = (snr * noise_norm / grad_norm) ** 2 * 2 * alpha + step_size = torch.minimum(step_size, self.max_step_size) + step_size[grad_norm == 0, :] = self.max_step_size + step_size = maybe_expand(step_size, batch_idx, score) + mean = x + step_size * score + x = mean + torch.sqrt(step_size * 2) * noise + + x = compute_lattice_polar_decomposition(x) + mean = compute_lattice_polar_decomposition(mean) + return x, mean diff --git a/data/mattergen/common/gemnet/__init__.py b/data/mattergen/common/gemnet/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/common/gemnet/cgmanifest.json b/data/mattergen/common/gemnet/cgmanifest.json new file mode 100644 index 0000000000000000000000000000000000000000..9e50fd5999ef2b57958f824ee84cefd327243085 --- /dev/null +++ b/data/mattergen/common/gemnet/cgmanifest.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "version": 1, + "registrations":[ + { + "component": { + "type": "git", + "git": { + "repositoryUrl": "https://github.com/FAIR-Chem/fairchem", + "commitHash": "65c2d6246e69169f43949858d39550d2a635c7e0" + } + }, + "developmentDependency" : false + } + ] +} \ No newline at end of file diff --git a/data/mattergen/common/gemnet/gemnet-dT.json b/data/mattergen/common/gemnet/gemnet-dT.json new file mode 100644 index 0000000000000000000000000000000000000000..98aac8b55c33dc42064a4e7d740e5ec298a48109 --- /dev/null +++ b/data/mattergen/common/gemnet/gemnet-dT.json @@ -0,0 +1,20 @@ +{ + "comment": "tri_gaussian128, from https://github.com/FAIR-Chem/fairchem/blob/main/configs/s2ef/all/gemnet/scaling_factors/gemnet-dT.json", + "TripInteraction_1_had_rbf": 18.873615264892578, + "TripInteraction_1_sum_cbf": 7.996850490570068, + "AtomUpdate_1_sum": 1.220463752746582, + "TripInteraction_2_had_rbf": 16.10817527770996, + "TripInteraction_2_sum_cbf": 7.614634037017822, + "AtomUpdate_2_sum": 0.9690994620323181, + "TripInteraction_3_had_rbf": 15.01930046081543, + "TripInteraction_3_sum_cbf": 7.025179862976074, + "AtomUpdate_3_sum": 0.8903237581253052, + "OutBlock_0_sum": 1.6437848806381226, + "OutBlock_0_had": 16.161039352416992, + "OutBlock_1_sum": 1.1077653169631958, + "OutBlock_1_had": 13.54678726196289, + "OutBlock_2_sum": 0.9477927684783936, + "OutBlock_2_had": 12.754337310791016, + "OutBlock_3_sum": 0.9059251546859741, + "OutBlock_3_had": 13.484951972961426 +} diff --git a/data/mattergen/common/gemnet/gemnet.py b/data/mattergen/common/gemnet/gemnet.py new file mode 100644 index 0000000000000000000000000000000000000000..eefb3b41b163c404faab9ddc03672d1c17387865 --- /dev/null +++ b/data/mattergen/common/gemnet/gemnet.py @@ -0,0 +1,778 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/gemnet.py. +""" + +from dataclasses import dataclass +from typing import Optional, Tuple + +# import numpy as np +import torch +import torch.nn as nn +from torch_scatter import scatter +from torch_sparse import SparseTensor + +from mattergen.common.gemnet.layers.atom_update_block import OutputBlock +from mattergen.common.gemnet.layers.base_layers import Dense +from mattergen.common.gemnet.layers.efficient import EfficientInteractionDownProjection +from mattergen.common.gemnet.layers.embedding_block import EdgeEmbedding +from mattergen.common.gemnet.layers.interaction_block import InteractionBlockTripletsOnly +from mattergen.common.gemnet.layers.radial_basis import RadialBasis +from mattergen.common.gemnet.layers.scaling import AutomaticFit +from mattergen.common.gemnet.layers.spherical_basis import CircularBasisLayer +from mattergen.common.gemnet.utils import ( + inner_product_normalized, + mask_neighbors, + ragged_range, + repeat_blocks, +) +from mattergen.common.utils.data_utils import ( + frac_to_cart_coords_with_lattice, + get_pbc_distances, + lattice_params_to_matrix_torch, + radius_graph_pbc, +) +from mattergen.common.utils.globals import MODELS_PROJECT_ROOT, get_device, get_pyg_device +from mattergen.common.utils.lattice_score import edge_score_to_lattice_score_frac_symmetric + + +@dataclass(frozen=True) +class ModelOutput: + energy: torch.Tensor + node_embeddings: torch.Tensor + forces: Optional[torch.Tensor] = None + stress: Optional[torch.Tensor] = None + + +class RBFBasedLatticeUpdateBlock(torch.nn.Module): + # Lattice update block that mimics GemNet's edge processing, e.g., uses radial basis functions. + def __init__( + self, + emb_size: int, + activation: str, + emb_size_rbf: int, + emb_size_edge: int, + num_heads: int = 1, + ): + super().__init__() + self.num_out = num_heads + self.mlp = nn.Sequential( + Dense(emb_size, emb_size, activation=activation), Dense(emb_size, emb_size) + ) + self.dense_rbf_F = Dense(emb_size_rbf, emb_size_edge, activation=None, bias=False) + self.out_forces = Dense(emb_size_edge, num_heads, bias=False, activation=None) + + def compute_score_per_edge( + self, + edge_emb: torch.Tensor, # [Num_edges, emb_dim] + rbf: torch.Tensor, # [Num_edges, num_rbf_bases] + ) -> torch.Tensor: + x_F = self.mlp(edge_emb) + rbf_emb_F = self.dense_rbf_F(rbf) # (nEdges, emb_size_edge) + x_F_rbf = x_F * rbf_emb_F + # x_F = self.scale_rbf_F(x_F, x_F_rbf) + x_F = self.out_forces(x_F_rbf) # (nEdges, self.num_out) + return x_F + + +class RBFBasedLatticeUpdateBlockFrac(RBFBasedLatticeUpdateBlock): + # Lattice update block that mimics GemNet's edge processing, e.g., uses radial basis functions. + def __init__( + self, + emb_size: int, + activation: str, + emb_size_rbf: int, + emb_size_edge: int, + num_heads: int = 1, + ): + super().__init__( + emb_size=emb_size, + activation=activation, + emb_size_rbf=emb_size_rbf, + emb_size_edge=emb_size_edge, + num_heads=num_heads, + ) + + def forward( + self, + edge_emb: torch.Tensor, # [Num_edges, emb_dim] + edge_index: torch.Tensor, # [2, Num_edges] + distance_vec: torch.Tensor, # [Num_edges, 3] + lattice: torch.Tensor, # [Num_crystals, 3, 3] + batch: torch.Tensor, # [Num_atoms, ] + rbf: torch.Tensor, # [Num_edges, num_rbf_bases] + normalize_score: bool = True, + ) -> torch.Tensor: + edge_scores = self.compute_score_per_edge(edge_emb=edge_emb, rbf=rbf) + if normalize_score: + num_edges = scatter(torch.ones_like(distance_vec[:, 0]), batch[edge_index[0]]) + edge_scores /= num_edges[batch[edge_index[0]], None] + outs = [] + for i in range(self.num_out): + lattice_update = edge_score_to_lattice_score_frac_symmetric( + score_d=edge_scores[:, i], + edge_index=edge_index, + edge_vectors=distance_vec, + batch=batch, + ) + outs.append(lattice_update) + outs = torch.stack(outs, dim=-1).sum(-1) + # [Batch_size, 3, 3] + return outs + + +class GemNetT(torch.nn.Module): + """ + GemNet-T, triplets-only variant of GemNet + + Parameters + ---------- + num_targets: int + Number of prediction targets. + + num_spherical: int + Controls maximum frequency. + num_radial: int + Controls maximum frequency. + num_blocks: int + Number of building blocks to be stacked. + + atom_embedding: torch.nn.Module + a module that embeds atomic numbers into vectors of size emb_dim_atomic_number. + emb_size_atom: int + Embedding size of the atoms. This can be different from emb_dim_atomic_number. + emb_size_edge: int + Embedding size of the edges. + emb_size_trip: int + (Down-projected) Embedding size in the triplet message passing block. + emb_size_rbf: int + Embedding size of the radial basis transformation. + emb_size_cbf: int + Embedding size of the circular basis transformation (one angle). + emb_size_bil_trip: int + Embedding size of the edge embeddings in the triplet-based message passing block after the bilinear layer. + num_before_skip: int + Number of residual blocks before the first skip connection. + num_after_skip: int + Number of residual blocks after the first skip connection. + num_concat: int + Number of residual blocks after the concatenation. + num_atom: int + Number of residual blocks in the atom embedding blocks. + cutoff: float + Embedding cutoff for interactomic directions in Angstrom. + rbf: dict + Name and hyperparameters of the radial basis function. + envelope: dict + Name and hyperparameters of the envelope function. + cbf: dict + Name and hyperparameters of the cosine basis function. + output_init: str + Initialization method for the final dense layer. + activation: str + Name of the activation function. + scale_file: str + Path to the json file containing the scaling factors. + encoder_mode: bool + if <True>, use the encoder mode of the model, i.e. only get the atom/edge embedddings. + """ + + def __init__( + self, + num_targets: int, + latent_dim: int, + atom_embedding: torch.nn.Module, + num_spherical: int = 7, + num_radial: int = 128, + num_blocks: int = 3, + emb_size_atom: int = 512, + emb_size_edge: int = 512, + emb_size_trip: int = 64, + emb_size_rbf: int = 16, + emb_size_cbf: int = 16, + emb_size_bil_trip: int = 64, + num_before_skip: int = 1, + num_after_skip: int = 2, + num_concat: int = 1, + num_atom: int = 3, + regress_stress: bool = False, + cutoff: float = 6.0, + max_neighbors: int = 50, + rbf: dict = {"name": "gaussian"}, + envelope: dict = {"name": "polynomial", "exponent": 5}, + cbf: dict = {"name": "spherical_harmonics"}, + otf_graph: bool = False, + output_init: str = "HeOrthogonal", + activation: str = "swish", + max_cell_images_per_dim: int = 5, + encoder_mode: bool = False, # + **kwargs, + ): + super().__init__() + scale_file = f"{MODELS_PROJECT_ROOT}/common/gemnet/gemnet-dT.json" + assert scale_file is not None, "`scale_file` is required." + + self.encoder_mode = encoder_mode + self.num_targets = num_targets + assert num_blocks > 0 + self.num_blocks = num_blocks + emb_dim_atomic_number = getattr(atom_embedding, "emb_size") + + self.cutoff = cutoff + + self.max_neighbors = max_neighbors + + self.max_cell_images_per_dim = max_cell_images_per_dim + + self.otf_graph = otf_graph + + self.regress_stress = regress_stress + # we might want to take care of permutation invariance w.r.t. the order of the lattice vectors, though I don't think this is critical. + self.angle_edge_emb = nn.Sequential( + nn.Linear(emb_size_edge + 3, emb_size_edge), + nn.ReLU(), + nn.Linear(emb_size_edge, emb_size_edge), + ) + + AutomaticFit.reset() # make sure that queue is empty (avoid potential error) + + # ---------------------------------- Basis Functions ---------------------------------- ### + self.radial_basis = RadialBasis( + num_radial=num_radial, + cutoff=cutoff, + rbf=rbf, + envelope=envelope, + ) + + radial_basis_cbf3 = RadialBasis( + num_radial=num_radial, + cutoff=cutoff, + rbf=rbf, + envelope=envelope, + ) + self.cbf_basis3 = CircularBasisLayer( + num_spherical, + radial_basis=radial_basis_cbf3, + cbf=cbf, + efficient=True, + ) + # ------------------------------------------------------------------------------------- ### + + # --------------------------------- Update lattice MLP -------------------------------- ### + self.regress_stress = regress_stress + self.lattice_out_blocks = nn.ModuleList( + [ + RBFBasedLatticeUpdateBlockFrac( + emb_size_edge, + activation, + emb_size_rbf, + emb_size_edge, + ) + for _ in range(num_blocks + 1) + ] + ) + self.mlp_rbf_lattice = Dense( + num_radial, + emb_size_rbf, + activation=None, + bias=False, + ) + # ------------------------------------------------------------------------------------- ### + # ------------------------------- Share Down Projections ------------------------------ ### + # Share down projection across all interaction blocks + self.mlp_rbf3 = Dense( + num_radial, + emb_size_rbf, + activation=None, + bias=False, + ) + self.mlp_cbf3 = EfficientInteractionDownProjection(num_spherical, num_radial, emb_size_cbf) + + # Share the dense Layer of the atom embedding block across the interaction blocks + self.mlp_rbf_h = Dense( + num_radial, + emb_size_rbf, + activation=None, + bias=False, + ) + self.mlp_rbf_out = Dense( + num_radial, + emb_size_rbf, + activation=None, + bias=False, + ) + # ------------------------------------------------------------------------------------- ### + + self.atom_emb = atom_embedding + self.atom_latent_emb = nn.Linear(emb_dim_atomic_number + latent_dim, emb_size_atom) + self.edge_emb = EdgeEmbedding( + emb_size_atom, num_radial, emb_size_edge, activation=activation + ) + + out_blocks = [] + int_blocks = [] + + # Interaction Blocks + interaction_block = InteractionBlockTripletsOnly # GemNet-(d)T + for i in range(num_blocks): + int_blocks.append( + interaction_block( + emb_size_atom=emb_size_atom, + emb_size_edge=emb_size_edge, + emb_size_trip=emb_size_trip, + emb_size_rbf=emb_size_rbf, + emb_size_cbf=emb_size_cbf, + emb_size_bil_trip=emb_size_bil_trip, + num_before_skip=num_before_skip, + num_after_skip=num_after_skip, + num_concat=num_concat, + num_atom=num_atom, + activation=activation, + scale_file=scale_file, + name=f"IntBlock_{i+1}", + ) + ) + + for i in range(num_blocks + 1): + out_blocks.append( + OutputBlock( + emb_size_atom=emb_size_atom, + emb_size_edge=emb_size_edge, + emb_size_rbf=emb_size_rbf, + nHidden=num_atom, + num_targets=num_targets, + activation=activation, + output_init=output_init, + direct_forces=True, + scale_file=scale_file, + name=f"OutBlock_{i}", + ) + ) + + self.out_blocks = torch.nn.ModuleList(out_blocks) + self.int_blocks = torch.nn.ModuleList(int_blocks) + + self.shared_parameters = [ + (self.mlp_rbf3, self.num_blocks), + (self.mlp_cbf3, self.num_blocks), + (self.mlp_rbf_h, self.num_blocks), + (self.mlp_rbf_out, self.num_blocks + 1), + ] + + def get_triplets( + self, edge_index: torch.Tensor, num_atoms: int + ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: + """ + Get all b->a for each edge c->a. + It is possible that b=c, as long as the edges are distinct. + + Returns + ------- + id3_ba: torch.Tensor, shape (num_triplets,) + Indices of input edge b->a of each triplet b->a<-c + id3_ca: torch.Tensor, shape (num_triplets,) + Indices of output edge c->a of each triplet b->a<-c + id3_ragged_idx: torch.Tensor, shape (num_triplets,) + Indices enumerating the copies of id3_ca for creating a padded matrix + """ + idx_s, idx_t = edge_index # c->a (source=c, target=a) + + value = torch.arange(idx_s.size(0), device=idx_s.device, dtype=idx_s.dtype) + # Possibly contains multiple copies of the same edge (for periodic interactions) + pyg_device = get_pyg_device() + torch_device = get_device() + adj = SparseTensor( + row=idx_t.to(pyg_device), + col=idx_s.to(pyg_device), + value=value.to(pyg_device), + sparse_sizes=(num_atoms.to(pyg_device), num_atoms.to(pyg_device)), + ) + adj_edges = adj[idx_t.to(pyg_device)].to(torch_device) + + # Edge indices (b->a, c->a) for triplets. + id3_ba = adj_edges.storage.value().to(torch_device) + id3_ca = adj_edges.storage.row().to(torch_device) + + # Remove self-loop triplets + # Compare edge indices, not atom indices to correctly handle periodic interactions + mask = id3_ba != id3_ca + id3_ba = id3_ba[mask] + id3_ca = id3_ca[mask] + + # Get indices to reshape the neighbor indices b->a into a dense matrix. + # id3_ca has to be sorted for this to work. + num_triplets = torch.bincount(id3_ca, minlength=idx_s.size(0)) + id3_ragged_idx = ragged_range(num_triplets) + + return id3_ba, id3_ca, id3_ragged_idx + + def select_symmetric_edges(self, tensor, mask, reorder_idx, inverse_neg): + # Mask out counter-edges + tensor_directed = tensor[mask] + # Concatenate counter-edges after normal edges + sign = 1 - 2 * inverse_neg + tensor_cat = torch.cat([tensor_directed, sign * tensor_directed]) + # Reorder everything so the edges of every image are consecutive + tensor_ordered = tensor_cat[reorder_idx] + return tensor_ordered + + def reorder_symmetric_edges( + self, + edge_index: torch.Tensor, + cell_offsets: torch.Tensor, + neighbors: torch.Tensor, + edge_dist: torch.Tensor, + edge_vector: torch.Tensor, + ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]: + """ + Reorder edges to make finding counter-directional edges easier. + + Some edges are only present in one direction in the data, + since every atom has a maximum number of neighbors. Since we only use i->j + edges here, we lose some j->i edges and add others by + making it symmetric. + We could fix this by merging edge_index with its counter-edges, + including the cell_offsets, and then running torch.unique. + But this does not seem worth it. + """ + + # Generate mask + mask_sep_atoms = edge_index[0] < edge_index[1] + # Distinguish edges between the same (periodic) atom by ordering the cells + cell_earlier = ( + (cell_offsets[:, 0] < 0) + | ((cell_offsets[:, 0] == 0) & (cell_offsets[:, 1] < 0)) + | ((cell_offsets[:, 0] == 0) & (cell_offsets[:, 1] == 0) & (cell_offsets[:, 2] < 0)) + ) + mask_same_atoms = edge_index[0] == edge_index[1] + mask_same_atoms &= cell_earlier + mask = mask_sep_atoms | mask_same_atoms + + # Mask out counter-edges + edge_index_new = edge_index[mask[None, :].expand(2, -1)].view(2, -1) + + # Concatenate counter-edges after normal edges + edge_index_cat = torch.cat( + [ + edge_index_new, + torch.stack([edge_index_new[1], edge_index_new[0]], dim=0), + ], + dim=1, + ) + + # Count remaining edges per image + batch_edge = torch.repeat_interleave( + torch.arange(neighbors.size(0), device=edge_index.device), + neighbors, + ) + batch_edge = batch_edge[mask] + neighbors_new = 2 * torch.bincount(batch_edge, minlength=neighbors.size(0)) + + # Create indexing array + edge_reorder_idx = repeat_blocks( + neighbors_new // 2, + repeats=2, + continuous_indexing=True, + repeat_inc=edge_index_new.size(1), + ) + + # Reorder everything so the edges of every image are consecutive + edge_index_new = edge_index_cat[:, edge_reorder_idx] + cell_offsets_new = self.select_symmetric_edges(cell_offsets, mask, edge_reorder_idx, True) + edge_dist_new = self.select_symmetric_edges(edge_dist, mask, edge_reorder_idx, False) + edge_vector_new = self.select_symmetric_edges(edge_vector, mask, edge_reorder_idx, True) + + return ( + edge_index_new, + cell_offsets_new, + neighbors_new, + edge_dist_new, + edge_vector_new, + ) + + def select_edges( + self, + edge_index: torch.Tensor, + cell_offsets: torch.Tensor, + neighbors: torch.Tensor, + edge_dist: torch.Tensor, + edge_vector: torch.Tensor, + cutoff: Optional[float] = None, + ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]: + if cutoff is not None: + edge_mask = edge_dist <= cutoff + + edge_index = edge_index[:, edge_mask] + cell_offsets = cell_offsets[edge_mask] + neighbors = mask_neighbors(neighbors, edge_mask) + edge_dist = edge_dist[edge_mask] + edge_vector = edge_vector[edge_mask] + + return edge_index, cell_offsets, neighbors, edge_dist, edge_vector + + def generate_interaction_graph( + self, + cart_coords: torch.Tensor, + lattice: torch.Tensor, + num_atoms: torch.Tensor, + edge_index: torch.Tensor, + to_jimages: torch.Tensor, + num_bonds: torch.Tensor, + ) -> Tuple[ + Tuple[torch.Tensor, torch.Tensor], + torch.Tensor, + torch.Tensor, + torch.Tensor, + torch.Tensor, + torch.Tensor, + torch.Tensor, + torch.Tensor, + torch.Tensor, + ]: + if self.otf_graph: + edge_index, to_jimages, num_bonds = radius_graph_pbc( + cart_coords=cart_coords, + lattice=lattice, + num_atoms=num_atoms, + radius=self.cutoff, + max_num_neighbors_threshold=self.max_neighbors, + max_cell_images_per_dim=self.max_cell_images_per_dim, + ) + + # Switch the indices, so the second one becomes the target index, + # over which we can efficiently aggregate. + out = get_pbc_distances( + cart_coords, + edge_index, + lattice, + to_jimages, + num_atoms, + num_bonds, + coord_is_cart=True, + return_offsets=True, + return_distance_vec=True, + ) + + edge_index = out["edge_index"] + D_st = out["distances"] + # These vectors actually point in the opposite direction. + # But we want to use col as idx_t for efficient aggregation. + V_st = -out["distance_vec"] / D_st[:, None] + + ( + edge_index, + cell_offsets, + neighbors, + D_st, + V_st, + ) = self.reorder_symmetric_edges(edge_index, to_jimages, num_bonds, D_st, V_st) + + # Indices for swapping c->a and a->c (for symmetric MP) + block_sizes = neighbors // 2 + + # Remove 0 sizes + block_sizes = torch.masked_select(block_sizes, block_sizes > 0) + id_swap = repeat_blocks( + block_sizes, + repeats=2, + continuous_indexing=False, + start_idx=block_sizes[0], + block_inc=block_sizes[:-1] + block_sizes[1:], + repeat_inc=-block_sizes, + ) + + id3_ba, id3_ca, id3_ragged_idx = self.get_triplets( + edge_index, + num_atoms=num_atoms.sum(), + ) + + return ( + edge_index, + neighbors, + D_st, + V_st, + id_swap, + id3_ba, + id3_ca, + id3_ragged_idx, + cell_offsets, + ) + + def forward( + self, + z: torch.Tensor, + frac_coords: torch.Tensor, + atom_types: torch.Tensor, + num_atoms: torch.Tensor, + batch: torch.Tensor, + lengths: Optional[torch.Tensor] = None, + angles: Optional[torch.Tensor] = None, + edge_index: Optional[torch.Tensor] = None, + to_jimages: Optional[torch.Tensor] = None, + num_bonds: Optional[torch.Tensor] = None, + lattice: Optional[torch.Tensor] = None, + ) -> ModelOutput: + """ + args: + z: (N_cryst, num_latent) + frac_coords: (N_atoms, 3) + atom_types: (N_atoms, ) with D3PM need to use atomic number + num_atoms: (N_cryst,) + lengths: (N_cryst, 3) (optional, either lengths and angles or lattice must be passed) + angles: (N_cryst, 3) (optional, either lengths and angles or lattice must be passed) + edge_index: (2, N_edge) (optional, only needed if self.otf_graph is False) + to_jimages: (N_edge, 3) (optional, only needed if self.otf_graph is False) + num_bonds: (N_cryst,) (optional, only needed if self.otf_graph is False) + lattice: (N_cryst, 3, 3) (optional, either lengths and angles or lattice must be passed) + returns: + atom_frac_coords: (N_atoms, 3) + atom_types: (N_atoms, MAX_ATOMIC_NUM) + """ + + if self.otf_graph: + assert all( + [edge_index is None, to_jimages is None, num_bonds is None] + ), "OTF graph construction is active but received input graph information." + else: + assert not any( + [edge_index is None, to_jimages is None, num_bonds is None] + ), "OTF graph construction is off but received no input graph information." + + assert (angles is None and lengths is None) != ( + lattice is None + ), "Either lattice or lengths and angles must be provided, not both or none." + if angles is not None and lengths is not None: + lattice = lattice_params_to_matrix_torch(lengths, angles) + assert lattice is not None + distorted_lattice = lattice + + pos = frac_to_cart_coords_with_lattice(frac_coords, num_atoms, lattice=distorted_lattice) + + atomic_numbers = atom_types + + ( + edge_index, + neighbors, + D_st, + V_st, + id_swap, + id3_ba, + id3_ca, + id3_ragged_idx, + to_jimages, + ) = self.generate_interaction_graph( + pos, distorted_lattice, num_atoms, edge_index, to_jimages, num_bonds + ) + idx_s, idx_t = edge_index + + # Calculate triplet angles + cosφ_cab = inner_product_normalized(V_st[id3_ca], V_st[id3_ba]) + rad_cbf3, cbf3 = self.cbf_basis3(D_st, cosφ_cab, id3_ca) + + rbf = self.radial_basis(D_st) + + # Embedding block + h = self.atom_emb(atomic_numbers) + # Merge z and atom embedding + if z is not None: + z_per_atom = z[batch] + h = torch.cat([h, z_per_atom], dim=1) + # Combine all embeddings + h = self.atom_latent_emb(h) + # (nAtoms, emb_size_atom) + m = self.edge_emb(h, rbf, idx_s, idx_t) # (nEdges, emb_size_edge) + batch_edge = batch[edge_index[0]] + cosines = torch.cosine_similarity(V_st[:, None], distorted_lattice[batch_edge], dim=-1) + m = torch.cat([m, cosines], dim=-1) + m = self.angle_edge_emb(m) + + rbf3 = self.mlp_rbf3(rbf) + cbf3 = self.mlp_cbf3(rad_cbf3, cbf3, id3_ca, id3_ragged_idx) + + rbf_h = self.mlp_rbf_h(rbf) + rbf_out = self.mlp_rbf_out(rbf) + + E_t, F_st = self.out_blocks[0](h, m, rbf_out, idx_t) + + distance_vec = V_st * D_st[:, None] + + lattice_update = None + rbf_lattice = self.mlp_rbf_lattice(rbf) + lattice_update = self.lattice_out_blocks[0]( + edge_emb=m, + edge_index=edge_index, + distance_vec=distance_vec, + lattice=distorted_lattice, + batch=batch, + rbf=rbf_lattice, + normalize_score=True, + ) + F_fully_connected = torch.tensor(0.0, device=distorted_lattice.device) + for i in range(self.num_blocks): + # Interaction block + h, m = self.int_blocks[i]( + h=h, + m=m, + rbf3=rbf3, + cbf3=cbf3, + id3_ragged_idx=id3_ragged_idx, + id_swap=id_swap, + id3_ba=id3_ba, + id3_ca=id3_ca, + rbf_h=rbf_h, + idx_s=idx_s, + idx_t=idx_t, + ) # (nAtoms, emb_size_atom), (nEdges, emb_size_edge) + + E, F = self.out_blocks[i + 1](h, m, rbf_out, idx_t) + # (nAtoms, num_targets), (nEdges, num_targets) + F_st += F + E_t += E + rbf_lattice = self.mlp_rbf_lattice(rbf) + lattice_update += self.lattice_out_blocks[i + 1]( + edge_emb=m, + edge_index=edge_index, + distance_vec=distance_vec, + lattice=distorted_lattice, + batch=batch, + rbf=rbf_lattice, + normalize_score=True, + ) + + nMolecules = torch.max(batch) + 1 + + if self.encoder_mode: + return E_t + # always use sum aggregation + E_t = scatter( + E_t, batch, dim=0, dim_size=nMolecules, reduce="sum" + ) # (nMolecules, num_targets) + + # always output energy, forces and node embeddings + output = dict(energy=E_t, node_embeddings=h) + + # map forces in edge directions + F_st_vec = F_st[:, :, None] * V_st[:, None, :] + # (nEdges, num_targets, 3) + F_t = scatter( + F_st_vec, + idx_t, + dim=0, + dim_size=num_atoms.sum(), + reduce="add", + ) # (nAtoms, num_targets, 3) + F_t = F_t.squeeze(1) # (nAtoms, 3) + output["forces"] = F_t + F_fully_connected + + if self.regress_stress: + # optionally get predicted stress tensor + # shape=(Nbatch, 3, 3) + output["stress"] = lattice_update + + return ModelOutput(**output) + + @property + def num_params(self): + return sum(p.numel() for p in self.parameters()) \ No newline at end of file diff --git a/data/mattergen/common/gemnet/gemnet_ctrl.py b/data/mattergen/common/gemnet/gemnet_ctrl.py new file mode 100644 index 0000000000000000000000000000000000000000..40ee1972b2d1a66f90f01d1e736e4bdd33579a29 --- /dev/null +++ b/data/mattergen/common/gemnet/gemnet_ctrl.py @@ -0,0 +1,268 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/gemnet.py. + +from typing import Dict, List, Optional + +# import numpy as np +import torch +import torch.nn as nn +from torch_scatter import scatter + +from mattergen.common.data.types import PropertySourceId +from mattergen.common.gemnet.gemnet import GemNetT, ModelOutput +from mattergen.common.gemnet.utils import inner_product_normalized +from mattergen.common.utils.data_utils import ( + frac_to_cart_coords_with_lattice, + lattice_params_to_matrix_torch, +) + + +class GemNetTCtrl(GemNetT): + """ + GemNet-T, triplets-only variant of GemNet + + This variation allows for layerwise conditional control for the purpose of + conditional finetuning. It adds the following on top of GemNetT: + + for each condition in <condition_on_adapt>: + + 1. a series of adapt layers that take the concatenation of the node embedding + and the condition embedding, process it with an MLP. There is one adapt layer + for each GemNetT message passing block. + 2. a series of mixin layers that take the output of the adapt layer and mix it in + to the atom embedding. There is one mixin layer for each GemNetT message passing block. + The mixin layers are initialized to zeros so at the beginning of training, the model + outputs exactly the same scores as the base GemNetT model. + + """ + + def __init__(self, condition_on_adapt: List[PropertySourceId], *args, **kwargs): + super().__init__(*args, **kwargs) + + self.condition_on_adapt = condition_on_adapt + self.cond_adapt_layers = nn.ModuleDict() + self.cond_mixin_layers = nn.ModuleDict() + # default value for emb_size_atom is 512 + self.emb_size_atom = kwargs["emb_size_atom"] if "emb_size_atom" in kwargs else 512 + + for cond in condition_on_adapt: + adapt_layers = [] + mixin_layers = [] + + for _ in range(self.num_blocks): + adapt_layers.append( + nn.Sequential( + nn.Linear(self.emb_size_atom * 2, self.emb_size_atom), + nn.ReLU(), + nn.Linear(self.emb_size_atom, self.emb_size_atom), + ) + ) + mixin_layers.append(nn.Linear(self.emb_size_atom, self.emb_size_atom, bias=False)) + nn.init.zeros_(mixin_layers[-1].weight) + + self.cond_adapt_layers[cond] = torch.nn.ModuleList(adapt_layers) + self.cond_mixin_layers[cond] = torch.nn.ModuleList(mixin_layers) + + def forward( + self, + z: torch.Tensor, + frac_coords: torch.Tensor, + atom_types: torch.Tensor, + num_atoms: torch.Tensor, + batch: torch.Tensor, + lengths: Optional[torch.Tensor] = None, + angles: Optional[torch.Tensor] = None, + edge_index: Optional[torch.Tensor] = None, + to_jimages: Optional[torch.Tensor] = None, + num_bonds: Optional[torch.Tensor] = None, + lattice: Optional[torch.Tensor] = None, + charges: Optional[torch.Tensor] = None, + cond_adapt: Optional[Dict[PropertySourceId, torch.Tensor]] = None, + cond_adapt_mask: Optional[Dict[PropertySourceId, torch.Tensor]] = None, + ) -> ModelOutput: + """ + args: + z: (N_cryst, num_latent) + frac_coords: (N_atoms, 3) + atom_types: (N_atoms, ) with D3PM need to use atomic number + num_atoms: (N_cryst,) + lengths: (N_cryst, 3) (optional, either lengths and angles or lattice must be passed) + angles: (N_cryst, 3) (optional, either lengths and angles or lattice must be passed) + edge_index: (2, N_edge) (optional, only needed if self.otf_graph is False) + to_jimages: (N_edge, 3) (optional, only needed if self.otf_graph is False) + num_bonds: (N_cryst,) (optional, only needed if self.otf_graph is False) + lattice: (N_cryst, 3, 3) (optional, either lengths and angles or lattice must be passed) + cond_adapt: (N_cryst, num_cond, dim_cond) (optional, conditional signal for score prediction) + cond_adapt_mask: (N_cryst, num_cond) (optional, mask for which data points receive conditional signal) + returns: + atom_frac_coords: (N_atoms, 3) + atom_types: (N_atoms, MAX_ATOMIC_NUM) + """ + + if self.otf_graph: + assert all( + [edge_index is None, to_jimages is None, num_bonds is None] + ), "OTF graph construction is active but received input graph information." + else: + assert not any( + [edge_index is None, to_jimages is None, num_bonds is None] + ), "OTF graph construction is off but received no input graph information." + + assert (angles is None and lengths is None) != ( + lattice is None + ), "Either lattice or lengths and angles must be provided, not both or none." + if angles is not None and lengths is not None: + lattice = lattice_params_to_matrix_torch(lengths, angles) + assert lattice is not None + distorted_lattice = lattice + + pos = frac_to_cart_coords_with_lattice(frac_coords, num_atoms, lattice=distorted_lattice) + + atomic_numbers = atom_types + + ( + edge_index, + neighbors, + D_st, + V_st, + id_swap, + id3_ba, + id3_ca, + id3_ragged_idx, + to_jimages, + ) = self.generate_interaction_graph( + pos, distorted_lattice, num_atoms, edge_index, to_jimages, num_bonds + ) + idx_s, idx_t = edge_index + + # Calculate triplet angles + cosφ_cab = inner_product_normalized(V_st[id3_ca], V_st[id3_ba]) + rad_cbf3, cbf3 = self.cbf_basis3(D_st, cosφ_cab, id3_ca) + + rbf = self.radial_basis(D_st) + + # Embedding block + h = self.atom_emb(atomic_numbers) + # Merge z and atom embedding + if z is not None: + z_per_atom = z[batch] + h = torch.cat([h, z_per_atom], dim=1) + h = self.atom_latent_emb(h) + # (nAtoms, emb_size_atom) + m = self.edge_emb(h, rbf, idx_s, idx_t) # (nEdges, emb_size_edge) + batch_edge = batch[edge_index[0]] + cosines = torch.cosine_similarity(V_st[:, None], distorted_lattice[batch_edge], dim=-1) + m = torch.cat([m, cosines], dim=-1) + m = self.angle_edge_emb(m) + + rbf3 = self.mlp_rbf3(rbf) + cbf3 = self.mlp_cbf3(rad_cbf3, cbf3, id3_ca, id3_ragged_idx) + + rbf_h = self.mlp_rbf_h(rbf) + rbf_out = self.mlp_rbf_out(rbf) + + E_t, F_st = self.out_blocks[0](h, m, rbf_out, idx_t) + + distance_vec = V_st * D_st[:, None] + + lattice_update = None + rbf_lattice = self.mlp_rbf_lattice(rbf) + lattice_update = self.lattice_out_blocks[0]( + edge_emb=m, + edge_index=edge_index, + distance_vec=distance_vec, + lattice=distorted_lattice, + batch=batch, + rbf=rbf_lattice, + normalize_score=True, + ) + + # currently only working for a single cond adapt property. + # to extend to multi-properties, + # use a ModuleDict for adapt layers and mixin layers. + # use a dictionary to track the conditions? + + if cond_adapt is not None and cond_adapt_mask is not None: + cond_adapt_per_atom = {} + cond_adapt_mask_per_atom = {} + for cond in self.condition_on_adapt: + cond_adapt_per_atom[cond] = cond_adapt[cond][batch] + # 1 = use conditional embedding, 0 = use unconditional embedding + cond_adapt_mask_per_atom[cond] = 1.0 - cond_adapt_mask[cond][batch].float() + + for i in range(self.num_blocks): + h_adapt = torch.zeros_like(h) + for cond in self.condition_on_adapt: + h_adapt_cond = self.cond_adapt_layers[cond][i]( + torch.cat([h, cond_adapt_per_atom[cond]], dim=-1) + ) + h_adapt_cond = self.cond_mixin_layers[cond][i](h_adapt_cond) + # cond_adapt_mask_per_atom[cond] is 1.0 if we want to use conditional embedding and 0 for unconditional embedding + h_adapt += cond_adapt_mask_per_atom[cond] * h_adapt_cond + h = h + h_adapt + + # Interaction block + h, m = self.int_blocks[i]( + h=h, + m=m, + rbf3=rbf3, + cbf3=cbf3, + id3_ragged_idx=id3_ragged_idx, + id_swap=id_swap, + id3_ba=id3_ba, + id3_ca=id3_ca, + rbf_h=rbf_h, + idx_s=idx_s, + idx_t=idx_t, + ) # (nAtoms, emb_size_atom), (nEdges, emb_size_edge) + + E, F = self.out_blocks[i + 1](h, m, rbf_out, idx_t) + # (nAtoms, num_targets), (nEdges, num_targets) + F_st += F + E_t += E + rbf_lattice = self.mlp_rbf_lattice(rbf) + lattice_update += self.lattice_out_blocks[i + 1]( + edge_emb=m, + edge_index=edge_index, + distance_vec=distance_vec, + lattice=distorted_lattice, + batch=batch, + rbf=rbf_lattice, + normalize_score=True, + ) + + nMolecules = torch.max(batch) + 1 + + # always use sum aggregation + E_t = scatter( + E_t, batch, dim=0, dim_size=nMolecules, reduce="sum" + ) # (nMolecules, num_targets) + + # always output energy, forces and node embeddings + output = dict(energy=E_t, node_embeddings=h) + + # map forces in edge directions + F_st_vec = F_st[:, :, None] * V_st[:, None, :] + # (nEdges, num_targets, 3) + F_t = scatter( + F_st_vec, + idx_t, + dim=0, + dim_size=num_atoms.sum(), + reduce="add", + ) # (nAtoms, num_targets, 3) + F_t = F_t.squeeze(1) # (nAtoms, 3) + output["forces"] = F_t + + if self.regress_stress: + # shape=(Nbatch, 3, 3) + output["stress"] = lattice_update + + return ModelOutput(**output) + + @property + def num_params(self): + return sum(p.numel() for p in self.parameters()) diff --git a/data/mattergen/common/gemnet/initializers.py b/data/mattergen/common/gemnet/initializers.py new file mode 100644 index 0000000000000000000000000000000000000000..681c29d9c724a17255179cd96187398d4edbfba7 --- /dev/null +++ b/data/mattergen/common/gemnet/initializers.py @@ -0,0 +1,49 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/initializers.py. +""" + +import torch + + +# This function is not type annotated because mypy complains that axis could be either an integer or a tuple of integers, +# even though this is precicely how torch.var_mean works +def _standardize(kernel): + """ + Makes sure that N*Var(W) = 1 and E[W] = 0 + """ + eps = 1e-6 + + if len(kernel.shape) == 3: + axis = (0, 1) # last dimension is output dimension + else: + axis = 1 + + var, mean = torch.var_mean(kernel, dim=axis, unbiased=True, keepdim=True) + kernel = (kernel - mean) / (var + eps) ** 0.5 + return kernel + + +def he_orthogonal_init(tensor: torch.Tensor) -> torch.Tensor: + """ + Generate a weight matrix with variance according to He (Kaiming) initialization. + Based on a random (semi-)orthogonal matrix neural networks + are expected to learn better when features are decorrelated + (stated by eg. "Reducing overfitting in deep networks by decorrelating representations", + "Dropout: a simple way to prevent neural networks from overfitting", + "Exact solutions to the nonlinear dynamics of learning in deep linear neural networks") + """ + tensor = torch.nn.init.orthogonal_(tensor) + + if len(tensor.shape) == 3: + fan_in = tensor.shape[:-1].numel() + else: + fan_in = tensor.shape[1] + + with torch.no_grad(): + tensor.data = _standardize(tensor.data) + tensor.data *= (1 / fan_in) ** 0.5 + + return tensor diff --git a/data/mattergen/common/gemnet/layers/__init__.py b/data/mattergen/common/gemnet/layers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/common/gemnet/layers/atom_update_block.py b/data/mattergen/common/gemnet/layers/atom_update_block.py new file mode 100644 index 0000000000000000000000000000000000000000..d3ae364bced08bfe07506ed7e8ed9196acf3d0c0 --- /dev/null +++ b/data/mattergen/common/gemnet/layers/atom_update_block.py @@ -0,0 +1,203 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/layers/atom_update_block.py. +""" + +from typing import Tuple + +import torch +from torch_scatter import scatter + +from mattergen.common.gemnet.initializers import he_orthogonal_init +from mattergen.common.gemnet.layers.base_layers import Dense, ResidualLayer +from mattergen.common.gemnet.layers.scaling import ScalingFactor + + +class AtomUpdateBlock(torch.nn.Module): + """ + Aggregate the message embeddings of the atoms + + Parameters + ---------- + emb_size_atom: int + Embedding size of the atoms. + emb_size_atom: int + Embedding size of the edges. + nHidden: int + Number of residual blocks. + activation: callable/str + Name of the activation function to use in the dense layers. + scale_file: str + Path to the json file containing the scaling factors. + """ + + def __init__( + self, + emb_size_atom: int, + emb_size_edge: int, + emb_size_rbf: int, + nHidden: int, + activation=None, + scale_file=None, + name: str = "atom_update", + ): + super().__init__() + self.name = name + + self.dense_rbf = Dense(emb_size_rbf, emb_size_edge, activation=None, bias=False) + self.scale_sum = ScalingFactor(scale_file=scale_file, name=name + "_sum") + + self.layers = self.get_mlp(emb_size_edge, emb_size_atom, nHidden, activation) + + def get_mlp( + self, units_in: int, units: int, nHidden: int, activation: str + ) -> torch.nn.ModuleList: + dense1 = Dense(units_in, units, activation=activation, bias=False) + mlp = [dense1] + res = [ResidualLayer(units, nLayers=2, activation=activation) for i in range(nHidden)] + mlp += res + return torch.nn.ModuleList(mlp) + + def forward( + self, h: torch.Tensor, m: torch.Tensor, rbf: torch.Tensor, id_j: torch.Tensor + ) -> torch.Tensor: + """ + Returns + ------- + h: torch.Tensor, shape=(nAtoms, emb_size_atom) + Atom embedding. + """ + nAtoms = h.shape[0] + + mlp_rbf = self.dense_rbf(rbf) # (nEdges, emb_size_edge) + x = m * mlp_rbf + + x2 = scatter(x, id_j, dim=0, dim_size=nAtoms, reduce="sum") + # (nAtoms, emb_size_edge) + x = self.scale_sum(m, x2) + + for layer in self.layers: + x = layer(x) # (nAtoms, emb_size_atom) + + return x + + +class OutputBlock(AtomUpdateBlock): + """ + Combines the atom update block and subsequent final dense layer. + + Parameters + ---------- + emb_size_atom: int + Embedding size of the atoms. + emb_size_atom: int + Embedding size of the edges. + nHidden: int + Number of residual blocks. + num_targets: int + Number of targets. + activation: str + Name of the activation function to use in the dense layers except for the final dense layer. + direct_forces: bool + If true directly predict forces without taking the gradient of the energy potential. + output_init: int + Kernel initializer of the final dense layer. + scale_file: str + Path to the json file containing the scaling factors. + """ + + def __init__( + self, + emb_size_atom: int, + emb_size_edge: int, + emb_size_rbf: int, + nHidden: int, + num_targets: int, + activation=None, + direct_forces=True, + output_init="HeOrthogonal", + scale_file=None, + name: str = "output", + **kwargs, + ): + super().__init__( + name=name, + emb_size_atom=emb_size_atom, + emb_size_edge=emb_size_edge, + emb_size_rbf=emb_size_rbf, + nHidden=nHidden, + activation=activation, + scale_file=scale_file, + ) + + assert isinstance(output_init, str) + self.output_init = output_init.lower() + self.direct_forces = direct_forces + + self.seq_energy = self.layers # inherited from parent class + self.out_energy = Dense(emb_size_atom, num_targets, bias=False, activation=None) + + if self.direct_forces: + self.scale_rbf_F = ScalingFactor(scale_file=scale_file, name=name + "_had") + self.seq_forces = self.get_mlp(emb_size_edge, emb_size_edge, nHidden, activation) + self.out_forces = Dense(emb_size_edge, num_targets, bias=False, activation=None) + self.dense_rbf_F = Dense(emb_size_rbf, emb_size_edge, activation=None, bias=False) + + self.reset_parameters() + + def reset_parameters(self): + if self.output_init == "heorthogonal": + self.out_energy.reset_parameters(he_orthogonal_init) + if self.direct_forces: + self.out_forces.reset_parameters(he_orthogonal_init) + elif self.output_init == "zeros": + self.out_energy.reset_parameters(torch.nn.init.zeros_) + if self.direct_forces: + self.out_forces.reset_parameters(torch.nn.init.zeros_) + else: + raise UserWarning(f"Unknown output_init: {self.output_init}") + + def forward( + self, h: torch.Tensor, m: torch.Tensor, rbf: torch.Tensor, id_j: torch.Tensor + ) -> Tuple[torch.Tensor, torch.Tensor]: + """ + Returns + ------- + (E, F): tuple + - E: torch.Tensor, shape=(nAtoms, num_targets) + - F: torch.Tensor, shape=(nEdges, num_targets) + Energy and force prediction + """ + nAtoms = h.shape[0] + + # -------------------------------------- Energy Prediction -------------------------------------- # + rbf_emb_E = self.dense_rbf(rbf) # (nEdges, emb_size_edge) + x = m * rbf_emb_E + + x_E = scatter(x, id_j, dim=0, dim_size=nAtoms, reduce="sum") + # (nAtoms, emb_size_edge) + x_E = self.scale_sum(m, x_E) + + for layer in self.seq_energy: + x_E = layer(x_E) # (nAtoms, emb_size_atom) + + x_E = self.out_energy(x_E) # (nAtoms, num_targets) + + # --------------------------------------- Force Prediction -------------------------------------- # + if self.direct_forces: + x_F = m + for i, layer in enumerate(self.seq_forces): + x_F = layer(x_F) # (nEdges, emb_size_edge) + + rbf_emb_F = self.dense_rbf_F(rbf) # (nEdges, emb_size_edge) + x_F_rbf = x_F * rbf_emb_F + x_F = self.scale_rbf_F(x_F, x_F_rbf) + + x_F = self.out_forces(x_F) # (nEdges, num_targets) + else: + x_F = 0 + # ----------------------------------------------------------------------------------------------- # + + return x_E, x_F diff --git a/data/mattergen/common/gemnet/layers/base_layers.py b/data/mattergen/common/gemnet/layers/base_layers.py new file mode 100644 index 0000000000000000000000000000000000000000..74a9a6b435d9e2ad9179aa49662fe4da0ddb2e44 --- /dev/null +++ b/data/mattergen/common/gemnet/layers/base_layers.py @@ -0,0 +1,112 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/layers/base_layers.py. +""" + +import math +from collections.abc import Callable +from typing import Optional + +import torch + +from mattergen.common.gemnet.initializers import he_orthogonal_init + + +class Dense(torch.nn.Module): + """ + Combines dense layer with scaling for swish activation. + + Parameters + ---------- + units: int + Output embedding size. + activation: str + Name of the activation function to use. + bias: bool + True if use bias. + """ + + def __init__( + self, + in_features: int, + out_features: int, + bias: bool = False, + activation: Optional[str] = None, + ): + super().__init__() + + self.linear = torch.nn.Linear(in_features, out_features, bias=bias) + self.reset_parameters() + + if isinstance(activation, str): + activation = activation.lower() + if activation in ["swish", "silu"]: + self._activation = ScaledSiLU() + elif activation == "siqu": + self._activation = SiQU() + elif activation is None: + self._activation = torch.nn.Identity() + else: + raise NotImplementedError("Activation function not implemented for GemNet (yet).") + + def reset_parameters(self, initializer: Callable = he_orthogonal_init): + initializer(self.linear.weight) + if self.linear.bias is not None: + self.linear.bias.data.fill_(0) + + def forward(self, x: torch.Tensor): + x = self.linear(x) + x = self._activation(x) + return x + + +class ScaledSiLU(torch.nn.Module): + def __init__(self): + super().__init__() + self.scale_factor = 1 / 0.6 + self._activation = torch.nn.SiLU() + + def forward(self, x: torch.Tensor): + return self._activation(x) * self.scale_factor + + +class SiQU(torch.nn.Module): + def __init__(self): + super().__init__() + self._activation = torch.nn.SiLU() + + def forward(self, x: torch.Tensor): + return x * self._activation(x) + + +class ResidualLayer(torch.nn.Module): + """ + Residual block with output scaled by 1/sqrt(2). + + Parameters + ---------- + units: int + Output embedding size. + nLayers: int + Number of dense layers. + layer_kwargs: str + Keyword arguments for initializing the layers. + """ + + def __init__(self, units: int, nLayers: int = 2, layer: Callable = Dense, **layer_kwargs): + super().__init__() + self.dense_mlp = torch.nn.Sequential( + *[ + layer(in_features=units, out_features=units, bias=False, **layer_kwargs) + for _ in range(nLayers) + ] + ) + self.inv_sqrt_2 = 1 / math.sqrt(2) + + def forward(self, input: torch.Tensor): + x = self.dense_mlp(input) + x = input + x + x = x * self.inv_sqrt_2 + return x diff --git a/data/mattergen/common/gemnet/layers/basis_utils.py b/data/mattergen/common/gemnet/layers/basis_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..a7520dbb677c573679d28b4976e1e07c7d46c7f7 --- /dev/null +++ b/data/mattergen/common/gemnet/layers/basis_utils.py @@ -0,0 +1,273 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/layers/basis_utils.py. +""" + +from typing import Any, List + +import numpy as np +import sympy as sym +from scipy import special as sp +from scipy.optimize import brentq + + +def Jn(r: np.array, n: int) -> np.array: + """ + numerical spherical bessel functions of order n + """ + return sp.spherical_jn(n, r) + + +def Jn_zeros(n: int, k: int) -> np.array: + """ + Compute the first k zeros of the spherical bessel functions up to order n (excluded) + """ + zerosj = np.zeros((n, k), dtype="float32") + zerosj[0] = np.arange(1, k + 1) * np.pi + points = np.arange(1, k + n) * np.pi + racines = np.zeros(k + n - 1, dtype="float32") + for i in range(1, n): + for j in range(k + n - 1 - i): + foo = brentq(Jn, points[j], points[j + 1], (i,)) + racines[j] = foo + points = racines + zerosj[i][:k] = racines[:k] + + return zerosj + + +def spherical_bessel_formulas(n: int) -> List[Any]: + """ + Computes the sympy formulas for the spherical bessel functions up to order n (excluded) + """ + x = sym.symbols("x") + # j_i = (-x)^i * (1/x * d/dx)^î * sin(x)/x + j = [sym.sin(x) / x] # j_0 + a = sym.sin(x) / x + for i in range(1, n): + b = sym.diff(a, x) / x + j += [sym.simplify(b * (-x) ** i)] + a = sym.simplify(b) + return j + + +def bessel_basis(n: int, k: int) -> List[Any]: + """ + Compute the sympy formulas for the normalized and rescaled spherical bessel functions up to + order n (excluded) and maximum frequency k (excluded). + + Returns: + bess_basis: list + Bessel basis formulas taking in a single argument x. + Has length n where each element has length k. -> In total n*k many. + """ + zeros = Jn_zeros(n, k) + normalizer = [] + for order in range(n): + normalizer_tmp = [] + for i in range(k): + normalizer_tmp += [0.5 * Jn(zeros[order, i], order + 1) ** 2] + normalizer_tmp = ( + 1 / np.array(normalizer_tmp) ** 0.5 + ) # sqrt(2/(j_l+1)**2) , sqrt(1/c**3) not taken into account yet + normalizer += [normalizer_tmp] + + f = spherical_bessel_formulas(n) + x = sym.symbols("x") + bess_basis = [] + for order in range(n): + bess_basis_tmp = [] + for i in range(k): + bess_basis_tmp += [ + sym.simplify(normalizer[order][i] * f[order].subs(x, zeros[order, i] * x)) + ] + bess_basis += [bess_basis_tmp] + return bess_basis + + +def sph_harm_prefactor(l_degree: int, m_order: int) -> float: + """Computes the constant pre-factor for the spherical harmonic of degree l and order m. + + Parameters + ---------- + l_degree: int + Degree of the spherical harmonic. l >= 0 + m_order: int + Order of the spherical harmonic. -l <= m <= l + + Returns + ------- + factor: float + + """ + # sqrt((2*l+1)/4*pi * (l-m)!/(l+m)! ) + return ( + (2 * l_degree + 1) + / (4 * np.pi) + * np.math.factorial(l_degree - abs(m_order)) + / np.math.factorial(l_degree + abs(m_order)) + ) ** 0.5 + + +def associated_legendre_polynomials( + L_maxdegree: int, zero_m_only: bool = True, pos_m_only: bool = True +) -> List[List[Any]]: + """Computes string formulas of the associated legendre polynomials up to degree L (excluded). + + Parameters + ---------- + L_maxdegree: int + Degree up to which to calculate the associated legendre polynomials (degree L is excluded). + zero_m_only: bool + If True only calculate the polynomials for the polynomials where m=0. + pos_m_only: bool + If True only calculate the polynomials for the polynomials where m>=0. Overwritten by zero_m_only. + + Returns + ------- + polynomials: list + Contains the sympy functions of the polynomials (in total L many if zero_m_only is True else L^2 many). + """ + # calculations from http://web.cmb.usc.edu/people/alber/Software/tomominer/docs/cpp/group__legendre__polynomials.html + z = sym.symbols("z") + P_l_m = [ + [0] * (2 * l_degree + 1) for l_degree in range(L_maxdegree) + ] # for order l: -l <= m <= l + + P_l_m[0][0] = 1 + if L_maxdegree > 0: + if zero_m_only: + # m = 0 + P_l_m[1][0] = z + for l_degree in range(2, L_maxdegree): + P_l_m[l_degree][0] = sym.simplify( + ( + (2 * l_degree - 1) * z * P_l_m[l_degree - 1][0] + - (l_degree - 1) * P_l_m[l_degree - 2][0] + ) + / l_degree + ) + else: + # for m >= 0 + for l_degree in range(1, L_maxdegree): + P_l_m[l_degree][l_degree] = sym.simplify( + (1 - 2 * l_degree) * (1 - z**2) ** 0.5 * P_l_m[l_degree - 1][l_degree - 1] + ) # P_00, P_11, P_22, P_33 + + for m_order in range(0, L_maxdegree - 1): + P_l_m[m_order + 1][m_order] = sym.simplify( + (2 * m_order + 1) * z * P_l_m[m_order][m_order] + ) # P_10, P_21, P_32, P_43 + + for l_degree in range(2, L_maxdegree): + for m_order in range(l_degree - 1): # P_20, P_30, P_31 + P_l_m[l_degree][m_order] = sym.simplify( + ( + (2 * l_degree - 1) * z * P_l_m[l_degree - 1][m_order] + - (l_degree + m_order - 1) * P_l_m[l_degree - 2][m_order] + ) + / (l_degree - m_order) + ) + + if not pos_m_only: + # for m < 0: P_l(-m) = (-1)^m * (l-m)!/(l+m)! * P_lm + for l_degree in range(1, L_maxdegree): + for m_order in range(1, l_degree + 1): # P_1(-1), P_2(-1) P_2(-2) + P_l_m[l_degree][-m_order] = sym.simplify( + (-1) ** m_order + * np.math.factorial(l_degree - m_order) + / np.math.factorial(l_degree + m_order) + * P_l_m[l_degree][m_order] + ) + + return P_l_m + + +def real_sph_harm( + L_maxdegree: int, use_theta: bool, use_phi: bool = True, zero_m_only: bool = True +) -> List[List[Any]]: + """ + Computes formula strings of the the real part of the spherical harmonics up to degree L (excluded). + Variables are either spherical coordinates phi and theta (or cartesian coordinates x,y,z) on the UNIT SPHERE. + + Parameters + ---------- + L_maxdegree: int + Degree up to which to calculate the spherical harmonics (degree L is excluded). + use_theta: bool + - True: Expects the input of the formula strings to contain theta. + - False: Expects the input of the formula strings to contain z. + use_phi: bool + - True: Expects the input of the formula strings to contain phi. + - False: Expects the input of the formula strings to contain x and y. + Does nothing if zero_m_only is True + zero_m_only: bool + If True only calculate the harmonics where m=0. + + Returns + ------- + Y_lm_real: list + Computes formula strings of the the real part of the spherical harmonics up + to degree L (where degree L is not excluded). + In total L^2 many sph harm exist up to degree L (excluded). However, if zero_m_only only is True then + the total count is reduced to be only L many. + """ + z = sym.symbols("z") + P_l_m = associated_legendre_polynomials(L_maxdegree, zero_m_only) + if zero_m_only: + # for all m != 0: Y_lm = 0 + Y_l_m = [sym.zeros(1) for l_degree in range(L_maxdegree)] + else: + Y_l_m = [ + sym.zeros(1) * (2 * l_degree + 1) for l_degree in range(L_maxdegree) + ] # for order l: -l <= m <= l + + # convert expressions to spherical coordinates + if use_theta: + # replace z by cos(theta) + theta = sym.symbols("theta") + for l_degree in range(L_maxdegree): + for m_order in range(len(P_l_m[l_degree])): + P_l_m[l_degree][m_order] = P_l_m[l_degree][m_order].subs(z, sym.cos(theta)) + + for l_degree in range(L_maxdegree): + Y_l_m[l_degree][0] = sym.simplify( + sph_harm_prefactor(l_degree, 0) * P_l_m[l_degree][0] + ) # Y_l0 + + if not zero_m_only: + phi = sym.symbols("phi") + for l_degree in range(1, L_maxdegree): + # m > 0 + for m_order in range(1, l_degree + 1): + Y_l_m[l_degree][m_order] = sym.simplify( + 2**0.5 + * (-1) ** m_order + * sph_harm_prefactor(l_degree, m_order) + * P_l_m[l_degree][m_order] + * sym.cos(m_order * phi) + ) + # m < 0 + for m_order in range(1, l_degree + 1): + Y_l_m[l_degree][-m_order] = sym.simplify( + 2**0.5 + * (-1) ** m_order + * sph_harm_prefactor(l_degree, -m_order) + * P_l_m[l_degree][m_order] + * sym.sin(m_order * phi) + ) + + # convert expressions to cartesian coordinates + if not use_phi: + # replace phi by atan2(y,x) + x = sym.symbols("x") + y = sym.symbols("y") + for l_degree in range(L_maxdegree): + for m_order in range(len(Y_l_m[l_degree])): + assert isinstance(Y_l_m[l_degree][m_order], int) + Y_l_m[l_degree][m_order] = sym.simplify( + Y_l_m[l_degree][m_order].subs(phi, sym.atan2(y, x)) + ) + return Y_l_m diff --git a/data/mattergen/common/gemnet/layers/efficient.py b/data/mattergen/common/gemnet/layers/efficient.py new file mode 100644 index 0000000000000000000000000000000000000000..461a62eea0874916be5c996412af287a1ce5749e --- /dev/null +++ b/data/mattergen/common/gemnet/layers/efficient.py @@ -0,0 +1,178 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/layers/efficient.py. +""" + +from warnings import warn + +import torch + +from mattergen.common.gemnet.initializers import he_orthogonal_init + + +class EfficientInteractionDownProjection(torch.nn.Module): + """ + Down projection in the efficient reformulation. + + Parameters + ---------- + emb_size_interm: int + Intermediate embedding size (down-projection size). + kernel_initializer: callable + Initializer of the weight matrix. + """ + + def __init__( + self, + num_spherical: int, + num_radial: int, + emb_size_interm: int, + ): + super().__init__() + + self.num_spherical = num_spherical + self.num_radial = num_radial + self.emb_size_interm = emb_size_interm + + self.reset_parameters() + + def reset_parameters(self): + self.weight = torch.nn.Parameter( + torch.empty((self.num_spherical, self.num_radial, self.emb_size_interm)), + requires_grad=True, + ) + he_orthogonal_init(self.weight) + + def forward(self, rbf, sph, id_ca, id_ragged_idx): + """ + + Arguments + --------- + rbf: torch.Tensor, shape=(1, nEdges, num_radial) + sph: torch.Tensor, shape=(nEdges, Kmax, num_spherical) + id_ca + id_ragged_idx + + Returns + ------- + rbf_W1: torch.Tensor, shape=(nEdges, emb_size_interm, num_spherical) + sph: torch.Tensor, shape=(nEdges, Kmax, num_spherical) + Kmax = maximum number of neighbors of the edges + """ + num_edges = rbf.shape[1] + + # MatMul: mul + sum over num_radial + rbf_W1 = torch.matmul(rbf, self.weight) + # (num_spherical, nEdges , emb_size_interm) + rbf_W1 = rbf_W1.permute(1, 2, 0) + # (nEdges, emb_size_interm, num_spherical) + + # Zero padded dense matrix + # maximum number of neighbors, catch empty id_ca with maximum + if sph.shape[0] == 0: + Kmax = 0 + else: + Kmax = torch.max( + torch.max(id_ragged_idx + 1), + torch.tensor(0).to(id_ragged_idx.device), + ) + + sph2 = sph.new_zeros(num_edges, Kmax, self.num_spherical) + sph2[id_ca, id_ragged_idx] = sph + + sph2 = torch.transpose(sph2, 1, 2) + # (nEdges, num_spherical/emb_size_interm, Kmax) + + return rbf_W1, sph2 + + +class EfficientInteractionBilinear(torch.nn.Module): + """ + Efficient reformulation of the bilinear layer and subsequent summation. + + Parameters + ---------- + units_out: int + Embedding output size of the bilinear layer. + kernel_initializer: callable + Initializer of the weight matrix. + """ + + def __init__( + self, + emb_size: int, + emb_size_interm: int, + units_out: int, + ): + super().__init__() + self.emb_size = emb_size + self.emb_size_interm = emb_size_interm + self.units_out = units_out + + self.reset_parameters() + + def reset_parameters(self): + self.weight = torch.nn.Parameter( + torch.empty( + (self.emb_size, self.emb_size_interm, self.units_out), + requires_grad=True, + ) + ) + he_orthogonal_init(self.weight) + + def forward( + self, + basis, + m, + id_reduce, + id_ragged_idx, + ): + """ + + Arguments + --------- + basis + m: quadruplets: m = m_db , triplets: m = m_ba + id_reduce + id_ragged_idx + + Returns + ------- + m_ca: torch.Tensor, shape=(nEdges, units_out) + Edge embeddings. + """ + # num_spherical is actually num_spherical**2 for quadruplets + (rbf_W1, sph) = basis + # (nEdges, emb_size_interm, num_spherical), (nEdges, num_spherical, Kmax) + nEdges = rbf_W1.shape[0] + + if nEdges == 0: + # shape=[0,0] + warn(f"Zero graph edges found in {self.__class__}") + return torch.zeros((0, 0)) + + # Create (zero-padded) dense matrix of the neighboring edge embeddings. + Kmax = torch.max( + torch.max(id_ragged_idx) + 1, + torch.tensor(0).to(id_ragged_idx.device), + ) + # maximum number of neighbors, catch empty id_reduce_ji with maximum + m2 = m.new_zeros(nEdges, Kmax, self.emb_size) + m2[id_reduce, id_ragged_idx] = m + # (num_quadruplets or num_triplets, emb_size) -> (nEdges, Kmax, emb_size) + + sum_k = torch.matmul(sph, m2) # (nEdges, num_spherical, emb_size) + + # MatMul: mul + sum over num_spherical + rbf_W1_sum_k = torch.matmul(rbf_W1, sum_k) + # (nEdges, emb_size_interm, emb_size) + + # Bilinear: Sum over emb_size_interm and emb_size + m_ca = torch.matmul(rbf_W1_sum_k.permute(2, 0, 1), self.weight) + # (emb_size, nEdges, units_out) + m_ca = torch.sum(m_ca, dim=0) + # (nEdges, units_out) + + return m_ca diff --git a/data/mattergen/common/gemnet/layers/embedding_block.py b/data/mattergen/common/gemnet/layers/embedding_block.py new file mode 100644 index 0000000000000000000000000000000000000000..f6b6631eb1f731454c7e58b6eb8dad86f93221a6 --- /dev/null +++ b/data/mattergen/common/gemnet/layers/embedding_block.py @@ -0,0 +1,103 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/layers/embedding_block.py. +""" + +import numpy as np +import torch + +from mattergen.common.gemnet.layers.base_layers import Dense +from mattergen.common.utils.globals import MAX_ATOMIC_NUM + + +class IdentityEmbedding(torch.nn.Identity): + """Embedding layer that just returns the input""" + + def __init__(self, emb_size): + super().__init__() + self.emb_size = emb_size + + +class AtomEmbedding(torch.nn.Module): + """ + Initial atom embeddings based on the atom type + + Parameters + ---------- + emb_size: int + Atom embeddings size + """ + + def __init__(self, emb_size, with_mask_type=False): + super().__init__() + self.emb_size = emb_size + + # Atom embeddings: We go up to Bi (83). + self.embeddings = torch.nn.Embedding(MAX_ATOMIC_NUM + int(with_mask_type), emb_size) + # init by uniform distribution + torch.nn.init.uniform_(self.embeddings.weight, a=-np.sqrt(3), b=np.sqrt(3)) + + def forward(self, Z): + """ + Returns + ------- + h: torch.Tensor, shape=(nAtoms, emb_size) + Atom embeddings. + """ + h = self.embeddings(Z - 1) # -1 because Z.min()=1 (==Hydrogen) + return h + + +class EdgeEmbedding(torch.nn.Module): + """ + Edge embedding based on the concatenation of atom embeddings and subsequent dense layer. + + Parameters + ---------- + emb_size: int + Embedding size after the dense layer. + activation: str + Activation function used in the dense layer. + """ + + def __init__( + self, + atom_features, + edge_features, + out_features, + activation=None, + ): + super().__init__() + in_features = 2 * atom_features + edge_features + self.dense = Dense(in_features, out_features, activation=activation, bias=False) + + def forward( + self, + h, + m_rbf, + idx_s, + idx_t, + ): + """ + + Arguments + --------- + h + m_rbf: shape (nEdges, nFeatures) + in embedding block: m_rbf = rbf ; In interaction block: m_rbf = m_st + idx_s + idx_t + + Returns + ------- + m_st: torch.Tensor, shape=(nEdges, emb_size) + Edge embeddings. + """ + h_s = h[idx_s] # shape=(nEdges, emb_size) + h_t = h[idx_t] # shape=(nEdges, emb_size) + + m_st = torch.cat([h_s, h_t, m_rbf], dim=-1) # (nEdges, 2*emb_size+nFeatures) + m_st = self.dense(m_st) # (nEdges, emb_size) + return m_st diff --git a/data/mattergen/common/gemnet/layers/interaction_block.py b/data/mattergen/common/gemnet/layers/interaction_block.py new file mode 100644 index 0000000000000000000000000000000000000000..47cf33df9b4f656d2931369e9b28004977ed2bd6 --- /dev/null +++ b/data/mattergen/common/gemnet/layers/interaction_block.py @@ -0,0 +1,344 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/layers/interaction_block.py. +""" + +import math + +import torch + +from mattergen.common.gemnet.layers.atom_update_block import AtomUpdateBlock +from mattergen.common.gemnet.layers.base_layers import Dense, ResidualLayer +from mattergen.common.gemnet.layers.efficient import EfficientInteractionBilinear +from mattergen.common.gemnet.layers.embedding_block import EdgeEmbedding +from mattergen.common.gemnet.layers.scaling import ScalingFactor + + +class InteractionBlockTripletsOnly(torch.nn.Module): + """ + Interaction block for GemNet-T/dT. + + Parameters + ---------- + emb_size_atom: int + Embedding size of the atoms. + emb_size_edge: int + Embedding size of the edges. + emb_size_trip: int + (Down-projected) Embedding size in the triplet message passing block. + emb_size_rbf: int + Embedding size of the radial basis transformation. + emb_size_cbf: int + Embedding size of the circular basis transformation (one angle). + + emb_size_bil_trip: int + Embedding size of the edge embeddings in the triplet-based message passing block after the bilinear layer. + num_before_skip: int + Number of residual blocks before the first skip connection. + num_after_skip: int + Number of residual blocks after the first skip connection. + num_concat: int + Number of residual blocks after the concatenation. + num_atom: int + Number of residual blocks in the atom embedding blocks. + + activation: str + Name of the activation function to use in the dense layers except for the final dense layer. + scale_file: str + Path to the json file containing the scaling factors. + """ + + def __init__( + self, + emb_size_atom, + emb_size_edge, + emb_size_trip, + emb_size_rbf, + emb_size_cbf, + emb_size_bil_trip, + num_before_skip, + num_after_skip, + num_concat, + num_atom, + activation=None, + scale_file=None, + name="Interaction", + ): + super().__init__() + self.name = name + self.skip_connection_factor = 2.0 ** (-0.5) + + block_nr = name.split("_")[-1] + + # -------------------------------------------- Message Passing ------------------------------------------- ## + # Dense transformation of skip connection + self.dense_ca = Dense( + emb_size_edge, + emb_size_edge, + activation=activation, + bias=False, + ) + + # Triplet Interaction + self.trip_interaction = TripletInteraction( + emb_size_edge=emb_size_edge, + emb_size_trip=emb_size_trip, + emb_size_bilinear=emb_size_bil_trip, + emb_size_rbf=emb_size_rbf, + emb_size_cbf=emb_size_cbf, + activation=activation, + scale_file=scale_file, + name=f"TripInteraction_{block_nr}", + ) + + # ---------------------------------------- Update Edge Embeddings ---------------------------------------- ## + # Residual layers before skip connection + self.layers_before_skip = torch.nn.ModuleList( + [ + ResidualLayer( + emb_size_edge, + activation=activation, + ) + for i in range(num_before_skip) + ] + ) + + # Residual layers after skip connection + self.layers_after_skip = torch.nn.ModuleList( + [ + ResidualLayer( + emb_size_edge, + activation=activation, + ) + for i in range(num_after_skip) + ] + ) + + # ---------------------------------------- Update Atom Embeddings ---------------------------------------- ## + self.atom_update = AtomUpdateBlock( + emb_size_atom=emb_size_atom, + emb_size_edge=emb_size_edge, + emb_size_rbf=emb_size_rbf, + nHidden=num_atom, + activation=activation, + scale_file=scale_file, + name=f"AtomUpdate_{block_nr}", + ) + + # ------------------------------ Update Edge Embeddings with Atom Embeddings ----------------------------- ## + self.concat_layer = EdgeEmbedding( + emb_size_atom, + emb_size_edge, + emb_size_edge, + activation=activation, + ) + self.residual_m = torch.nn.ModuleList( + [ResidualLayer(emb_size_edge, activation=activation) for _ in range(num_concat)] + ) + + self.inv_sqrt_2 = 1 / math.sqrt(2.0) + + def forward( + self, + h, + m, + rbf3, + cbf3, + id3_ragged_idx, + id_swap, + id3_ba, + id3_ca, + rbf_h, + idx_s, + idx_t, + ): + """ + Returns + ------- + h: torch.Tensor, shape=(nEdges, emb_size_atom) + Atom embeddings. + m: torch.Tensor, shape=(nEdges, emb_size_edge) + Edge embeddings (c->a). + """ + + # Initial transformation + x_ca_skip = self.dense_ca(m) # (nEdges, emb_size_edge) + + x3 = self.trip_interaction( + m, + rbf3, + cbf3, + id3_ragged_idx, + id_swap, + id3_ba, + id3_ca, + ) + + # ----------------------------- Merge Embeddings after Triplet Interaction ------------------------------ ## + x = x_ca_skip + x3 # (nEdges, emb_size_edge) + x = x * self.inv_sqrt_2 + + # ---------------------------------------- Update Edge Embeddings --------------------------------------- ## + # Transformations before skip connection + for i, layer in enumerate(self.layers_before_skip): + x = layer(x) # (nEdges, emb_size_edge) + + # Skip connection + m = m + x # (nEdges, emb_size_edge) + m = m * self.inv_sqrt_2 + + # Transformations after skip connection + for i, layer in enumerate(self.layers_after_skip): + m = layer(m) # (nEdges, emb_size_edge) + + # ---------------------------------------- Update Atom Embeddings --------------------------------------- ## + h2 = self.atom_update(h, m, rbf_h, idx_t) + + # Skip connection + h = h + h2 # (nAtoms, emb_size_atom) + h = h * self.skip_connection_factor + + # ----------------------------- Update Edge Embeddings with Atom Embeddings ----------------------------- ## + m2 = self.concat_layer(h, m, idx_s, idx_t) # (nEdges, emb_size_edge) + + for i, layer in enumerate(self.residual_m): + m2 = layer(m2) # (nEdges, emb_size_edge) + + # Skip connection + m = m + m2 # (nEdges, emb_size_edge) + m = m * self.inv_sqrt_2 + return h, m + + +class TripletInteraction(torch.nn.Module): + """ + Triplet-based message passing block. + + Parameters + ---------- + emb_size_edge: int + Embedding size of the edges. + emb_size_trip: int + (Down-projected) Embedding size of the edge embeddings after the hadamard product with rbf. + emb_size_bilinear: int + Embedding size of the edge embeddings after the bilinear layer. + emb_size_rbf: int + Embedding size of the radial basis transformation. + emb_size_cbf: int + Embedding size of the circular basis transformation (one angle). + + activation: str + Name of the activation function to use in the dense layers except for the final dense layer. + scale_file: str + Path to the json file containing the scaling factors. + """ + + def __init__( + self, + emb_size_edge, + emb_size_trip, + emb_size_bilinear, + emb_size_rbf, + emb_size_cbf, + activation=None, + scale_file=None, + name="TripletInteraction", + **kwargs, + ): + super().__init__() + self.name = name + + # Dense transformation + self.dense_ba = Dense( + emb_size_edge, + emb_size_edge, + activation=activation, + bias=False, + ) + + # Up projections of basis representations, bilinear layer and scaling factors + self.mlp_rbf = Dense( + emb_size_rbf, + emb_size_edge, + activation=None, + bias=False, + ) + self.scale_rbf = ScalingFactor(scale_file=scale_file, name=name + "_had_rbf") + + self.mlp_cbf = EfficientInteractionBilinear(emb_size_trip, emb_size_cbf, emb_size_bilinear) + self.scale_cbf_sum = ScalingFactor( + scale_file=scale_file, name=name + "_sum_cbf" + ) # combines scaling for bilinear layer and summation + + # Down and up projections + self.down_projection = Dense( + emb_size_edge, + emb_size_trip, + activation=activation, + bias=False, + ) + self.up_projection_ca = Dense( + emb_size_bilinear, + emb_size_edge, + activation=activation, + bias=False, + ) + self.up_projection_ac = Dense( + emb_size_bilinear, + emb_size_edge, + activation=activation, + bias=False, + ) + + self.inv_sqrt_2 = 1 / math.sqrt(2.0) + + def forward( + self, + m, + rbf3, + cbf3, + id3_ragged_idx, + id_swap, + id3_ba, + id3_ca, + ): + """ + Returns + ------- + m: torch.Tensor, shape=(nEdges, emb_size_edge) + Edge embeddings (c->a). + """ + + # Dense transformation + x_ba = self.dense_ba(m) # (nEdges, emb_size_edge) + + # Transform via radial bessel basis + rbf_emb = self.mlp_rbf(rbf3) # (nEdges, emb_size_edge) + x_ba2 = x_ba * rbf_emb + x_ba = self.scale_rbf(x_ba, x_ba2) + + x_ba = self.down_projection(x_ba) # (nEdges, emb_size_trip) + + # Transform via circular spherical basis + x_ba = x_ba[id3_ba] + + # Efficient bilinear layer + x = self.mlp_cbf(cbf3, x_ba, id3_ca, id3_ragged_idx) + # (nEdges, emb_size_quad) + x = self.scale_cbf_sum(x_ba, x) + + # => + # rbf(d_ba) + # cbf(d_ca, angle_cab) + + # Up project embeddings + x_ca = self.up_projection_ca(x) # (nEdges, emb_size_edge) + x_ac = self.up_projection_ac(x) # (nEdges, emb_size_edge) + + # Merge interaction of c->a and a->c + x_ac = x_ac[id_swap] # swap to add to edge a->c and not c->a + x3 = x_ca + x_ac + x3 = x3 * self.inv_sqrt_2 + return x3 diff --git a/data/mattergen/common/gemnet/layers/radial_basis.py b/data/mattergen/common/gemnet/layers/radial_basis.py new file mode 100644 index 0000000000000000000000000000000000000000..07e983cf85dd5c6e65a9d430da979b9b41566f8c --- /dev/null +++ b/data/mattergen/common/gemnet/layers/radial_basis.py @@ -0,0 +1,197 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/layers/radial_basis.py. +""" + +import math + +import numpy as np +import torch +from scipy.special import binom +from torch_geometric.nn.models.schnet import GaussianSmearing + + +class PolynomialEnvelope(torch.nn.Module): + """ + Polynomial envelope function that ensures a smooth cutoff. + + Parameters + ---------- + exponent: int + Exponent of the envelope function. + """ + + def __init__(self, exponent): + super().__init__() + assert exponent > 0 + self.p = exponent + self.a = -(self.p + 1) * (self.p + 2) / 2 + self.b = self.p * (self.p + 2) + self.c = -self.p * (self.p + 1) / 2 + + def forward(self, d_scaled): + env_val = ( + 1 + + self.a * d_scaled**self.p + + self.b * d_scaled ** (self.p + 1) + + self.c * d_scaled ** (self.p + 2) + ) + return torch.where(d_scaled < 1, env_val, torch.zeros_like(d_scaled)) + + +class ExponentialEnvelope(torch.nn.Module): + """ + Exponential envelope function that ensures a smooth cutoff, + as proposed in Unke, Chmiela, Gastegger, Schütt, Sauceda, Müller 2021. + SpookyNet: Learning Force Fields with Electronic Degrees of Freedom + and Nonlocal Effects + """ + + def __init__(self): + super().__init__() + + def forward(self, d_scaled): + env_val = torch.exp(-(d_scaled**2) / ((1 - d_scaled) * (1 + d_scaled))) + return torch.where(d_scaled < 1, env_val, torch.zeros_like(d_scaled)) + + +class SphericalBesselBasis(torch.nn.Module): + """ + 1D spherical Bessel basis + + Parameters + ---------- + num_radial: int + Controls maximum frequency. + cutoff: float + Cutoff distance in Angstrom. + """ + + def __init__( + self, + num_radial: int, + cutoff: float, + ): + super().__init__() + self.norm_const = math.sqrt(2 / (cutoff**3)) + # cutoff ** 3 to counteract dividing by d_scaled = d / cutoff + + # Initialize frequencies at canonical positions + self.frequencies = torch.nn.Parameter( + data=torch.tensor(np.pi * np.arange(1, num_radial + 1, dtype=np.float32)), + requires_grad=True, + ) + + def forward(self, d_scaled): + return ( + self.norm_const / d_scaled[:, None] * torch.sin(self.frequencies * d_scaled[:, None]) + ) # (num_edges, num_radial) + + +class BernsteinBasis(torch.nn.Module): + """ + Bernstein polynomial basis, + as proposed in Unke, Chmiela, Gastegger, Schütt, Sauceda, Müller 2021. + SpookyNet: Learning Force Fields with Electronic Degrees of Freedom + and Nonlocal Effects + + Parameters + ---------- + num_radial: int + Controls maximum frequency. + pregamma_initial: float + Initial value of exponential coefficient gamma. + Default: gamma = 0.5 * a_0**-1 = 0.94486, + inverse softplus -> pregamma = log e**gamma - 1 = 0.45264 + """ + + def __init__( + self, + num_radial: int, + pregamma_initial: float = 0.45264, + ): + super().__init__() + prefactor = binom(num_radial - 1, np.arange(num_radial)) + self.register_buffer( + "prefactor", + torch.tensor(prefactor, dtype=torch.float), + persistent=False, + ) + + self.pregamma = torch.nn.Parameter( + data=torch.tensor(pregamma_initial, dtype=torch.float), + requires_grad=True, + ) + self.softplus = torch.nn.Softplus() + + exp1 = torch.arange(num_radial) + self.register_buffer("exp1", exp1[None, :], persistent=False) + exp2 = num_radial - 1 - exp1 + self.register_buffer("exp2", exp2[None, :], persistent=False) + + def forward(self, d_scaled): + gamma = self.softplus(self.pregamma) # constrain to positive + exp_d = torch.exp(-gamma * d_scaled)[:, None] + return self.prefactor * (exp_d**self.exp1) * ((1 - exp_d) ** self.exp2) + + +class RadialBasis(torch.nn.Module): + """ + + Parameters + ---------- + num_radial: int + Controls maximum frequency. + cutoff: float + Cutoff distance in Angstrom. + rbf: dict = {"name": "gaussian"} + Basis function and its hyperparameters. + envelope: dict = {"name": "polynomial", "exponent": 5} + Envelope function and its hyperparameters. + """ + + def __init__( + self, + num_radial: int, + cutoff: float, + rbf: dict = {"name": "gaussian"}, + envelope: dict = {"name": "polynomial", "exponent": 5}, + ): + super().__init__() + self.inv_cutoff = 1 / cutoff + + env_name = envelope["name"].lower() + env_hparams = envelope.copy() + del env_hparams["name"] + + if env_name == "polynomial": + self.envelope = PolynomialEnvelope(**env_hparams) + elif env_name == "exponential": + self.envelope = ExponentialEnvelope() + else: + raise ValueError(f"Unknown envelope function '{env_name}'.") + + rbf_name = rbf["name"].lower() + rbf_hparams = rbf.copy() + del rbf_hparams["name"] + + # RBFs get distances scaled to be in [0, 1] + if rbf_name == "gaussian": + self.rbf = GaussianSmearing(start=0, stop=1, num_gaussians=num_radial, **rbf_hparams) + elif rbf_name == "spherical_bessel": + self.rbf = SphericalBesselBasis( + num_radial=num_radial, + cutoff=cutoff, + ) + elif rbf_name == "bernstein": + self.rbf = BernsteinBasis(num_radial=num_radial, **rbf_hparams) + else: + raise ValueError(f"Unknown radial basis function '{rbf_name}'.") + + def forward(self, d): + d_scaled = d * self.inv_cutoff + + env = self.envelope(d_scaled) + return env[:, None] * self.rbf(d_scaled) # (nEdges, num_radial) diff --git a/data/mattergen/common/gemnet/layers/scaling.py b/data/mattergen/common/gemnet/layers/scaling.py new file mode 100644 index 0000000000000000000000000000000000000000..b91dd43ce2c93a41fd51e77ef3f8eec0a0b2c378 --- /dev/null +++ b/data/mattergen/common/gemnet/layers/scaling.py @@ -0,0 +1,191 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/layers/scaling.py. +""" + +import logging + +import torch + +from mattergen.common.gemnet.utils import read_value_json, update_json + + +class AutomaticFit: + """ + All added variables are processed in the order of creation. + """ + + activeVar = None + queue = None + fitting_mode = False + + def __init__(self, variable, scale_file, name): + self.variable = variable # variable to find value for + self.scale_file = scale_file + self._name = name + + self._fitted = False + self.load_maybe() + + # first instance created + if AutomaticFit.fitting_mode and not self._fitted: + # if first layer set to active + if AutomaticFit.activeVar is None: + AutomaticFit.activeVar = self + AutomaticFit.queue = [] # initialize + # else add to queue + else: + self._add2queue() # adding variables to list fill fail in graph mode + + @classmethod + def reset( + self, + ): + AutomaticFit.activeVar = None + AutomaticFit.all_processed = False + + @classmethod + def fitting_completed( + self, + ): + return AutomaticFit.queue is None + + @classmethod + def set2fitmode( + self, + ): + AutomaticFit.reset() + AutomaticFit.fitting_mode = True + + def _add2queue(self): + logging.debug(f"Add {self._name} to queue.") + # check that same variable is not added twice + for var in AutomaticFit.queue: + if self._name == var._name: + raise ValueError( + f"Variable with the same name ({self._name}) was already added to queue!" + ) + AutomaticFit.queue += [self] + + def set_next_active(self): + """ + Set the next variable in the queue that should be fitted. + """ + queue = AutomaticFit.queue + if len(queue) == 0: + logging.debug("Processed all variables.") + AutomaticFit.queue = None + AutomaticFit.activeVar = None # reset to None + return + AutomaticFit.activeVar = queue.pop(0) + + def load_maybe(self): + """ + Load variable from file or set to initial value of the variable. + """ + value = read_value_json(self.scale_file, self._name) + if value is None: + logging.debug(f"Initialize variable {self._name}' to {self.variable.numpy():.3f}") + else: + self._fitted = True + logging.debug(f"Set scale factor {self._name} : {value}") + with torch.no_grad(): + self.variable.copy_(torch.tensor(value)) + + +class AutoScaleFit(AutomaticFit): + """ + Class to automatically fit the scaling factors depending on the observed variances. + + Parameters + ---------- + variable: torch.Tensor + Variable to fit. + scale_file: str + Path to the json file where to store/load from the scaling factors. + """ + + def __init__(self, variable, scale_file, name): + super().__init__(variable, scale_file, name) + + if not self._fitted: + self._init_stats() + + def _init_stats(self): + self.variance_in = 0 + self.variance_out = 0 + self.nSamples = 0 + + @torch.no_grad() + def observe(self, x, y): + """ + Observe variances for input x and output y. + The scaling factor alpha is calculated s.t. Var(alpha * y) ~ Var(x) + """ + if self._fitted: + return + + # only track stats for current variable + if AutomaticFit.activeVar == self: + nSamples = y.shape[0] + self.variance_in += torch.mean(torch.var(x, dim=0)).to(dtype=torch.float32) * nSamples + self.variance_out += torch.mean(torch.var(y, dim=0)).to(dtype=torch.float32) * nSamples + self.nSamples += nSamples + + @torch.no_grad() + def fit(self): + """ + Fit the scaling factor based on the observed variances. + """ + if AutomaticFit.activeVar == self: + if self.variance_in == 0: + raise ValueError( + f"Did not track the variable {self._name}. Add observe calls to track the variance before and after." + ) + + # calculate variance preserving scaling factor + self.variance_in = self.variance_in / self.nSamples + self.variance_out = self.variance_out / self.nSamples + + ratio = self.variance_out / self.variance_in + value = torch.sqrt(1 / ratio) + logging.info( + f"Variable: {self._name}, " + f"Var_in: {self.variance_in.item():.3f}, " + f"Var_out: {self.variance_out.item():.3f}, " + f"Ratio: {ratio:.3f} => Scaling factor: {value:.3f}" + ) + + # set variable to calculated value + self.variable.copy_(self.variable * value) + update_json(self.scale_file, {self._name: float(self.variable.item())}) + self.set_next_active() # set next variable in queue to active + + +class ScalingFactor(torch.nn.Module): + """ + Scale the output y of the layer s.t. the (mean) variance wrt. to the reference input x_ref is preserved. + + Parameters + ---------- + scale_file: str + Path to the json file where to store/load from the scaling factors. + name: str + Name of the scaling factor + """ + + def __init__(self, scale_file, name, device=None): + super().__init__() + + self.scale_factor = torch.nn.Parameter( + torch.tensor(1.0, device=device), requires_grad=False + ) + self.autofit = AutoScaleFit(self.scale_factor, scale_file, name) + + def forward(self, x_ref, y): + y = y * self.scale_factor + self.autofit.observe(x_ref, y) + + return y diff --git a/data/mattergen/common/gemnet/layers/spherical_basis.py b/data/mattergen/common/gemnet/layers/spherical_basis.py new file mode 100644 index 0000000000000000000000000000000000000000..28db577dca9b48d054b9415ed3698d74fc4a1817 --- /dev/null +++ b/data/mattergen/common/gemnet/layers/spherical_basis.py @@ -0,0 +1,83 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/layers/spherical_basis.py. +""" + +import sympy as sym +import torch +from torch_geometric.nn.models.schnet import GaussianSmearing + +from mattergen.common.gemnet.layers.basis_utils import real_sph_harm +from mattergen.common.gemnet.layers.radial_basis import RadialBasis + + +class CircularBasisLayer(torch.nn.Module): + """ + 2D Fourier Bessel Basis + + Parameters + ---------- + num_spherical: int + Controls maximum frequency. + radial_basis: RadialBasis + Radial basis functions + cbf: dict + Name and hyperparameters of the cosine basis function + efficient: bool + Whether to use the "efficient" summation order + """ + + def __init__( + self, + num_spherical: int, + radial_basis: RadialBasis, + cbf: dict, + efficient: bool = False, + ): + super().__init__() + + self.radial_basis = radial_basis + self.efficient = efficient + + cbf_name = cbf["name"].lower() + cbf_hparams = cbf.copy() + del cbf_hparams["name"] + + if cbf_name == "gaussian": + self.cosφ_basis = GaussianSmearing( + start=-1, stop=1, num_gaussians=num_spherical, **cbf_hparams + ) + elif cbf_name == "spherical_harmonics": + Y_lm = real_sph_harm(num_spherical, use_theta=False, zero_m_only=True) + sph_funcs = [] # (num_spherical,) + + # convert to tensorflow functions + z = sym.symbols("z") + modules = {"sin": torch.sin, "cos": torch.cos, "sqrt": torch.sqrt} + m_order = 0 # only single angle + for l_degree in range(len(Y_lm)): # num_spherical + if ( + l_degree == 0 + ): # Y_00 is only a constant -> function returns value and not tensor + first_sph = sym.lambdify([z], Y_lm[l_degree][m_order], modules) + sph_funcs.append(lambda z: torch.zeros_like(z) + first_sph(z)) + else: + sph_funcs.append(sym.lambdify([z], Y_lm[l_degree][m_order], modules)) + self.cosφ_basis = lambda cosφ: torch.stack([f(cosφ) for f in sph_funcs], dim=1) + else: + raise ValueError(f"Unknown cosine basis function '{cbf_name}'.") + + def forward(self, D_ca, cosφ_cab, id3_ca): + rbf = self.radial_basis(D_ca) # (num_edges, num_radial) + cbf = self.cosφ_basis(cosφ_cab) # (num_triplets, num_spherical) + + if not self.efficient: + rbf = rbf[id3_ca] # (num_triplets, num_radial) + out = (rbf[:, None, :] * cbf[:, :, None]).view(-1, rbf.shape[-1] * cbf.shape[-1]) + return (out,) + # (num_triplets, num_radial * num_spherical) + else: + return (rbf[None, :, :], cbf) + # (1, num_edges, num_radial), (num_edges, num_spherical) diff --git a/data/mattergen/common/gemnet/utils.py b/data/mattergen/common/gemnet/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..b675da529a31f60095a774845aad265f9c9e2f31 --- /dev/null +++ b/data/mattergen/common/gemnet/utils.py @@ -0,0 +1,299 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Adapted from https://github.com/FAIR-Chem/fairchem/blob/main/src/fairchem/core/models/gemnet/utils.py. +""" + +import json +from typing import Any, Dict, Optional, Tuple + +import torch +from torch_scatter import segment_csr + + +def read_json(path: str) -> Dict: + """""" + if not path.endswith(".json"): + raise UserWarning(f"Path {path} is not a json-path.") + + with open(path, "r") as f: + content = json.load(f) + return content + + +def update_json(path: str, data: Dict): + """""" + if not path.endswith(".json"): + raise UserWarning(f"Path {path} is not a json-path.") + + content = read_json(path) + content.update(data) + write_json(path, content) + + +def write_json(path: str, data: Dict): + """""" + if not path.endswith(".json"): + raise UserWarning(f"Path {path} is not a json-path.") + + with open(path, "w", encoding="utf-8") as f: + json.dump(data, f, ensure_ascii=False, indent=4) + + +def read_value_json(path: str, key: str) -> Optional[Any]: + """""" + content = read_json(path) + + if key in content.keys(): + return content[key] + else: + return None + + +def ragged_range(sizes: torch.Tensor) -> torch.Tensor: + """Multiple concatenated ranges. + + Examples + -------- + sizes = [1 4 2 3] + Return: [0 0 1 2 3 0 1 0 1 2] + """ + assert sizes.dim() == 1 + if sizes.sum() == 0: + return sizes.new_empty(0) + + # Remove 0 sizes + sizes_nonzero = sizes > 0 + if not torch.all(sizes_nonzero): + sizes = torch.masked_select(sizes, sizes_nonzero) + + # Initialize indexing array with ones as we need to setup incremental indexing + # within each group when cumulatively summed at the final stage. + id_steps = torch.ones(sizes.sum(), dtype=torch.long, device=sizes.device) + id_steps[0] = 0 + insert_index = sizes[:-1].cumsum(0) + insert_val = (1 - sizes)[:-1] + + # Assign index-offsetting values + id_steps[insert_index] = insert_val + + # Finally index into input array for the group repeated o/p + res = id_steps.cumsum(0) + return res + + +def repeat_blocks( + sizes: torch.Tensor, + repeats: torch.Tensor, + continuous_indexing: bool = True, + start_idx: int = 0, + block_inc: int = 0, + repeat_inc: int = 0, +) -> torch.Tensor: + """Repeat blocks of indices. + Adapted from https://stackoverflow.com/questions/51154989/numpy-vectorized-function-to-repeat-blocks-of-consecutive-elements + + continuous_indexing: Whether to keep increasing the index after each block + start_idx: Starting index + block_inc: Number to increment by after each block, + either global or per block. Shape: len(sizes) - 1 + repeat_inc: Number to increment by after each repetition, + either global or per block + + Examples + -------- + sizes = [1,3,2] ; repeats = [3,2,3] ; continuous_indexing = False + Return: [0 0 0 0 1 2 0 1 2 0 1 0 1 0 1] + sizes = [1,3,2] ; repeats = [3,2,3] ; continuous_indexing = True + Return: [0 0 0 1 2 3 1 2 3 4 5 4 5 4 5] + sizes = [1,3,2] ; repeats = [3,2,3] ; continuous_indexing = True ; + repeat_inc = 4 + Return: [0 4 8 1 2 3 5 6 7 4 5 8 9 12 13] + sizes = [1,3,2] ; repeats = [3,2,3] ; continuous_indexing = True ; + start_idx = 5 + Return: [5 5 5 6 7 8 6 7 8 9 10 9 10 9 10] + sizes = [1,3,2] ; repeats = [3,2,3] ; continuous_indexing = True ; + block_inc = 1 + Return: [0 0 0 2 3 4 2 3 4 6 7 6 7 6 7] + sizes = [0,3,2] ; repeats = [3,2,3] ; continuous_indexing = True + Return: [0 1 2 0 1 2 3 4 3 4 3 4] + sizes = [2,3,2] ; repeats = [2,0,2] ; continuous_indexing = True + Return: [0 1 0 1 5 6 5 6] + """ + assert sizes.dim() == 1 + assert all(sizes >= 0) + + # Remove 0 sizes + sizes_nonzero = sizes > 0 + if not torch.all(sizes_nonzero): + assert block_inc == 0 # Implementing this is not worth the effort + sizes = torch.masked_select(sizes, sizes_nonzero) + if isinstance(repeats, torch.Tensor): + repeats = torch.masked_select(repeats, sizes_nonzero) + if isinstance(repeat_inc, torch.Tensor): + repeat_inc = torch.masked_select(repeat_inc, sizes_nonzero) + + if isinstance(repeats, torch.Tensor): + assert all(repeats >= 0) + insert_dummy = repeats[0] == 0 + if insert_dummy: + one = sizes.new_ones(1) + zero = sizes.new_zeros(1) + sizes = torch.cat((one, sizes)) + repeats = torch.cat((one, repeats)) + if isinstance(block_inc, torch.Tensor): + block_inc = torch.cat((zero, block_inc)) + if isinstance(repeat_inc, torch.Tensor): + repeat_inc = torch.cat((zero, repeat_inc)) + else: + assert repeats >= 0 + insert_dummy = False + + # Get repeats for each group using group lengths/sizes + r1 = torch.repeat_interleave(torch.arange(len(sizes), device=sizes.device), repeats) + + # Get total size of output array, as needed to initialize output indexing array + N = (sizes * repeats).sum() + + # Initialize indexing array with ones as we need to setup incremental indexing + # within each group when cumulatively summed at the final stage. + # Two steps here: + # 1. Within each group, we have multiple sequences, so setup the offsetting + # at each sequence lengths by the seq. lengths preceding those. + id_ar = torch.ones(N, dtype=torch.long, device=sizes.device) + id_ar[0] = 0 + insert_index = sizes[r1[:-1]].cumsum(0) + insert_val = (1 - sizes)[r1[:-1]] + + if isinstance(repeats, torch.Tensor) and torch.any(repeats == 0): + diffs = r1[1:] - r1[:-1] + indptr = torch.cat((sizes.new_zeros(1), diffs.cumsum(0))) + if continuous_indexing: + # If a group was skipped (repeats=0) we need to add its size + insert_val += segment_csr(sizes[: r1[-1]], indptr, reduce="sum") + + # Add block increments + if isinstance(block_inc, torch.Tensor): + insert_val += segment_csr(block_inc[: r1[-1]], indptr, reduce="sum") + else: + insert_val += block_inc * (indptr[1:] - indptr[:-1]) + if insert_dummy: + insert_val[0] -= block_inc + else: + idx = r1[1:] != r1[:-1] + if continuous_indexing: + # 2. For each group, make sure the indexing starts from the next group's + # first element. So, simply assign 1s there. + insert_val[idx] = 1 + + # Add block increments + insert_val[idx] += block_inc + + # Add repeat_inc within each group + if isinstance(repeat_inc, torch.Tensor): + insert_val += repeat_inc[r1[:-1]] + if isinstance(repeats, torch.Tensor): + repeat_inc_inner = repeat_inc[repeats > 0][:-1] + else: + repeat_inc_inner = repeat_inc[:-1] + else: + insert_val += repeat_inc + repeat_inc_inner = repeat_inc + + # Subtract the increments between groups + if isinstance(repeats, torch.Tensor): + repeats_inner = repeats[repeats > 0][:-1] + else: + repeats_inner = repeats + insert_val[r1[1:] != r1[:-1]] -= repeat_inc_inner * repeats_inner + + # Assign index-offsetting values + id_ar[insert_index] = insert_val + + if insert_dummy: + id_ar = id_ar[1:] + if continuous_indexing: + id_ar[0] -= 1 + + # Set start index now, in case of insertion due to leading repeats=0 + id_ar[0] += start_idx + + # Finally index into input array for the group repeated o/p + res = id_ar.cumsum(0) + return res + + +def calculate_interatomic_vectors( + R: torch.Tensor, id_s: torch.Tensor, id_t: torch.Tensor, offsets_st: torch.Tensor +) -> Tuple[torch.Tensor, torch.Tensor]: + """ + Calculate the vectors connecting the given atom pairs, + considering offsets from periodic boundary conditions (PBC). + + Parameters + ---------- + R: Tensor, shape = (nAtoms, 3) + Atom positions. + id_s: Tensor, shape = (nEdges,) + Indices of the source atom of the edges. + id_t: Tensor, shape = (nEdges,) + Indices of the target atom of the edges. + offsets_st: Tensor, shape = (nEdges,) + PBC offsets of the edges. + Subtract this from the correct direction. + + Returns + ------- + (D_st, V_st): tuple + D_st: Tensor, shape = (nEdges,) + Distance from atom t to s. + V_st: Tensor, shape = (nEdges,) + Unit direction from atom t to s. + """ + Rs = R[id_s] + Rt = R[id_t] + # ReLU prevents negative numbers in sqrt + if offsets_st is None: + V_st = Rt - Rs # s -> t + else: + V_st = Rt - Rs + offsets_st # s -> t + D_st = torch.sqrt(torch.sum(V_st**2, dim=1)) + V_st = V_st / D_st[..., None] + return D_st, V_st + + +def inner_product_normalized(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor: + """ + Calculate the inner product between the given normalized vectors, + giving a result between -1 and 1. + """ + return torch.sum(x * y, dim=-1).clamp(min=-1, max=1) + + +def mask_neighbors(neighbors: torch.Tensor, edge_mask: torch.Tensor) -> torch.Tensor: + neighbors_old_indptr = torch.cat([neighbors.new_zeros(1), neighbors]) + neighbors_old_indptr = torch.cumsum(neighbors_old_indptr, dim=0) + neighbors = segment_csr(edge_mask.long(), neighbors_old_indptr) + return neighbors + + +def get_k_index_product_set( + num_k_x: torch.LongTensor, num_k_y: torch.LongTensor, num_k_z: torch.LongTensor +) -> tuple[torch.FloatTensor, int]: + # Get a box of k-lattice indices around (0,0,0) + k_index_sets = ( + torch.arange(-num_k_x, num_k_x + 1, dtype=torch.float), + torch.arange(-num_k_y, num_k_y + 1, dtype=torch.float), + torch.arange(-num_k_z, num_k_z + 1, dtype=torch.float), + ) + k_index_product_set = torch.cartesian_prod(*k_index_sets) + # Because our "signal" is real-valued, for the Fourier transform it holds that + # F(omega) = F*(-omega) (where F* is the complex conjugate of F). Thus, we only + # need to consider the positive half of the Fourier space. + k_index_product_set = k_index_product_set[k_index_product_set.shape[0] // 2 + 1 :] + + # Amount of k-points + num_k_degrees_of_freedom = k_index_product_set.shape[0] + + return k_index_product_set, num_k_degrees_of_freedom diff --git a/data/mattergen/common/globals.py b/data/mattergen/common/globals.py new file mode 100644 index 0000000000000000000000000000000000000000..911e89fddf2d67e5ac33b0173b900e175ff5deed --- /dev/null +++ b/data/mattergen/common/globals.py @@ -0,0 +1,8 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from pathlib import Path + +PROJECT_ROOT = Path(__file__).resolve().parent.parent +GENERATED_CRYSTALS_ZIP_FILE_NAME = "generated_crystals_cif.zip" +GENERATED_CRYSTALS_EXTXYZ_FILE_NAME = "generated_crystals.extxyz" diff --git a/data/mattergen/common/loss.py b/data/mattergen/common/loss.py new file mode 100644 index 0000000000000000000000000000000000000000..d7808219ce65485696c153acf3a6efae8dd35f80 --- /dev/null +++ b/data/mattergen/common/loss.py @@ -0,0 +1,56 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from functools import partial +from typing import Dict, Literal, Optional + +from mattergen.diffusion.losses import SummedFieldLoss, denoising_score_matching +from mattergen.diffusion.model_target import ModelTarget +from mattergen.diffusion.training.field_loss import FieldLoss, d3pm_loss +from mattergen.diffusion.wrapped.wrapped_normal_loss import wrapped_normal_loss + + +class MaterialsLoss(SummedFieldLoss): + def __init__( + self, + reduce: Literal["sum", "mean"] = "mean", + d3pm_hybrid_lambda: float = 0.0, + include_pos: bool = True, + include_cell: bool = True, + include_atomic_numbers: bool = True, + weights: Optional[Dict[str, float]] = None, + ): + model_targets = {"pos": ModelTarget.score_times_std, "cell": ModelTarget.score_times_std} + self.fields_to_score = [] + self.categorical_fields = [] + loss_fns: Dict[str, FieldLoss] = {} + if include_pos: + self.fields_to_score.append("pos") + loss_fns["pos"] = partial( + wrapped_normal_loss, + reduce=reduce, + model_target=model_targets["pos"], + ) + if include_cell: + self.fields_to_score.append("cell") + loss_fns["cell"] = partial( + denoising_score_matching, + reduce=reduce, + model_target=model_targets["cell"], + ) + if include_atomic_numbers: + model_targets["atomic_numbers"] = ModelTarget.logits + self.fields_to_score.append("atomic_numbers") + self.categorical_fields.append("atomic_numbers") + loss_fns["atomic_numbers"] = partial( + d3pm_loss, + reduce=reduce, + d3pm_hybrid_lambda=d3pm_hybrid_lambda, + ) + self.reduce = reduce + self.d3pm_hybrid_lambda = d3pm_hybrid_lambda + super().__init__( + loss_fns=loss_fns, + weights=weights, + model_targets=model_targets, + ) diff --git a/data/mattergen/common/tests/__init__.py b/data/mattergen/common/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/common/tests/data_utils_test.py b/data/mattergen/common/tests/data_utils_test.py new file mode 100644 index 0000000000000000000000000000000000000000..cdce996de1660a3f45411e7cfeeef9da6084281a --- /dev/null +++ b/data/mattergen/common/tests/data_utils_test.py @@ -0,0 +1,536 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Adapted from https://github.com/txie-93/cdvae/blob/main/cdvae/common/data_utils_test.py. +# Published under MIT license: https://github.com/txie-93/cdvae/blob/main/LICENSE. + +from collections import Counter +from itertools import product +from typing import Dict, Optional, Tuple + +import numpy as np +import pytest +import torch +from pymatgen.core.structure import Structure +from pymatgen.transformations.standard_transformations import RotationTransformation + +from mattergen.common.tests.testutils import get_mp_20_debug_batch +from mattergen.common.utils import data_utils + + +def test_lattice_params_matrix(): + a, b, c = 4.0, 3.0, 2.0 + alpha, beta, gamma = 120.0, 90.0, 90.0 + + matrix = data_utils.lattice_params_to_matrix(a, b, c, alpha, beta, gamma) + result = data_utils.lattice_matrix_to_params(matrix) + + assert np.allclose([a, b, c, alpha, beta, gamma], result) + + +def test_lattice_params_matrix2(): + matrix = [ + [3.96686600e00, 0.00000000e00, 2.42900487e-16], + [-2.42900487e-16, 3.96686600e00, 2.42900487e-16], + [0.00000000e00, 0.00000000e00, 5.73442000e00], + ] + matrix = np.array(matrix) + params = data_utils.lattice_matrix_to_params(matrix) + result = data_utils.lattice_params_to_matrix(*params) + + assert np.allclose(matrix, result) + + +def test_lattice_params_to_matrix_torch(): + lengths = np.array([[4.0, 3.0, 2.0], [1, 3, 2]]) + angles = np.array([[120.0, 90.0, 90.0], [57.0, 130.0, 85.0]]) + + lengths_and_angles = np.concatenate([lengths, angles], axis=-1) + + matrix0 = data_utils.lattice_params_to_matrix(*lengths_and_angles[0].tolist()) + matrix1 = data_utils.lattice_params_to_matrix(*lengths_and_angles[1].tolist()) + + true_matrix = np.stack([matrix0, matrix1], axis=0) + + torch_matrix = data_utils.lattice_params_to_matrix_torch( + torch.Tensor(lengths), torch.Tensor(angles) + ) + + assert np.allclose(true_matrix, torch_matrix.numpy(), atol=1e-5) + + +def test_lattice_matrix_to_params_torch(): + lengths = np.array([[4.0, 3.0, 2.0], [1, 3, 2]]) + angles = np.array([[120.0, 90.0, 90.0], [57.0, 130.0, 85.0]]) + + torch_matrix = data_utils.lattice_params_to_matrix_torch( + torch.Tensor(lengths), torch.Tensor(angles) + ) + torch_lengths, torch_angles = data_utils.lattice_matrix_to_params_torch(torch_matrix) + assert np.allclose(lengths, torch_lengths.numpy(), atol=1e-5) + assert np.allclose(angles, torch_angles.numpy(), atol=1e-5) + + +def test_frac_cart_conversion(): + num_atoms = torch.LongTensor([4, 3, 2, 5]) + lengths = torch.rand(num_atoms.size(0), 3) * 4 + angles = torch.rand(num_atoms.size(0), 3) * 60 + 60 + frac_coords = torch.rand(num_atoms.sum(), 3) + + cart_coords = data_utils.frac_to_cart_coords(frac_coords, lengths, angles, num_atoms) + + inverted_frac_coords = data_utils.cart_to_frac_coords(cart_coords, lengths, angles, num_atoms) + + assert torch.allclose(frac_coords, inverted_frac_coords, atol=1e-5, rtol=1e-3) + + +def test_get_pbc_distances(): + frac_coords = torch.Tensor([[0.2, 0.2, 0.0], [0.6, 0.8, 0.8], [0.2, 0.2, 0.0], [0.6, 0.8, 0.8]]) + edge_index = torch.LongTensor([[1, 0], [0, 0], [2, 3]]).T + lengths = torch.Tensor([[1.0, 1.0, 2.0], [1.0, 2.0, 1.0]]) + angles = torch.Tensor([[90.0, 90.0, 90.0], [90.0, 90.0, 90.0]]) + to_jimages = torch.LongTensor([[0, 0, 0], [0, 1, 0], [0, 1, 0]]) + num_nodes = torch.LongTensor([2, 2]) + num_edges = torch.LongTensor([2, 1]) + + lattice = data_utils.lattice_params_to_matrix_torch(lengths, angles) + out = data_utils.get_pbc_distances( + frac_coords, edge_index, lattice, to_jimages, num_nodes, num_edges + ) + + true_distances = torch.Tensor([1.7549928774784245, 1.0, 1.2]) + + assert torch.allclose(true_distances, out["distances"]) + + +def test_get_pbc_distances_cart(): + frac_coords = torch.Tensor([[0.2, 0.2, 0.0], [0.6, 0.8, 0.8], [0.2, 0.2, 0.0], [0.6, 0.8, 0.8]]) + edge_index = torch.LongTensor([[1, 0], [0, 0], [2, 3]]).T + lengths = torch.Tensor([[1.0, 1.0, 2.0], [1.0, 2.0, 1.0]]) + angles = torch.Tensor([[90.0, 90.0, 90.0], [90.0, 90.0, 90.0]]) + to_jimages = torch.LongTensor([[0, 0, 0], [0, 1, 0], [0, 1, 0]]) + num_nodes = torch.LongTensor([2, 2]) + num_edges = torch.LongTensor([2, 1]) + + cart_coords = data_utils.frac_to_cart_coords(frac_coords, lengths, angles, num_nodes) + + lattice = data_utils.lattice_params_to_matrix_torch(lengths, angles) + out = data_utils.get_pbc_distances( + cart_coords, + edge_index, + lattice, + to_jimages, + num_nodes, + num_edges, + coord_is_cart=True, + ) + + true_distances = torch.Tensor([1.7549928774784245, 1.0, 1.2]) + + assert torch.allclose(true_distances, out["distances"]) + + +@pytest.mark.parametrize( + "max_radius,max_neighbors", + [ + (5.5964, 100), + (5.6, 100), + (100.0, 100), + (7.0, 14), + (7.0, 15), + ], +) +def test_pbc_graph_translation_invariant(max_radius: float, max_neighbors: int): + # if we perform in 32 bit for (max_radius, max_neighbors) = (5.596532197709578, 100) + # simple cubic lattice + lengths = torch.tensor([4.0, 4.0, 4.0])[None, :] + angles = torch.tensor([90.0, 90.0, 90.0])[None, :] + frac_coords = torch.tensor([[0.2, 0.0, 0.0], [0.9927, 0.5, 0.5]]) + num_atoms = torch.tensor([2]) + + cart_coords = data_utils.frac_to_cart_coords(frac_coords, lengths, angles, num_atoms) + # global translation, which should not affect the neighbor graph + translation = torch.tensor([[0.05, 0.1, -0.04]]) + cart_coords_translated = cart_coords + translation + frac_coords_translated = data_utils.cart_to_frac_coords( + cart_coords_translated, lengths, angles, num_atoms + ) + cart_coords_translated = data_utils.frac_to_cart_coords( + frac_coords_translated, lengths, angles, num_atoms + ) + + lattice = data_utils.lattice_params_to_matrix_torch(lengths=lengths, angles=angles) + + coords = {"original": cart_coords, "translated": cart_coords_translated} + + # mypy complains without this type annotation + output: Dict[str, Dict[str, Dict[int, torch.Tensor]]] = { + coord: { + output_type: { + max_cells: {c: torch.tensor([0]) for c in coords.keys()} for max_cells in [1, 2] + } + for output_type in ["edge_index", "to_jimages", "num_bonds"] + } + for coord in coords.keys() + } + + for coord in coords.keys(): + for max_cells in [2, 3]: + ( + output[coord]["edge_index"][max_cells], + output[coord]["to_jimages"][max_cells], + output[coord]["num_bonds"][max_cells], + ) = data_utils.radius_graph_pbc( + cart_coords=coords[coord], + lattice=lattice, + num_atoms=num_atoms, + radius=max_radius, + max_num_neighbors_threshold=max_neighbors, + max_cell_images_per_dim=max_cells, + ) + + for max_cell in [2, 3]: + # max_cell>2 should be fine for this system + counter1 = Counter( + [tuple(x) for x in output["original"]["edge_index"][max_cell].t().tolist()] + ) + counter2 = Counter( + [tuple(x) for x in output["translated"]["edge_index"][max_cell].t().tolist()] + ) + assert counter1 == counter2 + assert torch.equal( + output["original"]["num_bonds"][max_cell], output["translated"]["num_bonds"][max_cell] + ) + + +def get_random_rotation( + n_random: int, n_atom: Optional[int] = None +) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: + # randomly generate lattice + lattice = torch.normal(mean=0, std=1, size=(3, 3)) + + if n_atom is None: + # uniformly pick number of atoms between [1,16] inclusive + number_atoms = torch.randint(1, 17, (1,)) + else: + number_atoms = torch.tensor([n_atom]) + + # shape=[number_atoms, 3], ~U[0,1] + frac_coord = torch.rand(size=(number_atoms[0], 3)) + + structure = Structure( + species=["C" for _ in range(number_atoms[0])], + lattice=lattice.numpy(), + coords=frac_coord.numpy(), + ) + + # rotation axies respect to cell vectors: np.ndarray, shape=[n_random, 3], dtype=int in [0, 1] + random_axes = np.random.choice([0, 1], size=(n_random, 3)) + + for ii, axis in enumerate(random_axes): + if np.allclose(axis, [0, 0, 0]): + # will get nans if we try to rotate along (0,0,0) axis + random_axes[ii] = [1, 0, 0] + + # random rotation angles between [0,90] degrees, shape=(n_random,) + random_angles = np.random.rand(n_random) * 90 + + # List[pymatgen.core.structure.Structure], shape=(n_random,) + structures = [ + RotationTransformation(axis=axis, angle=angle).apply_transformation(structure) + for (axis, angle) in zip(random_axes, random_angles) + ] + + # shape=(n_random, 3, 3) + lattices = torch.tensor( + np.asarray([s.lattice._matrix for s in structures]), dtype=torch.float32 + ) + + # frac coords are constant under rotation, shape=(n_random*Natom, 3) + frac_coords = ( + torch.tensor(structure.frac_coords, dtype=torch.float32) + .expand((n_random, number_atoms[0], 3)) + .flatten(end_dim=1) + ) + + # shape=(n_random, ) + num_atoms = torch.tensor([structure.frac_coords.shape[0]]).expand(n_random) + + return ( + data_utils.frac_to_cart_coords_with_lattice( + frac_coords=frac_coords, lattice=lattices, num_atoms=num_atoms + ), + lattices, + num_atoms, + ) + + +def get_random_translation(n_random: int, n_atom: Optional[int] = None): + # randomly generate lattice + lattice = torch.normal(mean=0, std=0.5, size=(3, 3)) + + # make sure lattice is not incredibly skew as we could need an infinite number of + # periodic cells in principle + lattice[torch.eye(3).byte()] = torch.normal(mean=0, std=1, size=(3,)) + + if n_atom is None: + # uniformly pick number of atoms between [1,16] inclusive + number_atoms = torch.randint(1, 17, (1,)) + else: + number_atoms = torch.tensor([n_atom]) + + # shape=[number_atoms, 3], ~U[0,1] + frac_coord = torch.rand(size=(number_atoms[0], 3)) + + # number of atom in each crystal, shape=[n_random] + natoms = torch.tensor([frac_coord.shape[0]]).expand(n_random) + + # shape=[n_random, 3, 3] + multiple_lattices = lattice.expand([n_random, 3, 3]) + + # shape=[n_random, Natm, 3] + translation = torch.rand(size=(n_random, 1, 3)).expand((n_random, frac_coord.shape[0], 3)) + + # shape=[n_random, Natm, 3] + new_frac_coord = frac_coord.expand((n_random, frac_coord.shape[0], 3)) + translation + + # ensure all fractional coordinates are between [0,1] inclusive + new_frac_coord = new_frac_coord % 1 + + # shape=[n_random*Natm, 3] + new_frac_coord = new_frac_coord.flatten(end_dim=1) + + # map back to within unit cell and make cartesian, shape=[n_random*Natm, 3] + new_cart_coord = data_utils.frac_to_cart_coords_with_lattice( + frac_coords=new_frac_coord, lattice=multiple_lattices, num_atoms=natoms + ) + + return new_cart_coord, multiple_lattices, natoms + + +def check_invariance( + max_radius: float, + max_cell_images_per_dim: int, + cart: torch.Tensor, + lattice: torch.Tensor, + num_atoms: torch.Tensor, +): + # cart.shape=(Ncrystals*Natoms, 3) + # lattice.shape=(Ncrystals, 3, 3) + # num_atoms.shape=(Ncrystals,) + + max_neighbors = 100 + + edges, _, num_bonds = data_utils.radius_graph_pbc( + cart_coords=cart, + lattice=lattice, + num_atoms=num_atoms, + radius=max_radius, + max_num_neighbors_threshold=max_neighbors, + max_cell_images_per_dim=max_cell_images_per_dim, + ) + + edges = edges.numpy() + + # group bonds by crystal + start_from = np.asarray(np.hstack((np.zeros(1), np.cumsum(num_bonds))), dtype=int) + + counters = [] + for ii in range(len(start_from) - 1): + # transpose shape to [Nbonds, 2] + bond_subset = edges.T[start_from[ii] : start_from[ii + 1]] + + # bond indices are cumulatice over crystals + offset = num_atoms[0] * ii + + # ensure all atom indices are 0-offset in a single crystal + bond_subset -= offset.numpy() + + # print(len(bond_subset)) + + # counter for bond pairs + counters.append(Counter([tuple(x) for x in bond_subset])) + + # convert Counter to str so can hash and count + count_counters = Counter([f"{c}" for c in counters]) + + assert len(set([len(c) for c in counters])) == 1, set([len(c) for c in counters]) + assert len(count_counters) == 1, count_counters + + +@pytest.mark.parametrize( + "max_radius, max_cell_images", + [ + (3.0, 1), + (7.0, 1), + (3.0, 2), + (7.0, 2), + (3.0, 3), + (7.0, 3), + ], +) +def test_rotation_invariance(max_radius: float, max_cell_images: int): + cart, lattice, num_atoms = get_random_rotation(n_random=10) + check_invariance( + max_radius=max_radius, + max_cell_images_per_dim=max_cell_images, + cart=cart, + lattice=lattice, + num_atoms=num_atoms, + ) + + +@pytest.mark.parametrize( + "max_radius, max_cell_images", + [ + (3.0, 10), # we have random lattice matrices so need a generous number of max cell images + (7.0, 20), + ], +) +def test_translation_invariance(max_radius: float, max_cell_images: int): + cart, lattice, num_atoms = get_random_translation(n_random=10) + check_invariance( + max_radius=max_radius, + max_cell_images_per_dim=max_cell_images, + cart=cart, + lattice=lattice, + num_atoms=num_atoms, + ) + + +def get_distances_pymatgen(structure: Structure, rcut: float) -> np.ndarray: + neigh = structure.get_all_neighbors(r=rcut, include_image=True) + dist = sorted( + np.asarray([n.nn_distance for _atom in neigh for n in _atom if n.nn_distance > 1e-12]) + ) + return np.asarray(dist) + + +def get_distance_pytorch(structure: Structure, rcut: float) -> np.ndarray: + cart_coords = torch.tensor(structure.cart_coords, dtype=torch.float32) + lattice = torch.tensor([structure.lattice._matrix], dtype=torch.float32) + num_atoms = torch.tensor([cart_coords.shape[0]], dtype=torch.int32) + + edges, images, num_bonds = data_utils.radius_graph_pbc( + cart_coords=cart_coords, + lattice=lattice, + num_atoms=num_atoms, + radius=rcut, + max_num_neighbors_threshold=100000, + max_cell_images_per_dim=100, + ) + + distances = data_utils.get_pbc_distances( + coords=cart_coords, + edge_index=edges, + lattice=lattice, + to_jimages=images, + num_atoms=num_atoms, + num_bonds=num_bonds, + coord_is_cart=True, + ) + + return np.asarray(sorted(distances["distances"].numpy())) + + +def get_distances_numpy(structure: Structure, rcut: float, dtype) -> np.ndarray: + # returns 1-d sorted np.ndarray of distances + # lattice[i][x] is the xth cartesian component of lattice vector i + # frac_coord[n][i] is the fractional coordinates of atom n with respect to lattice i + + frac_coord = np.asarray(structure.frac_coords, dtype=dtype) + lattice = np.asarray(structure.lattice._matrix, dtype=dtype) + + natm = frac_coord.shape[0] + + # shape=(natm, 3) + cart_coord_0_0_0 = np.asarray(np.einsum("ni, ix->nx", frac_coord, lattice), dtype=dtype) + + # this should be generously large + max_cell = 100 + + # shape = (nimages, 3) + images = np.asarray( + list( + product( + range(-max_cell, max_cell + 1), + range(-max_cell, max_cell + 1), + range(-max_cell, max_cell + 1), + ) + ), + dtype=dtype, + ) + + nimages = images.shape[0] + + # shape = (nimages, natoms, 3) + images = np.tile(np.expand_dims(images, 1), (1, natm, 1)) + + # shape = (nimages, natoms, 3) + periodic_frac_coord = np.tile(frac_coord, (nimages, 1, 1)) + images + + # shape = (natm, nimages, natoms, 3) + periodic_frac_coord = np.tile(np.expand_dims(periodic_frac_coord, 0), (natm, 1, 1, 1)) + + assert periodic_frac_coord.dtype == dtype + + # shape = (natm, nimages, natoms, 3) + cart_coords_tiled = np.tile(np.expand_dims(cart_coord_0_0_0, (1, 2)), (1, nimages, natm, 1)) + + # shape = (natm, nimages, natm, 3) + periodic_cart_coord = np.einsum("nimk,kx->nimx", periodic_frac_coord, lattice) + + assert periodic_cart_coord.dtype == dtype + + # shape = (natm, nimages, natm) + all_distances = np.linalg.norm(cart_coords_tiled - periodic_cart_coord, axis=-1) + + # shape = (natm**2 * nimages) + all_distances = all_distances.flatten() + + # discard zero distances (atom self interaction in same cell) and large distances + all_distances = all_distances[ + np.where(np.logical_and(all_distances <= rcut, all_distances > 1e-12))[0] + ] + assert all_distances.dtype == dtype + return np.asarray(sorted(all_distances)) + + +@pytest.mark.parametrize( + "natom, rcut", + [ + (1, 1.0), + (2, 1.0), + (3, 1.0), + (1, 2.0), + (2, 2.0), + (3, 2.0), + ], +) +def test_rdf(natom: int, rcut: float): + # random structure with lattice~N(0,1) and uniform random fractional coords + structure = Structure( + species=["C" for _ in range(natom)], + coords=np.random.uniform(size=(natom, 3)), + lattice=np.random.normal(size=(3, 3)), + ) + assert np.allclose( + get_distances_numpy(structure=structure, rcut=rcut, dtype=np.float32), + get_distance_pytorch(structure=structure, rcut=rcut), + ) + + +def test_polar_decomposition(): + # load some data + batch = get_mp_20_debug_batch() + lattices = data_utils.lattice_params_to_matrix_torch(batch.lengths, batch.angles) + polar_decomposition = data_utils.compute_lattice_polar_decomposition(lattices) + symm_lengths, symm_angles = data_utils.lattice_matrix_to_params_torch(polar_decomposition) + assert torch.allclose(symm_lengths, batch.lengths, atol=1e-3) + assert torch.allclose(symm_angles, batch.angles, atol=1e-3) + assert torch.allclose(polar_decomposition.det().abs(), lattices.det().abs(), atol=1e-3) + + +def test_torch_nanstd(): + x = torch.tensor([1.0, 2.0, np.nan, 3.0, 4.0, 5.0, np.nan, 6.0]) + assert data_utils.torch_nanstd(x=x, dim=0, unbiased=False).item() == np.nanstd(x.numpy()) diff --git a/data/mattergen/common/tests/gemnet_test.py b/data/mattergen/common/tests/gemnet_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ee8ce64dfc902c33ad472af8f0aa57ed429ed5fa --- /dev/null +++ b/data/mattergen/common/tests/gemnet_test.py @@ -0,0 +1,385 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from copy import deepcopy +from itertools import chain, permutations +from typing import List, Tuple + +import torch +from pymatgen.core.structure import Structure +from scipy.spatial.transform import Rotation +from torch_geometric.data import Batch, Data + +from mattergen.common.gemnet.gemnet import GemNetT +from mattergen.common.gemnet.layers.embedding_block import AtomEmbedding +from mattergen.common.tests.testutils import get_mp_20_debug_batch +from mattergen.common.utils.data_utils import ( + cart_to_frac_coords_with_lattice, + frac_to_cart_coords_with_lattice, + lattice_matrix_to_params_torch, + lattice_params_to_matrix_torch, +) +from mattergen.common.utils.eval_utils import make_structure +from mattergen.common.utils.globals import MODELS_PROJECT_ROOT + +### UTILS ### + + +def get_model(**kwargs) -> GemNetT: + return GemNetT( + atom_embedding=AtomEmbedding(emb_size=4), + num_targets=1, + latent_dim=4, + num_radial=4, + num_blocks=1, + emb_size_atom=4, + emb_size_edge=4, + emb_size_trip=4, + emb_size_bil_trip=4, + otf_graph=True, + scale_file=f"{MODELS_PROJECT_ROOT}/common/gemnet/gemnet-dT.json", + **kwargs, + ) + + +def structures_list_to_batch(structures: List[Structure]) -> Batch: + return Batch.from_data_list( + [ + Data( + angles=torch.tensor(s.lattice.angles, dtype=torch.float32)[None], + lengths=torch.tensor(s.lattice.lengths, dtype=torch.float32)[None], + frac_coords=torch.from_numpy(s.frac_coords).float(), + atom_types=torch.tensor(s.atomic_numbers), + num_atoms=s.num_sites, + num_nodes=s.num_sites, + ) + for s in structures + ] + ) + + +def reformat_batch( + batch: Batch, +) -> Tuple[ + torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor +]: + return ( + None, + batch.frac_coords, + batch.atom_types, + batch.num_atoms, + batch.batch, + batch.lengths, + batch.angles, + ) + + +def get_cubic_data(supercell: Tuple[int, int, int]) -> Tuple[Tuple, Tuple]: + normal_structures = [ + Structure(lattice=[[2, 0, 0], [0, 3.1, 0], [0, 0, 2.9]], coords=[[0, 0, 0]], species="C"), + Structure( + lattice=[[3.1, 0, 0], [0, 2, 0], [0, 0, 4]], + coords=[[0, 0, 0], [0.5, 0.5, 0.5]], + species=["C", "C"], + ), + ] + # need a batch size of 64 + normal_structures = list(chain.from_iterable([deepcopy(normal_structures) for _ in range(32)])) + + supercell_structures = deepcopy(normal_structures) + for s in supercell_structures: + s.make_supercell(supercell) + + normal_batch = structures_list_to_batch(structures=normal_structures) + supercell_batch = structures_list_to_batch(structures=supercell_structures) + + return reformat_batch(batch=normal_batch), reformat_batch(batch=supercell_batch) + + +### TESTS ### + + +def test_lattice_score_scale_invariance(): + # test invariance of lattice score to supercell size + cutoff = 5.0 + max_neighbors = 1000 + torch.manual_seed(495606849) + model = get_model( + max_neighbors=max_neighbors, + cutoff=cutoff, + # regress stress in a non-conservative way + regress_stress=True, + max_cell_images_per_dim=20, + ) + model.eval() + batch = get_mp_20_debug_batch() + # take a subset because the test is slow + batch = Batch.from_data_list(batch.to_data_list()[:10]) + + supercell_structures = [ + make_structure(d.lengths.squeeze(0), d.angles.squeeze(0), d.atom_types, d.frac_coords) + for d in batch.to_data_list() + ] + for s in supercell_structures: + s.make_supercell((2, 2, 2)) + supercell_batch = Batch.from_data_list( + [ + Data( + angles=torch.tensor(s.lattice.angles, dtype=torch.float32)[None], + lengths=torch.tensor(s.lattice.lengths, dtype=torch.float32)[None], + frac_coords=torch.from_numpy(s.frac_coords).float(), + atom_types=torch.tensor(s.atomic_numbers), + num_atoms=s.num_sites, + num_nodes=s.num_sites, + ) + for s in supercell_structures + ] + ) + + with torch.no_grad(): + out_normal_cells = model.forward( + None, + batch.frac_coords, + batch.atom_types, + batch.num_atoms, + batch.batch, + batch.lengths, + batch.angles, + ) + + out_supercells = model.forward( + None, + supercell_batch.frac_coords, + supercell_batch.atom_types, + supercell_batch.num_atoms, + supercell_batch.batch, + supercell_batch.lengths, + supercell_batch.angles, + ) + + # for mypy + assert out_normal_cells.stress is not None + assert out_supercells.stress is not None + + all_close = torch.allclose(out_normal_cells.stress, out_supercells.stress, atol=1e-5) + assert all_close, (out_normal_cells.stress - out_supercells.stress).abs().max() + + +def test_nonconservative_lattice_score_translation_invariance(): + model = get_model( + max_neighbors=200, + cutoff=5.0, + regress_stress=True, + max_cell_images_per_dim=10, + ) + model.eval() + batch = get_mp_20_debug_batch() + + structures = [ + make_structure(d.lengths.squeeze(0), d.angles.squeeze(0), d.atom_types, d.frac_coords) + for d in batch.to_data_list() + ] + translated_batch = Batch.from_data_list( + [ + Data( + angles=torch.tensor(s.lattice.angles, dtype=torch.float32)[None], + lengths=torch.tensor(s.lattice.lengths, dtype=torch.float32)[None], + frac_coords=(torch.from_numpy(s.frac_coords).float() + torch.rand([1, 3])) % 1.0, + atom_types=torch.tensor(s.atomic_numbers), + num_atoms=s.num_sites, + num_nodes=s.num_sites, + ) + for s in structures + ] + ) + + with torch.no_grad(): + out_normal_cells = model.forward( + None, # torch.zeros((batch.num_atoms.shape[0], 16)), + batch.frac_coords, + batch.atom_types, + batch.num_atoms, + batch.batch, + batch.lengths, + batch.angles, + ) + + out_translated = model.forward( + None, # torch.zeros((translated_batch.num_atoms.shape[0], 16)), + translated_batch.frac_coords, + translated_batch.atom_types, + translated_batch.num_atoms, + translated_batch.batch, + translated_batch.lengths, + translated_batch.angles, + ) + + torch.testing.assert_allclose( + out_normal_cells.stress, out_translated.stress, atol=1e-4, rtol=1e-4 + ) + + +def test_lattice_parameterization_invariance(): + """ + Tests whether our model's predicted score behaves as expected when choosing a different unit cell. + """ + cutoff = 5.0 + max_neighbors = 200 + torch.manual_seed(2) + model = get_model( + max_neighbors=max_neighbors, + cutoff=cutoff, + # regress stress in a non-conservative way + regress_stress=True, + max_cell_images_per_dim=30, + ) + model.eval() + batch = get_mp_20_debug_batch() + + structures = [ + make_structure(d.lengths.squeeze(0), d.angles.squeeze(0), d.atom_types, d.frac_coords) + for d in batch.to_data_list() + ] + lattice_matrices = lattice_params_to_matrix_torch(batch.lengths, batch.angles) + lattice_matrix_changed = lattice_matrices.clone() + + # Build updated lattice matrices, where a random lattice vector is modified by adding 3x another random (different) lattice vector. + # This modification does not change the underlying periodic structure. + combs = torch.tensor(list(permutations(range(3), 2))) + # Per lattice, select a random pair of lattice vectors, where we add 3x the second to the first one. + lattice_vector_combine_ixs = torch.randint(0, len(combs), (lattice_matrices.shape[0],)) + combs_sel = combs[lattice_vector_combine_ixs] + + # Build the lattice perturbation matrices. For example, if the two lattice vectors are 0 and 1, we get the following: + # [ + # [1.0, 0.0, 0.0], + # [3.0, 1.0, 0.0], + # [0.0, 0.0, 1.0] + # ], + # which has the effect of changing the first lattice vector to be l_1 := l_1 + 3 * l_2 in the updated lattice. + # Shape [batch_size, 3, 3] + change_matrix = torch.eye(3)[None].expand_as(lattice_matrices).clone().contiguous() + change_matrix[range(combs_sel.shape[0]), combs_sel[:, 0], combs_sel[:, 1]] = 3 + # Transposing is needed because in our model, the lattice is a stack of row lattice vectors, but the equations are for stacks of column matrices. + lattice_matrix_changed = (lattice_matrices.transpose(1, 2) @ change_matrix).transpose(1, 2) + new_frac_coords = cart_to_frac_coords_with_lattice( + frac_to_cart_coords_with_lattice(batch.frac_coords, batch.num_atoms, lattice_matrices), + batch.num_atoms, + lattice_matrix_changed, + ) + + # Build new batch + updated_batch = batch.clone() + new_lengths, new_angles = lattice_matrix_to_params_torch(lattice_matrix_changed) + updated_batch.frac_coords = new_frac_coords + updated_batch.lengths = new_lengths + updated_batch.angles = new_angles + structures_perm = [ + make_structure(d.lengths.squeeze(0), d.angles.squeeze(0), d.atom_types, d.frac_coords) + for d in updated_batch.to_data_list() + ] + + # Make sure that pairwise distances haven't changed + close = [ + torch.allclose( + torch.from_numpy(structures_perm[ix].distance_matrix), + torch.from_numpy(structures[ix].distance_matrix), + atol=1e-3, + ) + for ix in range(len(structures)) + ] + assert all(close) + + # Forward the two batches + with torch.no_grad(): + out_normal_cells = model.forward( + None, + batch.frac_coords, + batch.atom_types, + batch.num_atoms, + batch.batch, + lattice=lattice_matrices, + ) + + out_updated_batch = model.forward( + None, + updated_batch.frac_coords, + updated_batch.atom_types, + updated_batch.num_atoms, + updated_batch.batch, + lattice=lattice_matrix_changed, + ) + assert not torch.allclose( + change_matrix.inverse() @ out_normal_cells.stress, out_updated_batch.stress, atol=1e-3 + ) + assert not torch.allclose(out_normal_cells.stress, out_updated_batch.stress, atol=1e-3) + + +def test_symmetric_lattice_score(): + # test whether predicted stress via symmetric lattice updates is actually symmetric + model = get_model( + max_neighbors=20, + cutoff=7.0, + # regress stress in a non-conservative way + regress_stress=True, + max_cell_images_per_dim=20, + ) + model.eval() + batch = get_mp_20_debug_batch() + + with torch.no_grad(): + model_out = model.forward( + None, + batch.frac_coords, + batch.atom_types, + batch.num_atoms, + batch.batch, + batch.lengths, + batch.angles, + ) + + # for mypy + assert model_out.stress is not None + assert torch.allclose(model_out.stress, model_out.stress.transpose(1, 2), atol=1e-5) + + +def test_rotation_invariance(): + model = get_model( + max_neighbors=1000, + cutoff=5.0, + regress_stress=True, + max_cell_images_per_dim=10, + ) + + batch = get_mp_20_debug_batch() + lattices = lattice_params_to_matrix_torch(batch.lengths, batch.angles) + with torch.no_grad(): + model_out = model.forward( + None, + batch.frac_coords, + batch.atom_types, + batch.num_atoms, + batch.batch, + lattice=lattices, + ) + + rotation_matrix = torch.Tensor(Rotation.random().as_matrix(), device=lattices.device) + rotated_lattices = lattices @ rotation_matrix + with torch.no_grad(): + model_out_rotated = model.forward( + None, + batch.frac_coords, + batch.atom_types, + batch.num_atoms, + batch.batch, + lattice=rotated_lattices, + ) + + forces = model_out.forces + forces_rotated = model_out_rotated.forces + stress = model_out.stress + stress_rotated = model_out_rotated.stress + + assert torch.allclose(forces @ rotation_matrix, forces_rotated, atol=1e-3) + + assert torch.allclose(rotation_matrix.T @ stress @ rotation_matrix, stress_rotated, atol=1e-3) diff --git a/data/mattergen/common/tests/mp_20_debug_batch.pt b/data/mattergen/common/tests/mp_20_debug_batch.pt new file mode 100644 index 0000000000000000000000000000000000000000..aff3a73624a7a88772b120b2959a99b1b03cd2cf --- /dev/null +++ b/data/mattergen/common/tests/mp_20_debug_batch.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ed9b181f5ccc35285adc0b84418964f95ac68a8495731e3614d819699fb2f02 +size 257166 diff --git a/data/mattergen/common/tests/test_data.csv b/data/mattergen/common/tests/test_data.csv new file mode 100644 index 0000000000000000000000000000000000000000..aa2784062b446ad4050cc947700cb4c253250d72 --- /dev/null +++ b/data/mattergen/common/tests/test_data.csv @@ -0,0 +1,70 @@ +,material_id,formation_energy_per_atom,band_gap,pretty_formula,e_above_hull,elements,cif,spacegroup.number +17930,mp-7735,-0.3918942976923078,0.0,Pr5(CoB3)2,0.0003353181538461,"['B', 'Co', 'Pr']","# generated using pymatgen +data_Pr5(CoB3)2 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 8.91944954 +_cell_length_b 8.91944954 +_cell_length_c 8.91945019 +_cell_angle_alpha 35.85189404 +_cell_angle_beta 35.85189404 +_cell_angle_gamma 35.85188987 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural Pr5(CoB3)2 +_chemical_formula_sum 'Pr5 Co2 B6' +_cell_volume 217.66333364 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Pr Pr0 1 0.58275600 0.58275600 0.58275600 1 + Pr Pr1 1 0.41724400 0.41724400 0.41724400 1 + Pr Pr2 1 0.74938700 0.74938700 0.74938700 1 + Pr Pr3 1 0.25061300 0.25061300 0.25061300 1 + Pr Pr4 1 0.00000000 0.00000000 0.00000000 1 + Co Co5 1 0.87613200 0.87613200 0.87613200 1 + Co Co6 1 0.12386800 0.12386800 0.12386800 1 + B B7 1 0.50000000 0.83293800 0.16706200 1 + B B8 1 0.16706200 0.50000000 0.83293800 1 + B B9 1 0.83293800 0.16706200 0.50000000 1 + B B10 1 0.50000000 0.16706200 0.83293800 1 + B B11 1 0.83293800 0.50000000 0.16706200 1 + B B12 1 0.16706200 0.83293800 0.50000000 1 +",166 +7285,mp-24719,-0.1247756075000001,0.0,NiH,0.0,"['Ni', 'H']","# generated using pymatgen +data_NiH +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 2.62493169 +_cell_length_b 2.62493169 +_cell_length_c 2.62493169 +_cell_angle_alpha 60.00000000 +_cell_angle_beta 60.00000000 +_cell_angle_gamma 60.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural NiH +_chemical_formula_sum 'Ni1 H1' +_cell_volume 12.78907168 +_cell_formula_units_Z 1 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Ni Ni0 1 0.00000000 0.00000000 0.00000000 1 + H H1 1 0.50000000 0.50000000 0.50000000 1 +",225 diff --git a/data/mattergen/common/tests/testutils.py b/data/mattergen/common/tests/testutils.py new file mode 100644 index 0000000000000000000000000000000000000000..81b35bb6fe9a48f06459af6488a8a7d9ad743e88 --- /dev/null +++ b/data/mattergen/common/tests/testutils.py @@ -0,0 +1,12 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from pathlib import Path + +import torch +from torch_geometric.data import Batch + + +def get_mp_20_debug_batch() -> Batch: + # loads a batch containing the first 64 crystals of the mp_20 training set. + return torch.load(Path(__file__).resolve().parent / "mp_20_debug_batch.pt") diff --git a/data/mattergen/common/utils/__init__.py b/data/mattergen/common/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/common/utils/config_utils.py b/data/mattergen/common/utils/config_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..b8c20764845fc0643750ba54a0fba4e32975d9cb --- /dev/null +++ b/data/mattergen/common/utils/config_utils.py @@ -0,0 +1,53 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import argparse +import sys +from typing import Callable, TypeVar, cast + +from omegaconf import OmegaConf + +R = TypeVar("R") + + +def get_config(argv: list[str] | None, config_cls: Callable[..., R]) -> R: + """ + Utility function to get OmegaConf config options. + + Args: + argv: Either a list of command line arguments to parse, or None. + If None, this argument is set from sys.argv. + config_cls: Dataclass object specifying config structure + (i.e. which fields to expect in the config). + It should be the class itself, NOT an instance of the class. + + Returns: + Config object, which will pass as an instance of `config_cls` among other things. + Note: the type for this could be specified more carefully, but OmegaConf's typing + system is a bit complex. See OmegaConf's docs for "structured" for more info. + """ + + if argv is None: + argv = sys.argv[1:] + # Parse command line arguments + parser = argparse.ArgumentParser(allow_abbrev=False) # prevent prefix matching issues + parser.add_argument( + "--config", + type=str, + action="append", + default=list(), + help="Path to a yaml config file. " + "Argument can be repeated multiple times, with later configs overwriting previous ones.", + ) + args, config_changes = parser.parse_known_args(argv) + + # Read configs from file and command line + conf_yamls = [OmegaConf.load(c) for c in args.config] + conf_cli = OmegaConf.from_cli(config_changes) + + # Make merged config options + # CLI options take priority over YAML file options + schema = OmegaConf.structured(config_cls) + config = OmegaConf.merge(schema, *conf_yamls, conf_cli) + OmegaConf.set_readonly(config, True) # should not be written to + return cast(R, config) diff --git a/data/mattergen/common/utils/data_classes.py b/data/mattergen/common/utils/data_classes.py new file mode 100644 index 0000000000000000000000000000000000000000..9d724d6a0a56dd9d3f6b3768014da7c257c074ce --- /dev/null +++ b/data/mattergen/common/utils/data_classes.py @@ -0,0 +1,120 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import fnmatch +import os +from dataclasses import asdict, dataclass, field +from functools import cached_property +from pathlib import Path +from typing import Any, Literal + +import numpy as np +from hydra import compose, initialize_config_dir +from omegaconf import DictConfig + + +def find_local_files(local_path: str, glob: str = "*", relative: bool = False) -> list[str]: + """ + Find files in the given directory or blob storage path, and return the list of files + matching the given glob pattern. If relative is True, the returned paths are relative + to the given directory or blob storage path. + + Args: + blob_or_local_path: path to the directory or blob storage path + glob: glob pattern to match. By default, all files are returned. + relative: whether to return relative paths. By default, absolute paths are returned. + + Returns: + list of paths to files matching the given glob pattern. + """ + # list all files here, filtering happens in the `fnmatch.filter` step + local_files = [x for x in Path(local_path).rglob("*") if os.path.isfile(x)] + files_list = [str(x.relative_to(local_path)) if relative else str(x) for x in local_files] + return fnmatch.filter(files_list, glob) + + +@dataclass(frozen=True) +class MatterGenCheckpointInfo: + model_path: str + load_epoch: int | Literal["best", "last"] | None = "last" + config_overrides: list[str] = field(default_factory=list) + split: str = "val" + strict_checkpoint_loading: bool = True + + def as_dict(self) -> dict[str, Any]: + d = asdict(self) + d["model_path"] = str(self.model_path) # we cannot put Path object in mongo DB + return d + + @classmethod + def from_dict(cls, d) -> "MatterGenCheckpointInfo": + d = d.copy() + d["model_path"] = Path(d["model_path"]) + # no longer used + if "load_data" in d: + del d["load_data"] + return cls(**d) + + @property + def config(self) -> DictConfig: + with initialize_config_dir(str(self.model_path)): + cfg = compose(config_name="config", overrides=self.config_overrides) + return cfg + + @cached_property + def checkpoint_path(self) -> str: + """ + Search for checkpoint files in the given directory, and return the path + to the checkpoint with the given epoch number or the best checkpoint if load_epoch is "best". + "Best" is selected via the lowest validation loss, which is stored in the checkpoint filename. + Assumes that the checkpoint filenames are of the form "epoch=1-val_loss=0.1234.ckpt" or 'last.ckpt'. + + Returns: + Path to the checkpoint file to load. + """ + # look for checkpoints recursively in the given directory or blob storage path. + # I.e., if the path is '/path/', we will find .ckpt files in '/path/version_0/checkpoints' + # and '/path/version_1/checkpoints', and so on. + model_path = str(self.model_path) + ckpts = find_local_files(local_path=model_path, glob="*.ckpt") + assert len(ckpts) > 0, f"No checkpoints found at {model_path}" + if self.load_epoch == "last": + assert any( + [x.endswith("last.ckpt") for x in ckpts] + ), "No last.ckpt found in checkpoints." + return [x for x in ckpts if x.endswith("last.ckpt")][0] + # Drop last.ckpt to exclude it from the epoch selection + ckpts = [x for x in ckpts if not x.endswith("last.ckpt")] + + # Convert strings to Path to be able to use the .parts attribute + ckpt_paths = [Path(x) for x in ckpts] + # Extract the epoch number and validation loss from the checkpoint filenames + ckpt_epochs = np.array( + [ + int(ckpt.parts[-1].split(".ckpt")[0].split("-")[0].split("=")[1]) + for ckpt in ckpt_paths + ] + ) + ckpt_val_losses = np.array( + [ + ( + float(ckpt.parts[-1].replace(".ckpt", "").split("-")[1].split("=")[1]) + if "loss_val" in ckpt.parts[-1] + else 99999999.9 + ) + for ckpt in ckpt_paths + ] + ) + + # Determine the matching checkpoint index. + if self.load_epoch == "best": + ckpt_ix = ckpt_val_losses.argmin() + elif isinstance(self.load_epoch, int): + assert ( + self.load_epoch in ckpt_epochs + ), f"Epoch {self.load_epoch} not found in checkpoints." + ckpt_ix = (ckpt_epochs == self.load_epoch).nonzero()[0][0].item() + else: + raise ValueError(f"Unrecognized load_epoch {self.load_epoch}") + ckpt = ckpts[ckpt_ix] + return ckpt diff --git a/data/mattergen/common/utils/data_utils.py b/data/mattergen/common/utils/data_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..4873a2de89221bd843487aea8e1027e3ef1428f4 --- /dev/null +++ b/data/mattergen/common/utils/data_utils.py @@ -0,0 +1,385 @@ +# Copyright (c) 2021 Tian Xie, Xiang Fu +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# Adapted from https://github.com/txie-93/cdvae/blob/main/cdvae/common/data_utils.py + +from functools import lru_cache + +import numpy as np +import torch +from pymatgen.core import Element + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.utils.ocp_graph_utils import radius_graph_pbc as radius_graph_pbc_ocp + +EPSILON = 1e-5 + + +@lru_cache +def get_atomic_number(symbol: str) -> int: + # get atomic number from Element symbol + return Element(symbol).Z + + +@lru_cache +def get_element_symbol(Z: int) -> str: + # get Element symbol from atomic number + return str(Element.from_Z(Z=Z)) + + +def abs_cap(val: float, max_abs_val: float = 1.0) -> float: + """ + Returns the value with its absolute value capped at max_abs_val. + Particularly useful in passing values to trigonometric functions where + numerical errors may result in an argument > 1 being passed in. + https://github.com/materialsproject/pymatgen/blob/b789d74639aa851d7e5ee427a765d9fd5a8d1079/pymatgen/util/num.py#L15 + Args: + val (float): Input value. + max_abs_val (float): The maximum absolute value for val. Defaults to 1. + Returns: + val if abs(val) < 1 else sign of val * max_abs_val. + """ + return max(min(val, max_abs_val), -max_abs_val) + + +def lattice_params_to_matrix( + a: float, b: float, c: float, alpha: float, beta: float, gamma: float +) -> np.ndarray: + """Converts lattice from abc, angles to matrix. + https://github.com/materialsproject/pymatgen/blob/b789d74639aa851d7e5ee427a765d9fd5a8d1079/pymatgen/core/lattice.py#L311 + """ + angles_r = np.radians([alpha, beta, gamma]) + cos_alpha, cos_beta, cos_gamma = np.cos(angles_r) + sin_alpha, sin_beta, sin_gamma = np.sin(angles_r) + + val = (cos_alpha * cos_beta - cos_gamma) / (sin_alpha * sin_beta) + # Sometimes rounding errors result in values slightly > 1. + val = abs_cap(val) + gamma_star = np.arccos(val) + + vector_a = [a * sin_beta, 0.0, a * cos_beta] + vector_b = [ + -b * sin_alpha * np.cos(gamma_star), + b * sin_alpha * np.sin(gamma_star), + b * cos_alpha, + ] + vector_c = [0.0, 0.0, float(c)] + return np.array([vector_a, vector_b, vector_c]) + + +def lattice_params_to_matrix_torch( + lengths: torch.Tensor, angles: torch.Tensor, eps: float = 0.0 +) -> torch.Tensor: + """Batched torch version to compute lattice matrix from params. + + lengths: torch.Tensor of shape (N, 3), unit A + angles: torch.Tensor of shape (N, 3), unit degree + """ + coses = torch.clamp(torch.cos(torch.deg2rad(angles)), -1.0, 1.0) + sins = (1 - coses**2).sqrt() + + val = (coses[:, 0] * coses[:, 1] - coses[:, 2]) / (sins[:, 0] * sins[:, 1]) + val = torch.clamp(val, -1.0 + eps, 1.0 - eps) + + vector_a = torch.stack( + [ + lengths[:, 0] * sins[:, 1], + torch.zeros(lengths.size(0), device=lengths.device), + lengths[:, 0] * coses[:, 1], + ], + dim=1, + ) + vector_b = torch.stack( + [ + -lengths[:, 1] * sins[:, 0] * val, + lengths[:, 1] * sins[:, 0] * (1 - val**2).sqrt(), + lengths[:, 1] * coses[:, 0], + ], + dim=1, + ) + vector_c = torch.stack( + [ + torch.zeros(lengths.size(0), device=lengths.device), + torch.zeros(lengths.size(0), device=lengths.device), + lengths[:, 2], + ], + dim=1, + ) + + return torch.stack([vector_a, vector_b, vector_c], dim=1) + + +def lattice_matrix_to_params_torch( + matrix: torch.Tensor, eps: float = 0.0 +) -> tuple[torch.Tensor, torch.Tensor]: + """Convert a batch of lattice matrices into their corresponding unit cell vector lengths and angles. + + Args: + matrix (torch.Tensor, [B, 3, 3]): The batch of lattice matrices. + + Returns: + tuple[torch.Tensor], ([B, 3], [B, 3]): tuple whose first element is the lengths of the unit cell vectors, and the second one gives the angles between the vectors. + """ + assert len(matrix.shape) == 3 + + # derivatives of arccos(cos(theta)) are undefined for abs(cos(theta))=1 + # we should physically encounter lattices that have vectors that are + # parallel to one another. NOTE: the value of eps may need tuning + # if calculations are found to fail, reduce this magnitude + + lengths = matrix.norm(p=2, dim=-1) + ix_j = torch.tensor([1, 2, 0], dtype=torch.long, device=matrix.device) + ix_k = torch.tensor([2, 0, 1], dtype=torch.long, device=matrix.device) + cos_angles = (torch.cosine_similarity(matrix[:, ix_j], matrix[:, ix_k], dim=-1)).clamp( + -1 + eps, 1 - eps + ) + if len(matrix.shape) == 2: + cos_angles = cos_angles.squeeze(0) + lengths = lengths.squeeze(0) + return lengths, torch.arccos(cos_angles) * 180.0 / np.pi + + +def lattice_matrix_to_params(matrix: np.ndarray) -> tuple[float, float, float, float, float, float]: + lengths = np.sqrt(np.sum(matrix**2, axis=1)).tolist() + + angles = np.zeros(3) + for i in range(3): + j = (i + 1) % 3 + k = (i + 2) % 3 + angles[i] = abs_cap(np.dot(matrix[j], matrix[k]) / (lengths[j] * lengths[k])) + angles = np.arccos(angles) * 180.0 / np.pi + a, b, c = lengths + alpha, beta, gamma = angles + return a, b, c, alpha, beta, gamma + + +def frac_to_cart_coords( + frac_coords: torch.Tensor, lengths: torch.Tensor, angles: torch.Tensor, num_atoms: torch.Tensor +) -> torch.Tensor: + lattice = lattice_params_to_matrix_torch(lengths, angles) + return frac_to_cart_coords_with_lattice(frac_coords, num_atoms, lattice) + + +def cart_to_frac_coords( + cart_coords: torch.Tensor, lengths: torch.Tensor, angles: torch.Tensor, num_atoms: torch.Tensor +) -> torch.Tensor: + lattice = lattice_params_to_matrix_torch(lengths, angles) + return cart_to_frac_coords_with_lattice(cart_coords, num_atoms, lattice) + + +def frac_to_cart_coords_with_lattice( + frac_coords: torch.Tensor, num_atoms: torch.Tensor, lattice: torch.Tensor +) -> torch.Tensor: + lattice_nodes = torch.repeat_interleave(lattice, num_atoms, dim=0) + pos = torch.einsum("bi,bij->bj", frac_coords, lattice_nodes) # cart coords + return pos + + +def cart_to_frac_coords_with_lattice( + cart_coords: torch.Tensor, num_atoms: torch.Tensor, lattice: torch.Tensor +) -> torch.Tensor: + # use pinv in case the predicted lattice is not rank 3 + inv_lattice = torch.linalg.pinv(lattice) + inv_lattice_nodes = torch.repeat_interleave(inv_lattice, num_atoms, dim=0) + frac_coords = torch.einsum("bi,bij->bj", cart_coords, inv_lattice_nodes) + return frac_coords % 1.0 + + +def get_pbc_distances( + coords: torch.Tensor, + edge_index: torch.Tensor, + lattice: torch.Tensor, + to_jimages: torch.Tensor, + num_atoms: torch.Tensor, + num_bonds: torch.Tensor, + coord_is_cart: bool = False, + return_offsets: bool = False, + return_distance_vec: bool = False, +) -> torch.Tensor: + if coord_is_cart: + pos = coords + else: + lattice_nodes = torch.repeat_interleave(lattice, num_atoms, dim=0) + pos = torch.einsum("bi,bij->bj", coords, lattice_nodes) # cart coords + + j_index, i_index = edge_index + + distance_vectors = pos[j_index] - pos[i_index] + + # correct for pbc + lattice_edges = torch.repeat_interleave(lattice, num_bonds, dim=0) + offsets = torch.einsum("bi,bij->bj", to_jimages.float(), lattice_edges) + distance_vectors += offsets + + # compute distances + distances = distance_vectors.norm(dim=-1) + + out = { + "edge_index": edge_index, + "distances": distances, + } + + if return_distance_vec: + out["distance_vec"] = distance_vectors + + if return_offsets: + out["offsets"] = offsets + + return out + + +def radius_graph_pbc( + cart_coords: torch.Tensor, + lattice: torch.Tensor, + num_atoms: torch.Tensor, + radius: float, + max_num_neighbors_threshold: int, + max_cell_images_per_dim: int = 10, + topk_per_pair: torch.Tensor | None = None, +) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]: + """Computes pbc graph edges under pbc. + + topk_per_pair: (num_atom_pairs,), select topk edges per atom pair + + Note: topk should take into account self-self edge for (i, i) + + Keyword arguments + ----------------- + cart_cords.shape=[Ntotal, 3] -- concatenate all atoms over all crystals + lattice.shape=[Ncrystal, 3, 3] + num_atoms.shape=[Ncrystal] + max_cell_images_per_dim -- constrain the max. number of cell images per dimension in event + that infinitesimal angles between lattice vectors are encountered. + + WARNING: It is possible (and has been observed) that for rare cases when periodic atom images are + on or close to the cut off radius boundary, doing these operations in 32 bit floating point can + lead to atoms being spuriously considered within or outside of the cut off radius. This can lead + to invariance of the neighbour list under global translation of all atoms in the unit cell. For + the rare cases where this was observed, switching to 64 bit precision solved the issue. Since all + graph embeddings should taper messages from neighbours to zero at the cut off radius, the effect + of these errors in 32-bit should be negligible in practice. + """ + assert topk_per_pair is None, "non None values of topk_per_pair is not supported" + edge_index, unit_cell, num_neighbors_image, _, _ = radius_graph_pbc_ocp( + pos=cart_coords, + cell=lattice, + natoms=num_atoms, + pbc=torch.Tensor([True, True, True]) + .to(torch.bool) + .to(cart_coords.device), # torch.BoolTensor([...],device='cuda') fails + radius=radius, + max_num_neighbors_threshold=max_num_neighbors_threshold, + max_cell_images_per_dim=max_cell_images_per_dim, + ) + return edge_index, unit_cell, num_neighbors_image + + +class StandardScalerTorch(torch.nn.Module): + """Normalizes the targets of a dataset.""" + + def __init__( + self, + means: torch.Tensor | None = None, + stds: torch.Tensor | None = None, + stats_dim: tuple[int] = ( + 1, + ), # dimension of mean, std stats (= X.shape[1:] for some input tensor X) + ): + super().__init__() + # we need to make sure that we initialize means and stds with the right shapes + # otherwise, we cannot load checkpoints of fitted means/stds. + # ignore stats_dim if means and stds are provided + self.register_buffer( + "means", torch.atleast_1d(means) if means is not None else torch.empty(stats_dim) + ) + self.register_buffer( + "stds", torch.atleast_1d(stds) if stds is not None else torch.empty(stats_dim) + ) + + @property + def device(self) -> torch.device: + return self.means.device # type: ignore + + def fit(self, X: torch.Tensor): + means: torch.Tensor = torch.atleast_1d(torch.nanmean(X, dim=0).to(self.device)) + stds: torch.Tensor = torch.atleast_1d( + torch_nanstd(X, dim=0, unbiased=False).to(self.device) + EPSILON + ) + # mypy gets really confused about variables registered via register_buffer, + # so we need to ignore a lot of type errors below + assert ( + means.shape == self.means.shape # type: ignore + ), f"Mean shape mismatch: {means.shape} != {self.means.shape}" # type: ignore + assert ( + stds.shape == self.stds.shape # type: ignore + ), f"Std shape mismatch: {stds.shape} != {self.stds.shape}" # type: ignore + self.means = means # type: ignore + self.stds = stds # type: ignore + + def transform(self, X: torch.Tensor) -> torch.Tensor: + assert self.means is not None and self.stds is not None + return (X - self.means) / self.stds + + def inverse_transform(self, X: torch.Tensor) -> torch.Tensor: + assert self.means is not None and self.stds is not None + return X * self.stds + self.means + + def match_device(self, X: torch.Tensor) -> torch.Tensor: + assert self.means.numel() > 0 and self.stds.numel() > 0 + if self.means.device != X.device: + self.means = self.means.to(X.device) + self.stds = self.stds.to(X.device) + + def copy(self) -> "StandardScalerTorch": + return StandardScalerTorch( + means=self.means.clone().detach(), + stds=self.stds.clone().detach(), + ) + + def forward(self, X: torch.Tensor) -> torch.Tensor: + return self.transform(X) + + def __repr__(self) -> str: + return ( + f"{self.__class__.__name__}(" + f"means: {self.means.tolist() if self.means is not None else None}, " + f"stds: {self.stds.tolist() if self.stds is not None else None})" + ) + + +def torch_nanstd(x: torch.Tensor, dim: int, unbiased: bool) -> torch.Tensor: + data_is_present = torch.all( + torch.reshape(torch.logical_not(torch.isnan(x)), (x.shape[0], -1)), + dim=1, + ) + # https://github.com/pytorch/pytorch/issues/29372 + return torch.std(x[data_is_present], dim=dim, unbiased=unbiased) + + +def compute_lattice_polar_decomposition(lattice_matrix: torch.Tensor) -> torch.Tensor: + # Polar decomposition via SVD, see https://en.wikipedia.org/wiki/Polar_decomposition + # lattice_matrix: [batch_size, 3, 3] + # Computes the (unique) symmetric lattice matrix that is equivalent (up to rotation) to the input lattice. + + W, S, V_transp = torch.linalg.svd(lattice_matrix) + S_square = torch.diag_embed(S) + V = V_transp.transpose(1, 2) + U = W @ V_transp + P = V @ S_square @ V_transp + P_prime = U @ P @ U.transpose(1, 2) + # symmetrized lattice matrix + symm_lattice_matrix = P_prime + return symm_lattice_matrix + + +def create_chem_graph_from_composition(target_composition_dict: dict[str, float]) -> ChemGraph: + atomic_numbers = [] + for element_name, number_of_atoms in target_composition_dict.items(): + atomic_numbers += [Element(element_name).Z] * int(number_of_atoms) + + return ChemGraph( + atomic_numbers=torch.tensor(atomic_numbers, dtype=torch.long), + num_atoms=torch.tensor([len(atomic_numbers)], dtype=torch.long), + cell=torch.eye(3, dtype=torch.float).reshape(1, 3, 3), + pos=torch.zeros((len(atomic_numbers), 3), dtype=torch.float), + ) diff --git a/data/mattergen/common/utils/eval_utils.py b/data/mattergen/common/utils/eval_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..79e33b528e501cfdb17ee92106f4052a3090b596 --- /dev/null +++ b/data/mattergen/common/utils/eval_utils.py @@ -0,0 +1,167 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import logging +import os +from pathlib import Path +from tempfile import TemporaryDirectory +from typing import Sequence +from zipfile import ZipFile + +import ase.io +import hydra +import numpy as np +import torch +from pymatgen.core import Lattice, Structure +from pymatgen.io.ase import AseAtomsAdaptor + +from mattergen.common.globals import ( + GENERATED_CRYSTALS_EXTXYZ_FILE_NAME, + GENERATED_CRYSTALS_ZIP_FILE_NAME, +) +from mattergen.common.utils.data_classes import MatterGenCheckpointInfo +from mattergen.common.utils.globals import get_device +from mattergen.diffusion.lightning_module import DiffusionLightningModule + +# logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + + +def make_structure( + lengths: torch.Tensor, + angles: torch.Tensor, + atom_types: torch.Tensor, + frac_coords: torch.Tensor, +) -> Structure: + return Structure( + lattice=Lattice.from_parameters( + **{a: v for a, v in zip(["a", "b", "c"], lengths)}, + **{a: v for a, v in zip(["alpha", "beta", "gamma"], angles)}, + ), + species=atom_types, + coords=frac_coords, + coords_are_cartesian=False, + ) + + +def load_model_diffusion( + args: MatterGenCheckpointInfo, +) -> DiffusionLightningModule: + assert args.load_epoch is not None + ckpt = args.checkpoint_path + logger.info(f"Loading model from checkpoint: {ckpt}") + cfg = args.config + try: + model, incompatible_keys = DiffusionLightningModule.load_from_checkpoint_and_config( + ckpt, + map_location=get_device(), + config=cfg.lightning_module, + strict=args.strict_checkpoint_loading, + ) + except hydra.errors.HydraException as e: + raise + if len(incompatible_keys.unexpected_keys) > 0: + raise ValueError(f"Unexpected keys in checkpoint: {incompatible_keys.unexpected_keys}.") + if len(incompatible_keys.missing_keys) > 0: + raise ValueError(f"Missing keys in checkpoint: {incompatible_keys.missing_keys}.") + + return model + + +def get_crystals_list( + frac_coords, atom_types, lengths, angles, num_atoms +) -> list[dict[str, np.ndarray]]: + """ + args: + frac_coords: (num_atoms, 3) + atom_types: (num_atoms) + lengths: (num_crystals) + angles: (num_crystals) + num_atoms: (num_crystals) + """ + assert frac_coords.size(0) == atom_types.size(0) == num_atoms.sum() + assert lengths.size(0) == angles.size(0) == num_atoms.size(0) + + start_idx = 0 + crystal_array_list = [] + for batch_idx, num_atom in enumerate(num_atoms.tolist()): + cur_frac_coords = frac_coords.narrow(0, start_idx, num_atom) + cur_atom_types = atom_types.narrow(0, start_idx, num_atom) + cur_lengths = lengths[batch_idx] + cur_angles = angles[batch_idx] + + crystal_array_list.append( + { + "frac_coords": cur_frac_coords.detach().cpu().numpy(), + "atom_types": cur_atom_types.detach().cpu().numpy(), + "lengths": cur_lengths.detach().cpu().numpy(), + "angles": cur_angles.detach().cpu().numpy(), + } + ) + start_idx = start_idx + num_atom + return crystal_array_list + + +def save_structures(output_path: Path, structures: Sequence[Structure]) -> None: + """Save structures to disk in a extxyz file and a compressed zip file containing cif files. + + Args: + output_path: path to a directory where the results are written. + structures: sequence of structures. + """ + ase_atoms = [AseAtomsAdaptor.get_atoms(x) for x in structures] + try: + ase.io.write(output_path / GENERATED_CRYSTALS_EXTXYZ_FILE_NAME, ase_atoms) + + with ZipFile(output_path / GENERATED_CRYSTALS_ZIP_FILE_NAME, "w") as zip_obj: + for ix, ase_atom in enumerate(ase_atoms): + ase.io.write(f"/tmp/gen_{ix}.cif", ase_atom, format="cif") + zip_obj.write(f"/tmp/gen_{ix}.cif") + except IOError as e: + print(f"Got error {e} writing the generated structures to disk.") + + +def load_structures(input_path: Path) -> Sequence[Structure]: + """Load structures from disk. + + Args: + output_path: path to a file or directory where the results are written. + + Returns: + sequence of structures. + """ + # if the path is an xyz or extxyz file, read it directly + if input_path.suffix == ".xyz" or input_path.suffix == ".extxyz": + ase_atoms = ase.io.read(input_path, ":") + return [AseAtomsAdaptor.get_structure(x) for x in ase_atoms] + + # if the path is a zipped folder, extract it into a temporary directory + elif input_path.suffix == ".zip": + with TemporaryDirectory() as tmpdirname: + with ZipFile(input_path, "r") as zip_obj: + zip_obj.extractall(tmpdirname) + return extract_structures_from_folder(tmpdirname) + + # if the path is a directory, read all files in it + elif input_path.is_dir(): + return extract_structures_from_folder(input_path) + + else: + raise ValueError(f"Invalid input path {input_path}") + + +def extract_structures_from_folder(dirname: str) -> Sequence[Structure]: + structures = [] + for filename in os.listdir(dirname): + if filename.endswith(".cif"): + try: + structures.append(Structure.from_file(f"{dirname}/{filename}")) + except ValueError as e: + logger.warning(f"Failed to read {filename} as a CIF file: {e}") + elif filename.endswith(".extxyz") or filename.endswith(".xyz"): + ase_atoms = ase.io.read( + f"{dirname}/{filename}", 0 + ) # We assume that the file contains only one structure + structures.append(AseAtomsAdaptor.get_structure(ase_atoms)) + return structures diff --git a/data/mattergen/common/utils/globals.py b/data/mattergen/common/utils/globals.py new file mode 100644 index 0000000000000000000000000000000000000000..e35ec6a03f04a40a56e93ca12f14266ad623a1c9 --- /dev/null +++ b/data/mattergen/common/utils/globals.py @@ -0,0 +1,151 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +"""Note that importing this module has two side effects: +1. It sets the environment variable `PROJECT_ROOT` to the root of the explorers project. +2. It registers a new resolver for OmegaConf, `eval`, which allows us to use `eval` in our config files. +""" +import os +from functools import lru_cache +from pathlib import Path + +import torch +from omegaconf import OmegaConf + + +@lru_cache +def get_device() -> torch.device: + if torch.cuda.is_available(): + return torch.device("cuda") + if torch.backends.mps.is_available(): + return torch.device("mps") + return torch.device("cpu") + + +@lru_cache +def get_pyg_device() -> torch.device: + """ + Some operations of pyg don't work on MPS, so fall back to CPU. + """ + if torch.cuda.is_available(): + return torch.device("cuda") + return torch.device("cpu") + + +MODELS_PROJECT_ROOT = Path(__file__).resolve().parents[2] +print(f"MODELS_PROJECT_ROOT: {MODELS_PROJECT_ROOT}") + +# Set environment variable PROJECT_ROOT so that hydra / OmegaConf can access it. +os.environ["PROJECT_ROOT"] = str(MODELS_PROJECT_ROOT) # for hydra + +DEFAULT_SAMPLING_CONFIG_PATH = Path(__file__).resolve().parents[3] / "sampling_conf" +PROPERTY_SOURCE_IDS = [ + "dft_mag_density", + "dft_bulk_modulus", + "dft_shear_modulus", + "energy_above_hull", + "formation_energy_per_atom", + "space_group", + "hhi_score", + "ml_bulk_modulus", + "chemical_system", + "dft_band_gap", +] + +SELECTED_ATOMIC_NUMBERS = [ + 1, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 37, + 38, + 39, + 40, + 41, + 42, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 55, + 56, + 57, + 58, + 59, + 60, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, +] +MAX_ATOMIC_NUM = 100 + + +# Set `eval` resolver +def try_eval(s): + """This is a custom resolver for OmegaConf that allows us to use `eval` in our config files + with the syntax `${eval:'${foo} + ${bar}'} + + See: + https://omegaconf.readthedocs.io/en/2.3_branch/how_to_guides.html#id1 + """ + try: + return eval(s) + except Exception as e: + print(f"Calling eval on string {s} raised exception {e}") + raise + + +OmegaConf.register_new_resolver("eval", try_eval) diff --git a/data/mattergen/common/utils/lattice_score.py b/data/mattergen/common/utils/lattice_score.py new file mode 100644 index 0000000000000000000000000000000000000000..a4bc6086d0d4ced14acebab474c1fdd7e265f8d9 --- /dev/null +++ b/data/mattergen/common/utils/lattice_score.py @@ -0,0 +1,37 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import torch +from torch_scatter import scatter_add + + +def edge_score_to_lattice_score_frac_symmetric( + score_d: torch.Tensor, + edge_index: torch.Tensor, + edge_vectors: torch.Tensor, + batch: torch.Tensor, +) -> torch.Tensor: + """Converts a score per edge into a score for the atom coordinates and/or the lattice matrix via the chain rule. + This method explicitly takes into account the fact that the cartesian coordinates depend on the lattice via the fractional coordinates. + Moreover, we make sure to get a symmetric update: D_cart_norm @ Phi @ D_cart_norm^T, where Phi is a |E| x |E| diagonal matrix with the predicted edge scores + + Args: + score_d (torch.Tensor, [num_edges,]): A score per edge in the graph. + edge_index (torch.Tensor, [2, num_edges]): The edge indices in the graph. + edge_vectors (torch.Tensor, [num_edges, 3]): The vectors connecting the source of each edge to the target. + lattice_matrix (torch.Tensor, [num_nodes, 3, 3]): The lattice matrices for each crystal in num_nodes. + batch (torch.Tensor, [num_nodes,]): The pointer indicating for each atom which molecule in the batch it belongs to. + + Returns: + torch.Tensor: The predicted lattice score. + """ + batch_edge = batch[edge_index[0]] + unit_edge_vectors_cart = edge_vectors / edge_vectors.norm(dim=-1, keepdim=True) + score_lattice = scatter_add( + score_d[:, None, None] + * (unit_edge_vectors_cart[:, :, None] @ unit_edge_vectors_cart[:, None, :]), + batch_edge, + dim=0, + dim_size=batch.max() + 1, + ).transpose(-1, -2) + return score_lattice diff --git a/data/mattergen/common/utils/ocp_graph_utils.py b/data/mattergen/common/utils/ocp_graph_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..39169334a025847272bf6221fa45636597bce779 --- /dev/null +++ b/data/mattergen/common/utils/ocp_graph_utils.py @@ -0,0 +1,334 @@ +""" +Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. +Code derived from the OCP codebase: +https://github.com/Open-Catalyst-Project/ocp +""" + +import sys + +import numpy as np +import torch +from torch_scatter import segment_coo, segment_csr + +from mattergen.common.utils.globals import get_pyg_device + + +def get_pbc_distances( + pos: torch.Tensor, + edge_index: torch.Tensor, + cell: torch.Tensor, + cell_offsets: torch.Tensor, + neighbors: torch.Tensor, + return_offsets: bool = False, + return_distance_vec: bool = False, +) -> dict: + row, col = edge_index + + distance_vectors = pos[row] - pos[col] + + # correct for pbc + neighbors = neighbors.to(cell.device) + cell = torch.repeat_interleave(cell, neighbors, dim=0) + offsets = cell_offsets.float().view(-1, 1, 3).bmm(cell.float()).view(-1, 3) + distance_vectors += offsets + + # compute distances + distances = distance_vectors.norm(dim=-1) + + # redundancy: remove zero distances + nonzero_idx = torch.arange(len(distances))[distances > 0] + edge_index = edge_index[:, nonzero_idx] + distances = distances[nonzero_idx] + + out = { + "edge_index": edge_index, + "distances": distances, + } + + if return_distance_vec: + out["distance_vec"] = distance_vectors[nonzero_idx] + + if return_offsets: + out["offsets"] = offsets[nonzero_idx] + + return out + + +def radius_graph_pbc( + pos: torch.Tensor, + pbc: torch.Tensor | None, + natoms: torch.Tensor, + cell: torch.Tensor, + radius: float, + max_num_neighbors_threshold: int, + max_cell_images_per_dim: int = sys.maxsize, +) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]: + """Function computing the graph in periodic boundary conditions on a (batched) set of + positions and cells. + + This function is copied from + https://github.com/Open-Catalyst-Project/ocp/blob/main/ocpmodels/common/utils.py, + commit 480eb9279ec4a5885981f1ee588c99dcb38838b5 + + Args: + pos (LongTensor): Atomic positions in cartesian coordinates + :obj:`[n, 3]` + pbc (BoolTensor): indicates periodic boundary conditions per structure. + :obj:`[n_structures, 3]` + natoms (IntTensor): number of atoms per structure. Has shape + :obj:`[n_structures]` + cell (Tensor): atomic cell. Has shape + :obj:`[n_structures, 3, 3]` + radius (float): cutoff radius distance + max_num_neighbors_threshold (int): Maximum number of neighbours to consider. + + Returns: + edge_index (IntTensor): index of atoms in edges. Has shape + :obj:`[n_edges, 2]` + cell_offsets (IntTensor): cell displacement w.r.t. their original position of atoms in edges. Has shape + :obj:`[n_edges, 3, 3]` + num_neighbors_image (IntTensor): Number of neighbours per cell image. + :obj:`[n_structures]` + offsets (LongTensor): cartesian displacement w.r.t. their original position of atoms in edges. Has shape + :obj:`[n_edges, 3, 3]` + atom_distance (LongTensor): edge length. Has shape + :obj:`[n_edges]` + """ + device = pos.device + batch_size = len(natoms) + pbc_ = [False, False, False] + + if pbc is not None: + pbc = torch.atleast_2d(pbc) + for i in range(3): + if not torch.any(pbc[:, i]).item(): + pbc_[i] = False + elif torch.all(pbc[:, i]).item(): + pbc_[i] = True + else: + raise RuntimeError( + "Different structures in the batch have different PBC configurations. This is not currently supported." + ) + + natoms_squared = (natoms**2).long() + + # index offset between images + index_offset = torch.cumsum(natoms, dim=0) - natoms + + index_offset_expand = torch.repeat_interleave(index_offset, natoms_squared) + natoms_expand = torch.repeat_interleave(natoms, natoms_squared) + + # Compute a tensor containing sequences of numbers that range from 0 to num_atoms_per_image_squared for each image + # that is used to compute indices for the pairs of atoms. This is a very convoluted way to implement + # the following (but 10x faster since it removes the for loop) + # for batch_idx in range(batch_size): + # batch_count = torch.cat([batch_count, torch.arange(num_atoms_per_image_squared[batch_idx], device=device)], dim=0) + num_atom_pairs = torch.sum(natoms_squared) + index_squared_offset = torch.cumsum(natoms_squared, dim=0) - natoms_squared + index_squared_offset = torch.repeat_interleave(index_squared_offset, natoms_squared) + atom_count_squared = torch.arange(num_atom_pairs, device=device) - index_squared_offset + + # Compute the indices for the pairs of atoms (using division and mod) + # If the systems get too large this approach could run into numerical precision issues + index1 = ( + torch.div(atom_count_squared, natoms_expand, rounding_mode="floor") + ) + index_offset_expand + index2 = (atom_count_squared % natoms_expand) + index_offset_expand + # Get the positions for each atom + pos1 = torch.index_select(pos, 0, index1) + pos2 = torch.index_select(pos, 0, index2) + + # Calculate required number of unit cells in each direction. + # Smallest distance between planes separated by a1 is + # 1 / ||(a2 x a3) / V||_2, since a2 x a3 is the area of the plane. + # Note that the unit cell volume V = a1 * (a2 x a3) and that + # (a2 x a3) / V is also the reciprocal primitive vector + # (crystallographer's definition). + + cross_a2a3 = torch.cross(cell[:, 1], cell[:, 2], dim=-1) + cell_vol = torch.sum(cell[:, 0] * cross_a2a3, dim=-1, keepdim=True) + + if pbc_[0]: + inv_min_dist_a1 = torch.norm(cross_a2a3 / cell_vol, p=2, dim=-1) + rep_a1 = torch.ceil(radius * inv_min_dist_a1) + else: + rep_a1 = cell.new_zeros(1) + + if pbc_[1]: + cross_a3a1 = torch.cross(cell[:, 2], cell[:, 0], dim=-1) + inv_min_dist_a2 = torch.norm(cross_a3a1 / cell_vol, p=2, dim=-1) + rep_a2 = torch.ceil(radius * inv_min_dist_a2) + else: + rep_a2 = cell.new_zeros(1) + + if pbc_[2]: + cross_a1a2 = torch.cross(cell[:, 0], cell[:, 1], dim=-1) + inv_min_dist_a3 = torch.norm(cross_a1a2 / cell_vol, p=2, dim=-1) + rep_a3 = torch.ceil(radius * inv_min_dist_a3) + else: + rep_a3 = cell.new_zeros(1) + + # Take the max over all images for uniformity. This is essentially padding. + # Note that this can significantly increase the number of computed distances + # if the required repetitions are very different between images + # (which they usually are). Changing this to sparse (scatter) operations + # might be worth the effort if this function becomes a bottleneck. + # + # max_cell_images_per_dim limits the number of periodic + # cell images that are considered per lattice vector dimension. This is + # useful in case we encounter an extremely skewed or small lattice that + # results in an explosion of the number of images considered. + max_rep = [ + min(int(rep_a1.max()), max_cell_images_per_dim), + min(int(rep_a2.max()), max_cell_images_per_dim), + min(int(rep_a3.max()), max_cell_images_per_dim), + ] + + # Tensor of unit cells + cells_per_dim = [ + torch.arange(-rep, rep + 1, device=device, dtype=torch.float) for rep in max_rep + ] + cell_offsets = torch.cartesian_prod(*cells_per_dim) + num_cells = len(cell_offsets) + cell_offsets_per_atom = cell_offsets.view(1, num_cells, 3).repeat(len(index2), 1, 1) + cell_offsets = torch.transpose(cell_offsets, 0, 1) + cell_offsets_batch = cell_offsets.view(1, 3, num_cells).expand(batch_size, -1, -1) + + # Compute the x, y, z positional offsets for each cell in each image + data_cell = torch.transpose(cell, 1, 2) + pbc_offsets = torch.bmm(data_cell, cell_offsets_batch) + pbc_offsets_per_atom = torch.repeat_interleave(pbc_offsets, natoms_squared, dim=0) + + # Expand the positions and indices for the 9 cells + pos1 = pos1.view(-1, 3, 1).expand(-1, -1, num_cells) + pos2 = pos2.view(-1, 3, 1).expand(-1, -1, num_cells) + index1 = index1.view(-1, 1).repeat(1, num_cells).view(-1) + index2 = index2.view(-1, 1).repeat(1, num_cells).view(-1) + # Add the PBC offsets for the second atom + pos2 = pos2 + pbc_offsets_per_atom + + # Compute the squared distance between atoms + atom_distance_squared = torch.sum((pos1 - pos2) ** 2, dim=1) + atom_distance_squared = atom_distance_squared.view(-1) + + # Remove pairs that are too far apart + mask_within_radius = torch.le(atom_distance_squared, radius * radius) + # Remove pairs with the same atoms (distance = 0.0) + mask_not_same = torch.gt(atom_distance_squared, 0.0001) + mask = torch.logical_and(mask_within_radius, mask_not_same) + index1 = torch.masked_select(index1, mask) + index2 = torch.masked_select(index2, mask) + cell_offsets = torch.masked_select( + cell_offsets_per_atom.view(-1, 3), mask.view(-1, 1).expand(-1, 3) + ) + cell_offsets = cell_offsets.view(-1, 3) + atom_distance_squared = torch.masked_select(atom_distance_squared, mask) + + mask_num_neighbors, num_neighbors_image = get_max_neighbors_mask( + natoms=natoms, + index=index1, + atom_distance_squared=atom_distance_squared, + max_num_neighbors_threshold=max_num_neighbors_threshold, + ) + + if not torch.all(mask_num_neighbors): + # Mask out the atoms to ensure each atom has at most max_num_neighbors_threshold neighbors + index1 = torch.masked_select(index1, mask_num_neighbors) + index2 = torch.masked_select(index2, mask_num_neighbors) + atom_distance_squared = torch.masked_select(atom_distance_squared, mask_num_neighbors) + cell_offsets = torch.masked_select( + cell_offsets.view(-1, 3), mask_num_neighbors.view(-1, 1).expand(-1, 3) + ) + cell_offsets = cell_offsets.view(-1, 3) + + edge_index = torch.stack((index2, index1)) + # shifts = -torch.matmul(unit_cell, data.cell).view(-1, 3) + + cell_repeated = torch.repeat_interleave(cell, num_neighbors_image, dim=0) + offsets = -cell_offsets.float().view(-1, 1, 3).bmm(cell_repeated.float()).view(-1, 3) + return ( + edge_index, + cell_offsets, + num_neighbors_image, + offsets, + torch.sqrt(atom_distance_squared), + ) + + +def get_max_neighbors_mask( + natoms: torch.Tensor, + index: torch.Tensor, + atom_distance_squared: torch.Tensor, + max_num_neighbors_threshold: int, +) -> tuple[torch.Tensor, torch.Tensor]: + """ + Give a mask that filters out edges so that each atom has at most + `max_num_neighbors_threshold` neighbors. + Assumes that `index` is sorted. + """ + device = natoms.device + num_atoms = natoms.sum() + + # Get number of neighbors + # segment_coo assumes sorted index + ones = index.new_ones(1).expand_as(index) + # required because PyG does not support MPS for the segment_coo operation yet. + pyg_device = get_pyg_device() + device_before = ones.device + num_neighbors = segment_coo(ones.to(pyg_device), index.to(pyg_device), dim_size=num_atoms).to( + device_before + ) + max_num_neighbors = num_neighbors.max() + num_neighbors_thresholded = num_neighbors.clamp(max=max_num_neighbors_threshold) + + # Get number of (thresholded) neighbors per image + image_indptr = torch.zeros(natoms.shape[0] + 1, device=device, dtype=torch.long) + image_indptr[1:] = torch.cumsum(natoms, dim=0) + num_neighbors_image = segment_csr( + num_neighbors_thresholded.to(pyg_device), image_indptr.to(pyg_device) + ).to(device_before) + + # If max_num_neighbors is below the threshold, return early + if max_num_neighbors <= max_num_neighbors_threshold or max_num_neighbors_threshold <= 0: + mask_num_neighbors = torch.tensor([True], dtype=bool, device=device).expand_as(index) + return mask_num_neighbors, num_neighbors_image + + # Create a tensor of size [num_atoms, max_num_neighbors] to sort the distances of the neighbors. + # Fill with infinity so we can easily remove unused distances later. + distance_sort = torch.full([num_atoms * max_num_neighbors], np.inf, device=device) + + # Create an index map to map distances from atom_distance to distance_sort + # index_sort_map assumes index to be sorted + index_neighbor_offset = torch.cumsum(num_neighbors, dim=0) - num_neighbors + index_neighbor_offset_expand = torch.repeat_interleave(index_neighbor_offset, num_neighbors) + index_sort_map = ( + index * max_num_neighbors + + torch.arange(len(index), device=device) + - index_neighbor_offset_expand + ) + distance_sort.index_copy_(0, index_sort_map, atom_distance_squared) + distance_sort = distance_sort.view(num_atoms, max_num_neighbors) + + # Sort neighboring atoms based on distance + distance_sort, index_sort = torch.sort(distance_sort, dim=1) + # Select the max_num_neighbors_threshold neighbors that are closest + distance_sort = distance_sort[:, :max_num_neighbors_threshold] + index_sort = index_sort[:, :max_num_neighbors_threshold] + + # Offset index_sort so that it indexes into index + index_sort = index_sort + index_neighbor_offset.view(-1, 1).expand( + -1, max_num_neighbors_threshold + ) + # Remove "unused pairs" with infinite distances + mask_finite = torch.isfinite(distance_sort) + index_sort = torch.masked_select(index_sort, mask_finite) + + # At this point index_sort contains the index into index of the + # closest max_num_neighbors_threshold neighbors per atom + # Create a mask to remove all pairs not in index_sort + mask_num_neighbors = torch.zeros(len(index), device=device, dtype=bool) + mask_num_neighbors.index_fill_(0, index_sort, True) + + return mask_num_neighbors, num_neighbors_image diff --git a/data/mattergen/conf/adapter/default.yaml b/data/mattergen/conf/adapter/default.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6c3092b14d112f81b2459229aaac7fc65ab48cb4 --- /dev/null +++ b/data/mattergen/conf/adapter/default.yaml @@ -0,0 +1,15 @@ +model_path: ${oc.env:MAP_INPUT_DIR} +load_epoch: last +full_finetuning: true + +adapter: + # these arguments are used to initialize GemNetTAdapter + # more args are added by the finetuning script during runtime + _target_: mattergen.adapter.GemNetTAdapter + property_embeddings_adapt: {} + +defaults: [] + # path/to/config_dir@attribute.name: config_file_name + ## e.g., insert values from dft_bulk_modulus.yaml in /lightning_module/diffusion_module/model/property_embeddings/ + ## into adapter.property_embeddings_adapt[dft_bulk_modulus] + # - /lightning_module/diffusion_module/model/property_embeddings@adapter.property_embeddings_adapt.dft_bulk_modulus: dft_bulk_modulus diff --git a/data/mattergen/conf/csp.yaml b/data/mattergen/conf/csp.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fa9d880df3903a59c920e35863ea52a076e754e1 --- /dev/null +++ b/data/mattergen/conf/csp.yaml @@ -0,0 +1,14 @@ +hydra: + run: + dir: ${oc.env:OUTPUT_DIR,outputs/singlerun/${now:%Y-%m-%d}/${now:%H-%M-%S}} + + +auto_resume: true + +defaults: + - data_module: mp_20 + - trainer: default + - lightning_module: default + - lightning_module/diffusion_module: csp + - lightning_module/diffusion_module/model: mattergen + - lightning_module/diffusion_module/corruption: csp diff --git a/data/mattergen/conf/data_module/alex_mp_20.yaml b/data/mattergen/conf/data_module/alex_mp_20.yaml new file mode 100644 index 0000000000000000000000000000000000000000..125e3b062790184f2d3dfe04b452057354cc10a8 --- /dev/null +++ b/data/mattergen/conf/data_module/alex_mp_20.yaml @@ -0,0 +1,49 @@ +_target_: mattergen.common.data.datamodule.CrystDataModule +_recursive_: true +properties: [] + # Supported properties: + # - dft_bulk_modulus + # - dft_band_gap + # - dft_mag_density + # - ml_bulk_modulus + # - hhi_score + # - space_group + # - energy_above_hull + +dataset_transforms: + - _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + _partial_: true + +transforms: +- _target_: mattergen.common.data.transform.symmetrize_lattice + _partial_: true +- _target_: mattergen.common.data.transform.set_chemical_system_string + _partial_: true + +average_density: 0.05771451654022283 # atoms/Angstrom**3 : this is used in models/scripts/run.py to set lattice_limit_density +root_dir: ${oc.env:PROJECT_ROOT}/../datasets/cache/alex_mp_20 + +train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: ${data_module.root_dir}/train + properties: ${data_module.properties} + transforms: ${data_module.transforms} + dataset_transforms: ${data_module.dataset_transforms} + +val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: ${data_module.root_dir}/val + properties: ${data_module.properties} + transforms: ${data_module.transforms} + dataset_transforms: ${data_module.dataset_transforms} + +num_workers: + train: 0 + val: 0 + +batch_size: + # total batch size of 512, adjust for number of devices, nodes, and gradient accumulation + train: ${eval:'(512 // ${trainer.accumulate_grad_batches}) // (${trainer.devices} * ${trainer.num_nodes})'} + val: ${eval:'(512 // ${trainer.accumulate_grad_batches}) // (${trainer.devices} * ${trainer.num_nodes})'} + +max_epochs: 2200 \ No newline at end of file diff --git a/data/mattergen/conf/data_module/mp_20.yaml b/data/mattergen/conf/data_module/mp_20.yaml new file mode 100644 index 0000000000000000000000000000000000000000..64ad8b6d442b7da320c551ef79e2e34faf0107ce --- /dev/null +++ b/data/mattergen/conf/data_module/mp_20.yaml @@ -0,0 +1,53 @@ +_target_: mattergen.common.data.datamodule.CrystDataModule +_recursive_: true +properties: [] + # Supported properties: + # - dft_bulk_modulus + # - dft_band_gap + # - dft_mag_density + +transforms: +- _target_: mattergen.common.data.transform.symmetrize_lattice + _partial_: true +- _target_: mattergen.common.data.transform.set_chemical_system_string + _partial_: true + +dataset_transforms: + - _target_: mattergen.common.data.dataset_transform.filter_sparse_properties + _partial_: true + +average_density: 0.05771451654022283 # atoms/Angstrom**3 : this is used in models/scripts/run.py to set lattice_limit_density +root_dir: ${oc.env:PROJECT_ROOT}/../datasets/cache/mp_20 + +train_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: ${data_module.root_dir}/train + properties: ${data_module.properties} + transforms: ${data_module.transforms} + dataset_transforms: ${data_module.dataset_transforms} + +val_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: ${data_module.root_dir}/val + properties: ${data_module.properties} + transforms: ${data_module.transforms} + dataset_transforms: ${data_module.dataset_transforms} + +test_dataset: + _target_: mattergen.common.data.dataset.CrystalDataset.from_cache_path + cache_path: ${data_module.root_dir}/test + properties: ${data_module.properties} + transforms: ${data_module.transforms} + dataset_transforms: ${data_module.dataset_transforms} + +num_workers: + train: 0 + val: 0 + test: 0 + +batch_size: + train: 128 + val: 128 + test: 128 + +max_epochs: 900 \ No newline at end of file diff --git a/data/mattergen/conf/default.yaml b/data/mattergen/conf/default.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bb8893f8b4b0fb343ae673642fc4951f577262cc --- /dev/null +++ b/data/mattergen/conf/default.yaml @@ -0,0 +1,13 @@ +hydra: + run: + dir: ${oc.env:OUTPUT_DIR,outputs/singlerun/${now:%Y-%m-%d}/${now:%H-%M-%S}} + +auto_resume: True + +defaults: + - data_module: mp_20 + - trainer: default + - lightning_module: default + - lightning_module/diffusion_module: default + - lightning_module/diffusion_module/model: mattergen + - lightning_module/diffusion_module/corruption: default diff --git a/data/mattergen/conf/finetune.yaml b/data/mattergen/conf/finetune.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9a9c53fa537a1205cc61f711c4162d9d01897d0f --- /dev/null +++ b/data/mattergen/conf/finetune.yaml @@ -0,0 +1,18 @@ +hydra: + run: + dir: ${oc.env:OUTPUT_DIR,outputs/singlerun/${now:%Y-%m-%d}/${now:%H-%M-%S}} + +defaults: + - data_module: mp_20 + - trainer: default + - lightning_module: default + - adapter: default + +trainer: + max_epochs: 200 + logger: + job_type: train_finetune # override default defined in defaults.trainer yaml file + +lightning_module: + optimizer_partial: + lr: 5e-6 diff --git a/data/mattergen/conf/lightning_module/default.yaml b/data/mattergen/conf/lightning_module/default.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a5f91c7c1fd2404a5dfc63114f1e4b2347675216 --- /dev/null +++ b/data/mattergen/conf/lightning_module/default.yaml @@ -0,0 +1,17 @@ +_target_: mattergen.diffusion.lightning_module.DiffusionLightningModule +optimizer_partial: + lr: 1e-4 + _target_: torch.optim.Adam + _partial_: true +scheduler_partials: + - scheduler: + _target_: torch.optim.lr_scheduler.ReduceLROnPlateau + factor: 0.6 + patience: 100 + min_lr: 1e-6 + verbose: true + _partial_: true + interval: epoch + frequency: 1 + monitor: loss_train + strict: true diff --git a/data/mattergen/conf/lightning_module/diffusion_module/corruption/csp.yaml b/data/mattergen/conf/lightning_module/diffusion_module/corruption/csp.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8c4942e28e3192f42b29de31a4b7abd6bb3f09ef --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/corruption/csp.yaml @@ -0,0 +1,15 @@ +_target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption +sdes: + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + wrapping_boundary: 1.0 + sigma_max: 5.0 + limit_info_key: num_atoms + + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_min: 0.1 + beta_max: 20 + limit_density: ${data_module.average_density} + limit_var_scaling_constant: 0.25 diff --git a/data/mattergen/conf/lightning_module/diffusion_module/corruption/default.yaml b/data/mattergen/conf/lightning_module/diffusion_module/corruption/default.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a516cdb978eb630c50af161a9feb315747ee2c6e --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/corruption/default.yaml @@ -0,0 +1,27 @@ +_target_: mattergen.diffusion.corruption.multi_corruption.MultiCorruption +sdes: + pos: + _target_: mattergen.common.diffusion.corruption.NumAtomsVarianceAdjustedWrappedVESDE + wrapping_boundary: 1.0 + sigma_max: 5.0 + limit_info_key: num_atoms + + cell: + _target_: mattergen.common.diffusion.corruption.LatticeVPSDE.from_vpsde_config + vpsde_config: + beta_min: 0.1 + beta_max: 20 + limit_density: ${data_module.average_density} + limit_var_scaling_constant: 0.25 + +discrete_corruptions: + atomic_numbers: + _target_: mattergen.diffusion.corruption.d3pm_corruption.D3PMCorruption + offset: 1 + d3pm: + _target_: mattergen.diffusion.d3pm.d3pm.MaskDiffusion + dim: 101 + schedule: + _target_: mattergen.diffusion.d3pm.d3pm.create_discrete_diffusion_schedule + kind: standard + num_steps: 1000 diff --git a/data/mattergen/conf/lightning_module/diffusion_module/csp.yaml b/data/mattergen/conf/lightning_module/diffusion_module/csp.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0f4efc61dcfa6da9014fda65ddb9e73d95d956b4 --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/csp.yaml @@ -0,0 +1,19 @@ +_target_: mattergen.diffusion.diffusion_module.DiffusionModule +model: mattergen +corruption: csp + +loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + reduce: sum + include_pos: True + include_cell: True + include_atomic_numbers: False + weights: + cell: 1.0 + pos: 0.1 + + +pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + p_unconditional: 0.2 + dropout_fields_iid: false \ No newline at end of file diff --git a/data/mattergen/conf/lightning_module/diffusion_module/default.yaml b/data/mattergen/conf/lightning_module/diffusion_module/default.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1217be39b971fb9ce42fdef68813ebfb0dae2c3d --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/default.yaml @@ -0,0 +1,18 @@ +_target_: mattergen.diffusion.diffusion_module.DiffusionModule +loss_fn: + _target_: mattergen.common.loss.MaterialsLoss + reduce: sum + include_pos: True + include_cell: True + include_atomic_numbers: True + d3pm_hybrid_lambda: 0.01 + weights: + cell: 1.0 + pos: 0.1 + atomic_numbers: 1.0 +model: mattergen +corruption: default +pre_corruption_fn: + _target_: mattergen.property_embeddings.SetEmbeddingType + p_unconditional: 0.2 + dropout_fields_iid: false diff --git a/data/mattergen/conf/lightning_module/diffusion_module/model/mattergen.yaml b/data/mattergen/conf/lightning_module/diffusion_module/model/mattergen.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b3f190b33458192e084cda5876a4e741dec18de4 --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/model/mattergen.yaml @@ -0,0 +1,29 @@ +_target_: mattergen.denoiser.GemNetTDenoiser +hidden_dim: 512 +gemnet: + _target_: mattergen.common.gemnet.gemnet.GemNetT + num_targets: 1 + latent_dim: ${eval:'${..hidden_dim} * (1 + len(${..property_embeddings}))'} # 1 is for time encoding. + atom_embedding: + _target_: mattergen.common.gemnet.layers.embedding_block.AtomEmbedding + emb_size: ${...hidden_dim} + with_mask_type: ${eval:'${...denoise_atom_types} and "${...atom_type_diffusion}" == "mask"'} + emb_size_atom: ${..hidden_dim} + emb_size_edge: ${..hidden_dim} + max_neighbors: 50 + max_cell_images_per_dim: 5 + cutoff: 7. + num_blocks: 4 + regress_stress: true + otf_graph: true + scale_file: ${oc.env:PROJECT_ROOT}/common/gemnet/gemnet-dT.json +denoise_atom_types: true +atom_type_diffusion: mask +property_embeddings_adapt: {} +property_embeddings: {} +defaults: [] # NOTE: to train a conditional model, unccoment entries such as property_embeddings@property_embeddings.chemical_system: chemical_system below and edit/add properties to the defaults list as desired. + # see https://stackoverflow.com/questions/71356361/selecting-multiple-configs-from-a-config-group-in-hydra-without-using-an-explici + # add via config override: +lightning_module/diffusion_module/model/property_embeddings@lightning_module.diffusion_module.model.property_embeddings.dft_bulk_modulus=dft_bulk_modulus + # delete via config override: ~lightning_module/diffusion_module/model/property_embeddings@lightning_module.diffusion_module.model.property_embeddings.chemical_system + # - property_embeddings@property_embeddings.chemical_system: chemical_system + # - property_embeddings@property_embeddings.dft_bulk_modulus: dft_bulk_modulus diff --git a/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/chemical_system.yaml b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/chemical_system.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5182103fb576894849ce0aa0bb0b04bc3357a515 --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/chemical_system.yaml @@ -0,0 +1,10 @@ +_target_: mattergen.property_embeddings.PropertyEmbedding +name: chemical_system +unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +conditional_embedding_module: + _target_: mattergen.property_embeddings.ChemicalSystemMultiHotEmbedding + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +scaler: + _target_: torch.nn.Identity diff --git a/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/dft_band_gap.yaml b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/dft_band_gap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..36570e57b0f1df7d0e734ec391802231ee334436 --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/dft_band_gap.yaml @@ -0,0 +1,10 @@ +_target_: mattergen.property_embeddings.PropertyEmbedding +name: dft_band_gap +unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: ${lightning_module.diffusion_module.model.hidden_dim} +scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch diff --git a/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/dft_bulk_modulus.yaml b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/dft_bulk_modulus.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e400524d637f1f433bc0cee05f6379a820b6f3ce --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/dft_bulk_modulus.yaml @@ -0,0 +1,10 @@ +_target_: mattergen.property_embeddings.PropertyEmbedding +name: dft_bulk_modulus +unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: ${lightning_module.diffusion_module.model.hidden_dim} +scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch diff --git a/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/dft_mag_density.yaml b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/dft_mag_density.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3f5f0b1b18a788464917707b34bcba65ba885d0a --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/dft_mag_density.yaml @@ -0,0 +1,10 @@ +_target_: mattergen.property_embeddings.PropertyEmbedding +name: dft_mag_density +unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: ${lightning_module.diffusion_module.model.hidden_dim} +scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch diff --git a/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/energy_above_hull.yaml b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/energy_above_hull.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0624a24eacad86141a171748a481d482302d71b1 --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/energy_above_hull.yaml @@ -0,0 +1,10 @@ +_target_: mattergen.property_embeddings.PropertyEmbedding +name: energy_above_hull +unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: ${lightning_module.diffusion_module.model.hidden_dim} +scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch diff --git a/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/hhi_score.yaml b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/hhi_score.yaml new file mode 100644 index 0000000000000000000000000000000000000000..38685988edfdfb7a4b35b186b49e0f3914fae5d2 --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/hhi_score.yaml @@ -0,0 +1,10 @@ +_target_: mattergen.property_embeddings.PropertyEmbedding +name: hhi_score +unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: ${lightning_module.diffusion_module.model.hidden_dim} +scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch diff --git a/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/ml_bulk_modulus.yaml b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/ml_bulk_modulus.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9b97af3eb1223e761647749aa99372f2f37d292c --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/ml_bulk_modulus.yaml @@ -0,0 +1,10 @@ +_target_: mattergen.property_embeddings.PropertyEmbedding +name: ml_bulk_modulus +unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +conditional_embedding_module: + _target_: mattergen.diffusion.model_utils.NoiseLevelEncoding + d_model: ${lightning_module.diffusion_module.model.hidden_dim} +scaler: + _target_: mattergen.common.utils.data_utils.StandardScalerTorch diff --git a/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/space_group.yaml b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/space_group.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3ca8a04f042d8003d6aba89445b11509a9e73731 --- /dev/null +++ b/data/mattergen/conf/lightning_module/diffusion_module/model/property_embeddings/space_group.yaml @@ -0,0 +1,10 @@ +_target_: mattergen.property_embeddings.PropertyEmbedding +name: space_group +unconditional_embedding_module: + _target_: mattergen.property_embeddings.EmbeddingVector + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +conditional_embedding_module: + _target_: mattergen.property_embeddings.SpaceGroupEmbeddingVector + hidden_dim: ${lightning_module.diffusion_module.model.hidden_dim} +scaler: + _target_: torch.nn.Identity diff --git a/data/mattergen/conf/trainer/default.yaml b/data/mattergen/conf/trainer/default.yaml new file mode 100644 index 0000000000000000000000000000000000000000..92fcf649e975afb0e9a53297bfa5d8e0aa44ab1c --- /dev/null +++ b/data/mattergen/conf/trainer/default.yaml @@ -0,0 +1,38 @@ +_target_: pytorch_lightning.Trainer +accelerator: 'gpu' +devices: 1 +num_nodes: 1 +precision: 32 +max_epochs: ${data_module.max_epochs} +accumulate_grad_batches: 1 +gradient_clip_val: 0.5 +gradient_clip_algorithm: value +check_val_every_n_epoch: 5 +strategy: + _target_: pytorch_lightning.strategies.ddp.DDPStrategy + find_unused_parameters: true + +logger: + _target_: pytorch_lightning.loggers.WandbLogger + project: crystal-generation + job_type: train + settings: + _target_: wandb.Settings + start_method: fork + _save_requirements: False + +callbacks: + - _target_: pytorch_lightning.callbacks.LearningRateMonitor + logging_interval: step + log_momentum: False + - _target_: pytorch_lightning.callbacks.ModelCheckpoint + monitor: loss_val + mode: min + save_top_k: 1 + save_last: True + verbose: false + every_n_epochs: 1 + filename: "{epoch}-{loss_val:.2f}" + - _target_: pytorch_lightning.callbacks.TQDMProgressBar + refresh_rate: 50 + - _target_: mattergen.common.data.callback.SetPropertyScalers diff --git a/data/mattergen/denoiser.py b/data/mattergen/denoiser.py new file mode 100644 index 0000000000000000000000000000000000000000..bb01970bba514e881ac96bb3674b59ace7e51892 --- /dev/null +++ b/data/mattergen/denoiser.py @@ -0,0 +1,282 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Callable + +import torch +import torch.nn as nn + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.data.types import PropertySourceId +from mattergen.common.utils.globals import MAX_ATOMIC_NUM, SELECTED_ATOMIC_NUMBERS +from mattergen.diffusion.model_utils import NoiseLevelEncoding +from mattergen.diffusion.score_models.base import ScoreModel +from mattergen.property_embeddings import ( + ChemicalSystemMultiHotEmbedding, + get_property_embeddings, + get_use_unconditional_embedding, +) + +BatchTransform = Callable[[ChemGraph], ChemGraph] + + +def atomic_numbers_to_mask(atomic_numbers: torch.LongTensor, max_atomic_num: int) -> torch.Tensor: + """Convert atomic numbers to a mask. + + Args: + atomic_numbers (torch.LongTensor): One-based atomic numbers of shape (batch_size, ) + + Returns: + torch.Tensor: Mask of shape (batch_size, num_classes) + """ + k_hot_mask = torch.eye(max_atomic_num, device=atomic_numbers.device)[atomic_numbers - 1] + return k_hot_mask + + +def mask_logits(logits: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + """Mask logits by setting the logits for masked items to -inf. + + Args: + logits (torch.Tensor): Logits of shape (batch_size, num_classes) + mask (torch.Tensor): Mask of shape (batch_size, num_classes). Values with zero are masked. + + Returns: + torch.Tensor: Masked logits + """ + return logits + (1 - mask) * -1e10 + + +def mask_disallowed_elements( + logits: torch.FloatTensor, + x: ChemGraph | None = None, + batch_idx: torch.LongTensor | None = None, + predictions_are_zero_based: bool = True, +): + """ + Mask out atom types that are disallowed in general, + as well as potentially all elements not in the chemical system we condition on. + + Args: + logits (torch.Tensor): Logits of shape (batch_size, num_classes) + x (ChemGraph) + batch_idx (torch.LongTensor, optional): Batch indices. Defaults to None. Must be provided if condition is not None. + predictions_are_zero_based (bool, optional): Whether the logits are zero-based. Defaults to True. Basically, if we're using D3PM, + the logits are zero-based (model predicts atomic number index) + """ + # First, mask out generally undesired elements + # (1, num_selected_elements) + selected_atomic_numbers = torch.tensor(SELECTED_ATOMIC_NUMBERS, device=logits.device) + predictions_are_one_based = not predictions_are_zero_based + # (num_atoms, num_classes) + one_hot_selected_elements = atomic_numbers_to_mask( + atomic_numbers=selected_atomic_numbers + int(predictions_are_one_based), + max_atomic_num=logits.shape[1], + ) + # (1, num_classes) + k_hot_mask = one_hot_selected_elements.sum(0)[None] + # Set the logits for disallowed elements to -inf + logits = mask_logits(logits=logits, mask=k_hot_mask) + + # Optionally, also mask out elements that are not in the chemical system we condition on + if x is not None and "chemical_system" in x and x["chemical_system"] is not None: + try: + # torch.BoolTensor, shape (batch_size, 1) -- do not mask logits when we use an unconditional embedding + do_not_mask_atom_logits = get_use_unconditional_embedding( + batch=x, cond_field="chemical_system" + ) + except KeyError: + # if no mask provided to use conditional/unconditional labels then do not mask logits + do_not_mask_atom_logits = torch.ones( + (len(x["chemical_system"]), 1), dtype=torch.bool, device=x["num_atoms"].device + ) + + # mypy + assert batch_idx is not None, "batch_idx must be provided if condition is not None" + # Only mask atom types where the condition is not masked + # A 1 means that we do not alter the logit, a 0 means that we change the logit to -inf + # keep_logits.shape=(Nbatch, MAX_ATOMIC_NUM+1) + + # 1 = keep logit, 0 = set logit to -inf, shape = (Nbatch, MAX_ATOMIC_NUM+1) + keep_all_logits = torch.ones((len(x["chemical_system"]), 1), device=x["num_atoms"].device) + + # torch.Tensor, shape=(Nbatch,MAX_ATOMIC_NUM+1) -- 1s where elements are present in chemical system condition, 0 elsewhere + multi_hot_chemical_system = ChemicalSystemMultiHotEmbedding.sequences_to_multi_hot( + x=ChemicalSystemMultiHotEmbedding.convert_to_list_of_str(x=x["chemical_system"]), + device=x["num_atoms"].device, + ) + + keep_logits = torch.where( + do_not_mask_atom_logits, + keep_all_logits, + multi_hot_chemical_system, + ) + # This is converting the 1-based chemical system condition to a 0-based + # condition -- we're doing it on the multi-hot representation of the + # chemical system, so we need to shift the indices by one. + if predictions_are_zero_based: + keep_logits = keep_logits[:, 1:] + # If we use mask diffusion, logits is shape [batch_size, MAX_ATOMIC_NUM + 1] + # instead of [batch_size, MAX_ATOMIC_NUM], so we have to add one dummy column + if keep_logits.shape[1] == logits.shape[1] - 1: + keep_logits = torch.cat([keep_logits, torch.zeros_like(keep_logits[:, :1])], dim=-1) + # Mask out all logits outside the chemical system we condition on + logits = mask_logits(logits, keep_logits[batch_idx]) + + return logits + + +def get_chemgraph_from_denoiser_output( + pred_atom_types: torch.Tensor, + pred_lattice_eps: torch.Tensor, + pred_cart_pos_eps: torch.Tensor, + training: bool, + element_mask_func: Callable | None, + x_input: ChemGraph, +) -> ChemGraph: + """ + Convert raw denoiser output to ChemGraph and optionally apply masking to element logits. + + Keyword arguments + ----------------- + pred_atom_atoms: predicted logits for atom types + pred_lattice_eps: predicted lattice noise + pred_cart_pos_eps: predicted cartesian position noise + training: whether or not the model is in training mode - logit masking is only applied when sampling + element_mask_func: when not training, a function can be applied to mask logits for certain atom types + x_input: the nosiy state input to the score model, contains the lattice to convert cartesisan to fractional noise. + """ + if not training and element_mask_func: + # when sampling we may want to mask logits for atom types depending on info in x['chemical_system'] and x['chemical_system_MASK'] + pred_atom_types = element_mask_func( + logits=pred_atom_types, + x=x_input, + batch_idx=x_input.get_batch_idx("pos"), + ) + + replace_dict = dict( + # convert from cartesian to fractional coordinate score + pos=( + x_input["cell"].inverse().transpose(1, 2)[x_input.get_batch_idx("pos")] + @ pred_cart_pos_eps.unsqueeze(-1) + ).squeeze(-1), + cell=pred_lattice_eps, + atomic_numbers=pred_atom_types, + ) + return x_input.replace( + **replace_dict, + ) + + +class GemNetTDenoiser(ScoreModel): + """Denoiser""" + + def __init__( + self, + gemnet: nn.Module, + hidden_dim: int = 512, + denoise_atom_types: bool = True, + atom_type_diffusion: str = [ + "mask", + "uniform", + ][0], + property_embeddings: torch.nn.ModuleDict | None = None, + property_embeddings_adapt: torch.nn.ModuleDict | None = None, + element_mask_func: Callable | None = None, + **kwargs, + ): + """Construct a GemNetTDenoiser object. + + Args: + gemnet: a GNN module + hidden_dim (int, optional): Number of hidden dimensions in the GemNet. Defaults to 128. + denoise_atom_types (bool, optional): Whether to denoise the atom types. Defaults to False. + atom_type_diffusion (str, optional): Which type of atom type diffusion to use. Defaults to "mask". + condition_on (Optional[List[str]], optional): Which aspects of the data to condition on. Strings must be in ["property", "chemical_system"]. If None (default), condition on ["chemical_system"]. + """ + super(GemNetTDenoiser, self).__init__() + + self.gemnet = gemnet + self.noise_level_encoding = NoiseLevelEncoding(hidden_dim) + self.hidden_dim = hidden_dim + self.denoise_atom_types = denoise_atom_types + self.atom_type_diffusion = atom_type_diffusion + + # torch.nn.ModuleDict: Dict[PropertyName, PropertyEmbedding] + self.property_embeddings = torch.nn.ModuleDict(property_embeddings or {}) + + with_mask_type = self.denoise_atom_types and "mask" in self.atom_type_diffusion + self.fc_atom = nn.Linear(hidden_dim, MAX_ATOMIC_NUM + int(with_mask_type)) + + self.element_mask_func = element_mask_func + + def forward(self, x: ChemGraph, t: torch.Tensor) -> ChemGraph: + """ + args: + x: tuple containing: + frac_coords: (N_atoms, 3) + lattice: (N_cryst, 3, 3) + atom_types: (N_atoms, ), need to use atomic number e.g. H = 1 or ion state + num_atoms: (N_cryst,) + batch: (N_atoms,) + t: (N_cryst,): timestep per crystal + returns: + tuple of: + predicted epsilon: (N_atoms, 3) + lattice update: (N_crystals, 3, 3) + predicted atom types: (N_atoms, MAX_ATOMIC_NUM) + """ + (frac_coords, lattice, atom_types, num_atoms, batch) = ( + x["pos"], + x["cell"], + x["atomic_numbers"], + x["num_atoms"], + x.get_batch_idx("pos"), + ) + + # (num_atoms, hidden_dim) (num_crysts, 3) + t_enc = self.noise_level_encoding(t).to(lattice.device) + z_per_crystal = t_enc + + # evaluate property embedding values + property_embedding_values = get_property_embeddings( + batch=x, property_embeddings=self.property_embeddings + ) + + if len(property_embedding_values) > 0: + z_per_crystal = torch.cat([z_per_crystal, property_embedding_values], dim=-1) + + output = self.gemnet( + z=z_per_crystal, + frac_coords=frac_coords, + atom_types=atom_types, + num_atoms=num_atoms, + batch=batch, + lengths=None, + angles=None, + lattice=lattice, + # we construct the graph on the fly, hence pass None for these: + edge_index=None, + to_jimages=None, + num_bonds=None, + ) + pred_atom_types = self.fc_atom(output.node_embeddings) + + return get_chemgraph_from_denoiser_output( + pred_atom_types=pred_atom_types, + pred_lattice_eps=output.stress, + pred_cart_pos_eps=output.forces, + training=self.training, + element_mask_func=self.element_mask_func, + x_input=x, + ) + + @property + def cond_fields_model_was_trained_on(self) -> list[PropertySourceId]: + """ + We adopt the convention that all property embeddings are stored in torch.nn.ModuleDicts of + name property_embeddings or property_embeddings_adapt in the case of a fine tuned model. + + This function returns the list of all field names that a given score model was trained to + condition on. + """ + return list(self.property_embeddings) diff --git a/data/mattergen/diffusion/__init__.py b/data/mattergen/diffusion/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/cgmanifest.json b/data/mattergen/diffusion/cgmanifest.json new file mode 100644 index 0000000000000000000000000000000000000000..8e4f2373b2e506eaca2d81d823382ad738ac1420 --- /dev/null +++ b/data/mattergen/diffusion/cgmanifest.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "version": 1, + "registrations":[ + { + "component": { + "type": "git", + "git": { + "repositoryUrl": "https://github.com/yang-song/score_sde_pytorch", + "commitHash": "cb1f359f4aadf0ff9a5e122fe8fffc9451fd6e44" + } + }, + "developmentDependency" : false + } + ] +} \ No newline at end of file diff --git a/data/mattergen/diffusion/config.py b/data/mattergen/diffusion/config.py new file mode 100644 index 0000000000000000000000000000000000000000..453d88e91bdacfa823c42d28e325c5a1a2ed2f87 --- /dev/null +++ b/data/mattergen/diffusion/config.py @@ -0,0 +1,33 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from dataclasses import dataclass, field +from typing import Any + + +@dataclass +class Config: + + # This is for CLI applications that need to reuse a CLI parameter in multiple places + # in the config file. The idea is that you use `my_cli params.output_dir=foobar` + # and in other places in the config file `output_dir: ${params.output_dir}` + params: dict[str, Any] = field(default_factory=dict) + + checkpoint_path: str | None = None # Required if train == False + + # if load_original is True then we load original weights in validation mode instead of EMA + load_original: bool = False + + # When auto_resume is set to `True` the trainer saves a copy of each checkpoint in + # {trainer.default_root_dir}/checkpoints. Before starting training, we look in this + # directory for a checkpoint from which to resume training. + auto_resume: bool = False + + # DiffusionLightningModule + lightning_module: dict[str, Any] = field(default_factory=dict) + + # pytorch_lightning.Trainer + trainer: dict[str, Any] = field(default_factory=dict) + + # LightningDataModule + data_module: dict[str, Any] = field(default_factory=dict) diff --git a/data/mattergen/diffusion/corruption/__init__.py b/data/mattergen/diffusion/corruption/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/corruption/corruption.py b/data/mattergen/diffusion/corruption/corruption.py new file mode 100644 index 0000000000000000000000000000000000000000..a71da067905e02895073f339aef739ab5adb22df --- /dev/null +++ b/data/mattergen/diffusion/corruption/corruption.py @@ -0,0 +1,118 @@ +""" +Copyright 2020 The Google Research Authors. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. + +Based on code from https://github.com/yang-song/score_sde_pytorch/blob/main/sde_lib.py +which is released under Apache licence. + +Abstract SDE classes, Reverse SDE, and VE/VP SDEs. + +Key changes: +- Rename SDE => Corruption +- Remove several methods like .reverse(), .discretize() +""" + +import abc +import logging +from typing import Optional, Tuple, Union + +import torch + +from mattergen.diffusion.data.batched_data import BatchedData + +B = Optional[torch.LongTensor] + + +def _broadcast_like(x, like): + """ + add broadcast dimensions to x so that it can be broadcast over ``like`` + """ + if like is None: + return x + return x[(...,) + (None,) * (like.ndim - x.ndim)] + + +def maybe_expand(x: torch.Tensor, batch: B, like: torch.Tensor = None) -> torch.Tensor: + """ + + Args: + x: shape (batch_size, ...) + batch: shape (num_thingies,) with integer entries in the range [0, batch_size), indicating which sample each thingy belongs to + like: shape x.shape + potential additional dimensions + Returns: + expanded x with shape (num_thingies,), or if given like.shape, containing value of x for each thingy. + If `batch` is None, just returns `x` unmodified, to avoid pointless work if you have exactly one thingy per sample. + """ + x = _broadcast_like(x, like) + if batch is None: + return x + else: + if x.shape[0] == batch.shape[0]: + logging.warn( + "Warning: batch shape is == x shape, are you trying to expand something that is already expanded?" + ) + return x[batch] + + +class Corruption(abc.ABC): + """Abstract base class for corruption processes""" + + @property + @abc.abstractmethod + def T(self) -> float: + """End time of the corruption process.""" + pass + + @abc.abstractmethod + def marginal_prob( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> Tuple[torch.Tensor, torch.Tensor]: + """Parameters to determine the marginal distribution of the SDE, $p_t(x)$.""" + pass # mean: (num_nodes, num_features), std (num_nodes,) + + @abc.abstractmethod + def prior_sampling( + self, + shape: Union[torch.Size, Tuple], + conditioning_data: Optional[BatchedData] = None, + batch_idx: B = None, # This is normally unused but is needed for special cases such as sample-wise zero-centering. + ) -> torch.Tensor: + """Generate one sample from the prior distribution, $p_T(x)$.""" + pass + + @abc.abstractmethod + def prior_logp( + self, + z: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> torch.Tensor: + """Compute log-density of the prior distribution. + + Useful for computing the log-likelihood via probability flow ODE. + + Args: + z: latent code + Returns: + log probability density + """ + pass # prior_logp: (batch_size,) + + @abc.abstractmethod + def sample_marginal( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> torch.Tensor: + """Sample marginal for x(t) given x(0). + Returns: + sampled x(t) (same shape as input x). + """ + pass diff --git a/data/mattergen/diffusion/corruption/d3pm_corruption.py b/data/mattergen/diffusion/corruption/d3pm_corruption.py new file mode 100644 index 0000000000000000000000000000000000000000..0dd82dd68883f81f3660d48a93f2e572bbd4b7d6 --- /dev/null +++ b/data/mattergen/diffusion/corruption/d3pm_corruption.py @@ -0,0 +1,108 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Optional, Tuple, Union + +import torch +from torch_scatter import scatter_add + +from mattergen.diffusion.corruption.corruption import B, Corruption, maybe_expand +from mattergen.diffusion.d3pm import d3pm +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.discrete_time import to_discrete_time + + +class D3PMCorruption(Corruption): + """D3PM discrete corruption process. Has discret time and discrete (categorical) values.""" + + def __init__( + self, + d3pm: d3pm.DiscreteDiffusionBase, + offset: int = 0, + ): + super().__init__() + self.d3pm = d3pm + # Often, the data is not zero-indexed, so we need to offset the data + # E.g., if we are dealing with one-based class labels, we might want to offset by 1 to convert from zero-based indices to actual classes. + self.offset = offset + + @property + def N(self) -> int: + """Number of diffusion timesteps i.e. number of noise levels. + Must match number of noise levels used for sampling. To change this, we'd need to implement continuous-time diffusion for discrete things + as in e.g. Campbell et al. https://arxiv.org/abs/2205.14987""" + return self.d3pm.num_steps + + def _to_zero_based(self, x: torch.Tensor) -> torch.Tensor: + """Convert from non-zero-based indices to zero-based indices.""" + return x - self.offset + + def _to_non_zero_based(self, x: torch.Tensor) -> torch.Tensor: + """Convert from zero-based indices to non-zero-based indices.""" + return x + self.offset + + @property + def T(self) -> float: + """End time of the Corruption process.""" + return 1 + + def marginal_prob( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> Tuple[torch.Tensor, torch.Tensor]: + """Parameters to determine the marginal distribution of the corruption process, $p_t(x | x_0)$.""" + # plus 1 because t=0 is actually no corruption for D3PM and it has N corruption steps, i.e., values go from 0 to N. + t_discrete = maybe_expand(to_discrete_time(t, N=self.N, T=self.T), batch_idx) + 1 + _, logits = d3pm.q_sample( + self._to_zero_based(x.long()), t_discrete, diffusion=self.d3pm, return_logits=True + ) + return logits, None # mean: (nodes_per_sample * batch_size, ), std None + + def prior_sampling( + self, + shape: Union[torch.Size, Tuple], + conditioning_data: Optional[BatchedData] = None, + batch_idx: B = None, + ) -> torch.Tensor: + """Generate one sample from the prior distribution, $p_T(x)$.""" + # sample and then add offset to convert to non-zero-based class labels + return self._to_non_zero_based(self.d3pm.sample_stationary(shape)) + + def prior_logp( + self, + z: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> torch.Tensor: + """Compute log-density of the prior distribution. + + Args: + z: samples, non-zero-based indices, i.e., we first need to subtract the offset + Returns: + log probability density + """ + probs = self.d3pm.stationary_probs(z.shape).to(z.device) + log_probs = (probs + 1e-8).log() + log_prob_per_sample = log_probs[:, self._to_zero_based(z.long())] + log_prob_per_structure = scatter_add(log_prob_per_sample, batch_idx, dim=0) + return log_prob_per_structure + + def sample_marginal( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> torch.Tensor: + """Sample marginal for x(t) given x(0). + Returns: + sampled x(t), non-zero-based indices + where raw_noise is drawn from standard Gaussian + """ + logits = self.marginal_prob(x=x, t=t, batch_idx=batch_idx, batch=batch)[0] + sample = torch.distributions.Categorical(logits=logits).sample() + # samples are zero-based, so we need to add the offset to convert to non-zero-based class labels. + return self._to_non_zero_based(sample) diff --git a/data/mattergen/diffusion/corruption/multi_corruption.py b/data/mattergen/diffusion/corruption/multi_corruption.py new file mode 100644 index 0000000000000000000000000000000000000000..835111445566276cf9042735f9a2d5c142152d3c --- /dev/null +++ b/data/mattergen/diffusion/corruption/multi_corruption.py @@ -0,0 +1,170 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from __future__ import annotations + +from dataclasses import dataclass, field +from functools import cached_property +from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + List, + Mapping, + Optional, + Tuple, + TypeVar, +) + +import torch + +from mattergen.diffusion.corruption.d3pm_corruption import D3PMCorruption +from mattergen.diffusion.corruption.sde_lib import SDE, Corruption +from mattergen.diffusion.data.batched_data import BatchedData + +R = TypeVar("R") +Diffusable = TypeVar("Diffusable", bound=BatchedData) + + +def _first(s: Iterable): + return next(iter(s)) + + +@dataclass +class MultiCorruptionConfig: + discrete_corruptions: dict[str, Any] = field(default_factory=dict) + sdes: dict[str, Any] = field(default_factory=dict) + + +class MultiCorruption(Generic[Diffusable]): + """Wraps multiple `Corruption` instances to operate on different fields of a State + + In the forward process, each field of State is corrupted independently. + + In the reverse process, a single score model takes in the entire State and + uses it to estimate the score with respect to each field of the State. + """ + + def _get_batch_indices(self, batch: Diffusable) -> Dict[str, torch.Tensor]: + return {k: batch.get_batch_idx(k) for k in self.corrupted_fields} + + def __init__( + self, + sdes: Optional[Mapping[str, SDE]] = None, + discrete_corruptions: Optional[Mapping[str, D3PMCorruption]] = None, + ): + """ + Args: + sdes: mapping from fields of batch to SDE corruption processes + discrete_corruptions: mapping from fields of batch to discrete corruption processes + """ + if sdes is None: + sdes = {} + if discrete_corruptions is None: + discrete_corruptions = {} + assert ( + len(sdes) + len(discrete_corruptions) > 0 + ), "Must have at least one corruption process." + + self._sdes = sdes + self._discrete_corruptions = discrete_corruptions + assert ( + set(self._sdes.keys()).intersection(set(self._discrete_corruptions.keys())) == set() + ), "SDEs and corruptions have overlapping keys." + self._corruptions: Dict[str, Corruption] = {**self._sdes, **self._discrete_corruptions} + # Make the dict sorted by key (to prevent mismatching checkpoints): + self._corruptions = {k: self._corruptions[k] for k in sorted(self._corruptions.keys())} + + # All SDEs must have the same T + T_vals = [corruption.T for corruption in self.corruptions.values()] + assert len(set(T_vals)) == 1 + + @property + def sdes(self) -> Mapping[str, SDE]: + return self._sdes + + @property + def has_discrete_corruptions(self) -> bool: + return len(self.discrete_corruptions) > 0 + + @property + def discrete_corruptions(self) -> Mapping[str, Corruption]: + return self._discrete_corruptions + + @property + def corruptions(self) -> Mapping[str, Corruption]: + return self._corruptions + + @property + def corrupted_fields(self) -> List[str]: + return list(self.corruptions.keys()) + + @cached_property + def T(self) -> float: + return _first(self.corruptions.values()).T + + def sample_marginal(self, batch: Diffusable, t) -> Diffusable: + def fn_getter(corruption: Corruption) -> Callable[..., Tuple[torch.Tensor, torch.Tensor]]: + return corruption.sample_marginal + + noisy_data = self._apply_corruption_fn( + fn_getter, + x=batch, + batch_idx=self._get_batch_indices(batch), + broadcast=dict(t=t), + ) + noisy_batch = batch.replace(**noisy_data) + return noisy_batch + + def sde( + self, batch: Diffusable, t: torch.Tensor + ) -> Dict[str, Tuple[torch.Tensor, torch.Tensor]]: + """Get drift and diffusion for each component of the state""" + assert ( + not self.has_discrete_corruptions + ), "Cannot call `sde` on a MultiCorruption with non-SDE corruptions" + + fns = {k: sde.sde for k, sde in self.sdes.items()} + return apply( + fns=fns, + broadcast={"batch": batch, "t": t}, + x=batch, + batch_idx=self._get_batch_indices(batch), + ) + + def _apply_corruption_fn( + self, + fn_getter: Callable[[Corruption], Callable[..., R]], + x: BatchedData, + batch_idx: Mapping[str, torch.LongTensor], + broadcast: Optional[Dict] = None, + apply_to: Optional[Mapping[str, Corruption]] = None, + **kwargs, + ) -> Dict[str, R]: + if apply_to is None: + apply_to = self.corruptions + fns = {field_name: fn_getter(corruption) for field_name, corruption in apply_to.items()} + return apply( + fns=fns, + broadcast={**(broadcast or dict()), "batch": x}, + x=x, + batch_idx=batch_idx, + **kwargs, + ) + + +def apply(fns: Dict[str, Callable[..., R]], broadcast, **kwargs) -> Dict[str, R]: + """Apply different function with different argument values to each field. + fns: dict of the form {field_name: function_to_apply} + broadcast: arguments that are identical for every field_name + kwargs: dict of the form {argument_name: {field_name: argument_value}} + """ + return { + field_name: fn( + **{k: v[field_name] for k, v in kwargs.items() if field_name in v}, + **(broadcast or dict()), + ) + for field_name, fn in fns.items() + } diff --git a/data/mattergen/diffusion/corruption/sde_lib.py b/data/mattergen/diffusion/corruption/sde_lib.py new file mode 100644 index 0000000000000000000000000000000000000000..309145a02e15449e16c200c0037b5891b6c836e2 --- /dev/null +++ b/data/mattergen/diffusion/corruption/sde_lib.py @@ -0,0 +1,270 @@ +""" +Copyright 2020 The Google Research Authors. +Copyright (c) Microsoft Corporation. +Licensed under the MIT License. + +Based on code from https://github.com/yang-song/score_sde_pytorch +which is released under Apache licence. + +Abstract SDE classes, Reverse SDE, and VE/VP SDEs. + +Key changes: +- Adapted to work on batched pytorch_geometric style data +- Added '...given_score' methods so that score for a composite +state can be calculated in single forward pass of a shared score model, +and the scores for different fields then forwarded to the different reverse SDEs. +""" + +import abc +from typing import Callable, Optional, Protocol, Tuple, Union + +import numpy as np +import torch +from torch_scatter import scatter_add + +from mattergen.diffusion.corruption.corruption import B, Corruption, maybe_expand +from mattergen.diffusion.data.batched_data import BatchedData + + +class ScoreFunction(Protocol): + def __call__( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + ) -> torch.Tensor: + """Calculate score. + + Args: + x: Samples at which the score should be calculated. Shape [num_nodes, ...] + t: Timestep for each sample. Shape [num_samples,] + batch_idx: Indicates which sample each row of x belongs to. Shape [num_nodes,] + + """ + pass + + +class SDE(Corruption): + """Corruption using a stochastic differential equation.""" + + @abc.abstractmethod + def sde( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> Tuple[torch.Tensor, torch.Tensor]: + """Returns drift f and diffusion coefficient g such that dx = f * dt + g * sqrt(dt) * standard Gaussian""" + pass # drift: (nodes_per_sample * batch_size, num_features), diffusion (batch_size,) + + @abc.abstractmethod + def marginal_prob( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> Tuple[torch.Tensor, torch.Tensor]: + """Returns mean and standard deviation of the marginal distribution of the SDE, $p_t(x)$.""" + pass # mean: (nodes_per_sample * batch_size, num_features), std: (nodes_per_sample * batch_size, 1) + + def mean_coeff_and_std( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> Tuple[torch.Tensor, torch.Tensor]: + """Returns mean coefficient and standard deviation of marginal distribution at time t.""" + return self.marginal_prob( + torch.ones_like(x), t, batch_idx, batch + ) # mean_coeff: same shape as x, std: same shape as x + + def sample_marginal( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> torch.Tensor: + """Sample marginal for x(t) given x(0). + Returns: + sampled x(t) + """ + mean, std = self.marginal_prob(x=x, t=t, batch_idx=batch_idx, batch=batch) + z = torch.randn_like(x) + + return mean + std * z + + +class BaseVPSDE(SDE): + """Base class for variance-preserving SDEs of the form + dx = - 0.5 * beta_t * x * dt + sqrt(beta_t) * z * sqrt(dt) + where z is unit Gaussian noise, or equivalently + dx = - 0.5 * beta_t *x * dt + sqrt(beta_t) * dW + + """ + + @abc.abstractmethod + def beta(self, t: torch.Tensor) -> torch.Tensor: ... + + @abc.abstractmethod + def _marginal_mean_coeff(self, t: torch.Tensor) -> torch.Tensor: + """This should be implemented to compute exp(-0.5 * int_0^t beta(s) ds). See equation (29) of Song et al.""" + ... + + @property + def T(self) -> float: + return 1.0 + + def marginal_prob( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> Tuple[torch.Tensor, torch.Tensor]: + mean_coeff = self._marginal_mean_coeff(t) + mean = maybe_expand(mean_coeff, batch_idx, x) * x + std = maybe_expand(torch.sqrt(1.0 - mean_coeff**2), batch_idx, x) + return mean, std + + def prior_sampling( + self, + shape: Union[torch.Size, Tuple], + conditioning_data: Optional[BatchedData] = None, + batch_idx: B = None, + ) -> torch.Tensor: + return torch.randn(*shape) + + def prior_logp( + self, + z: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> torch.Tensor: + return unit_gaussian_logp(z, batch_idx) + + def sde( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> Tuple[torch.Tensor, torch.Tensor]: + beta_t = self.beta(t) + drift = -0.5 * maybe_expand(beta_t, batch_idx, x) * x + diffusion = maybe_expand(torch.sqrt(beta_t), batch_idx, x) + return drift, diffusion + + +class VPSDE(BaseVPSDE): + def __init__(self, beta_min: float = 0.1, beta_max: float = 20): + """Variance-preserving SDE with drift coefficient changing linearly over time.""" + super().__init__() + self.beta_0 = beta_min + self.beta_1 = beta_max + + def beta(self, t: torch.Tensor) -> torch.Tensor: + return self.beta_0 + t * (self.beta_1 - self.beta_0) + + def _marginal_mean_coeff(self, t: torch.Tensor) -> torch.Tensor: + log_mean_coeff = -0.25 * t**2 * (self.beta_1 - self.beta_0) - 0.5 * t * self.beta_0 + return torch.exp(log_mean_coeff) + + +def unit_gaussian_logp(z: torch.Tensor, batch_idx: B = None) -> torch.Tensor: + shape = z.shape + N = np.prod(shape[1:]) + if batch_idx is None: + logps = -N / 2.0 * np.log(2 * np.pi) - torch.sum(z**2, dim=tuple(range(1, z.ndim))) / 2.0 + else: + if z.ndim > 2: + raise NotImplementedError + + logps = -N / 2.0 * np.log(2 * np.pi) - scatter_add(torch.sum(z**2, dim=1), batch_idx) / 2.0 + + return logps + + +class VESDE(SDE): + def __init__(self, sigma_min: float = 0.01, sigma_max: float = 50.0): + """Construct a Variance Exploding SDE. + + The marginal standard deviation grows exponentially from sigma_min to sigma_max. + + Args: + sigma_min: smallest sigma. + sigma_max: largest sigma. + """ + super().__init__() + self.sigma_min = sigma_min + self.sigma_max = sigma_max + + @property + def T(self) -> float: + return 1.0 + + def sde( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> Tuple[torch.Tensor, torch.Tensor]: + sigma = self.sigma_min * (self.sigma_max / self.sigma_min) ** t + drift = torch.zeros_like(x) + diffusion = maybe_expand( + sigma + * torch.sqrt( + torch.tensor(2 * (np.log(self.sigma_max) - np.log(self.sigma_min)), device=t.device) + ), + batch_idx, + x, + ) + return drift, diffusion + + def marginal_prob( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> Tuple[torch.Tensor, torch.Tensor]: + std = maybe_expand(self.sigma_min * (self.sigma_max / self.sigma_min) ** t, batch_idx, x) + mean = x + return mean, std + + def prior_sampling( + self, + shape: Union[torch.Size, Tuple], + conditioning_data: Optional[BatchedData] = None, + batch_idx: B = None, + ) -> torch.Tensor: + return torch.randn(*shape) * self.sigma_max + + def prior_logp( + self, + z: torch.Tensor, + batch_idx: B = None, + batch: Optional[BatchedData] = None, + ) -> torch.Tensor: + shape = z.shape + N = np.prod(shape[1:]) + if batch_idx is not None: + return -N / 2.0 * np.log(2 * np.pi * self.sigma_max**2) - scatter_add( + torch.sum(z**2, dim=1), batch_idx + ) / (2 * self.sigma_max**2) + else: + return -N / 2.0 * np.log(2 * np.pi * self.sigma_max**2) - torch.sum( + z**2, dim=tuple(range(1, z.ndim)) + ) / (2 * self.sigma_max**2) + + +def check_score_fn_defined(score_fn: Optional[Callable], fn_name_given_score: str): + """Check that a reverse SDE has a score_fn. Give a useful error message if not.""" + if score_fn is None: + raise ValueError( + f"This reverse SDE does not know its score_fn. You must either a) pass a score_fn when you construct this reverse SDE or b) call {fn_name_given_score} instead." + ) diff --git a/data/mattergen/diffusion/d3pm/__init__.py b/data/mattergen/diffusion/d3pm/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/d3pm/cgmanifest.json b/data/mattergen/diffusion/d3pm/cgmanifest.json new file mode 100644 index 0000000000000000000000000000000000000000..3a1e925996d9ba8deb3b75027f1799907edc1269 --- /dev/null +++ b/data/mattergen/diffusion/d3pm/cgmanifest.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "version": 1, + "registrations":[ + { + "component": { + "type": "git", + "git": { + "repositoryUrl": "https://github.com/google-research/google-research", + "commitHash": "ad2d81983e4c717f477a232f625d0da2808b15aa" + } + }, + "developmentDependency" : false + } + ] +} \ No newline at end of file diff --git a/data/mattergen/diffusion/d3pm/d3pm.py b/data/mattergen/diffusion/d3pm/d3pm.py new file mode 100644 index 0000000000000000000000000000000000000000..e94e226427791479c8360503144f95b626bd2810 --- /dev/null +++ b/data/mattergen/diffusion/d3pm/d3pm.py @@ -0,0 +1,872 @@ +# Copyright (c) 2022 The Google Research Authors. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Adapted from https://github.com/google-research/google-research/blob/master/d3pm/text/diffusion.py +# Siginificant changes: +# * adapt code style/ formatting +# * Jax -> PyTorch +# * Remove Diffusion types that are not used by MatterGen +# ORIGINAL LICENSE NOTICE: +# Copyright 2022 The Google Research Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Diffusions for training and noise scheduling.""" + +import abc +import dataclasses +from typing import Any, Callable, Dict, Optional, Union + +import torch +import torch.nn.functional as F +from torch.distributions import Categorical + + +class DiffusionSchedule: + """A wrapper around a simple schedule function.""" + + def __init__(self, schedule_fn, num_steps, is_constant=False): + self._schedule_fn = schedule_fn + self.num_steps = num_steps + self.is_constant = is_constant + + def __call__(self, step): + return self._schedule_fn(step) + + def __repr__(self): + return f"DiffusionSchedule(steps: {self.num_steps}, is_constant: {self.is_constant})" + + +class DiscreteDiffusionBase(abc.ABC): + """Base class for all matrix-noise schedules.""" + + num_steps: int + dim: int + precision: Any = torch.float32 + + @abc.abstractmethod + def stationary_probs(self, shape): + """Returns probs for the stationary distribution.""" + + @abc.abstractmethod + def sample_stationary(self, shape): + """Draws a sample from the stationary distribution (q(x_T)).""" + + @property + def has_state(self): + """Indicates if the diffusion has state which needs to be set/updated.""" + return False + + def set_state(self, state): + pass + + def reset_state(self): + pass + + def update_state(self, state): + pass + + def sample_t(self, shape=(1,)): + """Samples batches of time steps to use.""" + + num_steps = self.num_steps + t = torch.randint(shape, minval=0, maxval=num_steps) + return t + + @abc.abstractmethod + def get_qt_given_q0(self, q0, t, return_logits=False, make_one_hot=False, epsilon=1e-20): + """Get q(x_t), the n-step posterior. + + For example, for t = 0, it returns q0 unchanged. + + Args: + q0: an array of floats specifying a distribution over p(x_0). + t: t in q(x_t | x_0). + return_logits: if True, return the output logits + make_one_hot: if True, will convert q0 to floats if needed. + epsilon: a small number to normalize logits conversion with, if needed. + + Returns: + q(x_t | x_0). + """ + + @abc.abstractmethod + def sample_and_compute_posterior_q( + self, + x_0, + t, + samples=None, + transition_probs=None, + return_logits=True, + return_transition_probs=False, + transition_probs_in_logits=True, + make_one_hot=True, + epsilon=1e-20, + step_size=1, + ): + """Samples from q(x_{t+1} | x_0), then computes q(x_t | x_{t+1}, x_0). + + Args: + x_0: an array containing x_0 samples. These are expected to be integral + unless make_one_hot is False (in which case probabilities can be + provided). + t: the timestep to compute (as an int or integer array with shape that + matches x_0. + samples: if not None, use these samples to compute the posterior. + transition_probs: precomputed transition probabilities. + return_logits: if True, returns the (noisy) log of the probabilities. + return_transition_probs: if true, returns the transition probs as well. + transition_probs_in_logits: include transition probs in logits. + make_one_hot: if True, will convert the input to a one_hot vector. + epsilon: a small amount of noise to add to logits if needed. + step_size: if provided, computes q(x_{t + step_size} | x_0), etc. This is + used to sample fewer steps for ELBO evaluation on a longer trained + model. + + Returns: + a list of samples with the same shape as x_0 and the associated posterior + probabilities (or logits). + """ + + +class DiscreteDiffusionMatrixBase(DiscreteDiffusionBase): + """Base class for all matrix-noise schedulers.""" + + num_steps: int + dim: int + precision: Any = torch.float32 + + def get(self, t): + """Returns the transition matrix q(x_{t+1} | x_t).""" + raise NotImplementedError + + def custom_product_fn(self, t): + """Returns q(x_t | x_0), the product of the first t matrices.""" + raise NotImplementedError + + def supports_efficient_get(self): + """Returns true if get() is implemented/efficient.""" + return False + + def supports_efficient_inference(self): + """Returns true if custom_product_fn is implemented. + + The ontology of efficient_get and efficient_inference is this: + * if efficient_inference is enabled, it is used to return q(x_t | x_0) + without computing expensive products. + * if efficient_get is enabled, get(...) is used to get the posterior of + q(x_{t-1} | x_t, x_0). If not, get_q_given_q0 is called to get + q(x_{t+1} | x_0), and qt_reverse is called to get the q(x_{t+1} | x_t). + """ + return False + + def qt_reverse(self, qt_plus_1, t, return_logits=False, make_one_hot=False, epsilon=1e-20): + """Get q(x_{t+1} | x_t), for each possible value of x_t. Thus, the rows of the output do not sum to 1. + + Args: + qt_plus_1: an array of floats specifying a distribution over q(x_{t+1} | x_0). + t: t in q(x_{t+1} | x_t). + return_logits: if True, return the output logits + make_one_hot: if True, will convert q(x_{t+1}) to floats if needed. + epsilon: a small number to normalize logits conversion with, if needed. + + Returns: + q(x_{t+1} | x_t), shape [num_samples, num_classes]. + """ + raise NotImplementedError + + def get_qt_matrix(self, t): + """Returns the matrix Q = q(x_t | x_0) materialized over all x_0.""" + if self.supports_efficient_inference(): + return self.custom_product_fn(t) + + # otherwise, multiply by the ith matrix in a for-loop. + def product_fn(i, state): + return torch.matmul(self.get(torch.tensor(i)), state) + + val = torch.eye(self.dim, device=t.device) + for i in range(0, t): + val = product_fn(i, val) + return val + + def get_qt_given_q0(self, q0, t, return_logits=False, make_one_hot=False, epsilon=1e-20): + """Get q(x_t), the n-step posterior. + + For example, for t = 0, it returns q0 unchanged. + + Args: + q0: an array of floats specifying a distribution over p(x_0). + t: t in q(x_t | x_0). + return_logits: if True, return the output logits + make_one_hot: if True, will convert q0 to floats if needed. + epsilon: a small number to normalize logits conversion with, if needed. + + Returns: + q(x_t | x_0). + """ + + if make_one_hot: + assert q0.dtype == torch.long or q0.dtype == torch.int32 + q0 = torch.eye(self.dim, device=q0.device)[q0] + + assert q0.dtype == torch.float32 + + # if efficient inference is supported, just return those matrices. + if self.supports_efficient_inference(): + prob_at_time_t = torch.einsum("bij,bj->bi", self.get_qt_matrix(t).to(q0.dtype), q0) + + if return_logits: + return torch.log(prob_at_time_t + epsilon) + else: + return prob_at_time_t + + @dataclasses.dataclass + class ScanState: + final_time: int # target time + q: Any + + def product_fn(state, current_time): + cond = current_time < state.final_time + transition = self.get(current_time) + q_t_plus_1 = torch.einsum("ij,sj->si", transition, state.q) + + new_q = torch.where(cond[:, None], q_t_plus_1, state.q) + return ScanState(final_time=state.final_time, q=new_q), None + + init_val = ScanState(final_time=t, q=q0) + carry = init_val + idx = torch.arange(self.num_steps, device=q0.device) + for i in idx: + carry, _ = product_fn(carry, i) + final_state = carry + prob_at_time_t = final_state.q + + if return_logits: + return torch.log(prob_at_time_t + epsilon) + else: + return prob_at_time_t + + def sample_and_compute_posterior_q( + self, + x_0, + t, + samples=None, + transition_probs=None, + return_logits=True, + return_transition_probs=False, + transition_probs_in_logits=True, + make_one_hot=True, + epsilon=1e-20, + step_size=1, + ): + """Samples from q(x_{t+1} | x_0), then computes q(x_t | x_{t+1}, x_0). + + Args: + x_0: an array containing x_0 samples. These are expected to be integral + unless make_one_hot is False (in which case probabilities can be + provided). + t: the timestep to compute (as an int or integer array with shape that + matches x_0. + samples: if not None, use these samples to compute the posterior. + transition_probs: precomputed transition probabilities. + return_logits: if True, returns the (noisy) log of the probabilities. + return_transition_probs: if true, returns the transition probs as well. + transition_probs_in_logits: include transition probs in logits. + make_one_hot: if True, will convert the input to a one_hot vector. + epsilon: a small amount of noise to add to logits if needed. + step_size: if provided, computes q(x_{t + step_size} | x_0), etc. This is + used to sample fewer steps for ELBO evaluation on a longer trained + model. + + Returns: + a list of samples with the same shape as x_0 and the associated posterior + probabilities (or logits). + """ + + dim = self.dim + device = x_0.device + # t = torch.tensor(t, device=x_0.device) + if make_one_hot: + assert x_0.dtype in [torch.long, torch.int32] + x_0 = torch.eye(dim, device=device)[x_0].reshape(x_0.shape + (dim,)) + assert x_0.dtype == torch.float32 + assert t.dtype in [torch.long, torch.int32] + prob_at_time_t = self.get_qt_given_q0(q0=x_0, t=t) + # most methods support efficiently returning the t-th transition matrix + # if so, we use that. Otherwise we recompute the t+1th probability. + if self.supports_efficient_get(): + if step_size > 1: + transition_matrix = torch.eye(self.dim, device=x_0.device) + + for i in range(step_size): + transition_matrix = self.get(t + i) @ transition_matrix + + else: + transition_matrix = self.get(t) + + prob_at_time_t_plus_one = torch.einsum( + "bij,bj->bi", + transition_matrix, + prob_at_time_t, + ) + + else: + prob_at_time_t_plus_one = self.get_qt_given_q0(q0=x_0, t=t + step_size) + + if samples is None and transition_probs is not None: + raise ValueError("samples were not provided but transition_probs were.") + + # if samples are provided, we use those. otherwise, we sample more. + if samples is None: + logits = torch.log(prob_at_time_t_plus_one + epsilon) + samples = Categorical(logits=logits).sample() + + # we can optionally provide transition probs from another call to this + # function. If not, we recompute this. For most methods, we can reuse the + # transition matrix. If we didn't compute it, our method must support + # qt_reverse which usually computes efficient backwards VJPs. + + if transition_probs is None: + if self.supports_efficient_get(): + transition_probs = transition_matrix[range(samples.shape[0]), samples] + else: + if step_size > 1: + transition_probs = torch.eye(self.dim, device=samples.device)[samples] + for i in range(step_size): + transition_probs = self.qt_reverse( + qt_plus_1=transition_probs, make_one_hot=False, t=t + step_size - 1 - i + ) + else: + # Computes q(x_{t+1} | x_t), i.e., for each possible x_t, what is the probability of transitioning to each x_{t+1}. + # Thus, these probabilities do not sum to 1 per row. + # If we don't return logits, transition_probs will be used to compute q(x_t | x_{t+1}). + # Otherwise, we return the logits of q(x_t | x_{t+1}) = q(x_{t+1} | x_t) * q(x_t | x_0), i.e., omit normalization by q(x_{t+1} | x_0). + # Shape [batch_size, num_classes] + transition_probs = self.qt_reverse(qt_plus_1=samples, make_one_hot=True, t=t) + + if not transition_probs_in_logits and not return_logits: + raise ValueError( + "Cannot exclude transition probs from logits if return_logits is false." + ) + + if return_logits: + # for numerical stability, we can compute log(a*b) = log(a) + log(b) + posterior_logits = torch.log(prob_at_time_t + epsilon) + + if transition_probs_in_logits: + posterior_logits += torch.log(transition_probs + epsilon) + + if return_transition_probs: + return posterior_logits, samples, transition_probs + else: + return posterior_logits, samples + else: + # here we hope this never actually sums to zero. There's a chance + # this will produce NaN gradients, but that's OK because they'll be + # skipped. + posterior = transition_probs * prob_at_time_t + denominator = torch.sum(posterior, dim=-1, keepdims=True) + posterior = posterior / denominator + + if return_transition_probs: + return posterior, samples, transition_probs + else: + return posterior, samples + + +class MaskDiffusion(DiscreteDiffusionMatrixBase): + """A simple schedule that diffuses away from the identity matrix.""" + + def __init__(self, dim, schedule, precision=torch.float32, use_fast_inference=True): + """A simple scheduler for masking policies. + + Args: + dim: int, the dimensionality of the state space. + schedule: a DiffusionSchedule object for scheduling rates. + precision: matmul precision. + use_fast_inference: if False, uses a slower, brute force approach. + """ + + self.num_steps = schedule.num_steps + self.schedule = schedule + self.use_fast_inference = use_fast_inference + self.precision = precision + self.dim = dim # allow mask + self.state = self._create_state() + + def _create_state(self): + """Initializes values used by the get function.""" + betas = torch.cat([torch.tensor([0.0]), self.schedule(torch.arange(self.num_steps))]).to( + torch.float64 + ) + alphas = 1 - betas + state = torch.cumprod(alphas, dim=0) + state[-1] = 0.0 + + return state.float() + + def supports_efficient_inference(self): + return self.use_fast_inference + + def stationary_probs(self, shape): + """Stationary distribution is one-hot at mask token.""" + sample = torch.full(shape, self.dim - 1) + probs = torch.eye(self.dim, device=sample.device)[sample] + return probs + + def sample_stationary(self, shape): + """Stationary distribution is one-hot at mask token.""" + return torch.full(shape, self.dim - 1) + + def custom_product_fn(self, t): + """Returns product of first n matrices. Only supported for beta constant.""" + dim = self.dim + + if self.schedule.is_constant: + beta = self.schedule(0) + return (1 - beta) ** t * torch.eye(dim) + (1 - (1 - beta) ** t) * self._get_mask() + + else: + p = self.state[t] + return p * torch.eye(dim) + (1 - p) * self._get_mask() + + def _get_mask(self): + dim = self.dim + return torch.ones((dim, dim)) * (torch.arange(0, dim)[:, None] == (dim - 1)).to( + torch.float32 + ) + + def get(self, t): + _t = t if len(t.shape) == 1 else t[None] + beta = self.schedule(_t) + dim = self.dim + + ret = (1 - beta)[:, None, None] * torch.eye(dim, device=_t.device)[None] + beta[ + :, None, None + ] * self._get_mask().to(_t.device)[None] + return ret if len(t.shape) == 1 else ret.squeeze(0) + + def qt_reverse(self, qt_plus_1, t, return_logits=False, make_one_hot=False, epsilon=1e-20): + """Get q(x_{t+1} | x_t), for each possible value of x_t. Thus, the rows of the output do not sum to 1. + + Args: + qt_plus_1: an array of floats specifying a distribution over q(x_{t+1} | x_0). + t: t in q(x_{t+1} | x_t). + return_logits: if True, return the output logits + make_one_hot: if True, will convert q(x_{t+1}) to floats if needed. + epsilon: a small number to normalize logits conversion with, if needed. + + Returns: + q(x_{t+1} | x_t), shape [num_samples, num_classes]. + """ + + if make_one_hot: + assert qt_plus_1.dtype in [torch.long, torch.int32] + qt_plus_1 = torch.eye(self.dim, device=qt_plus_1.device)[qt_plus_1] + + assert qt_plus_1.dtype == torch.float32 + + beta = self.schedule(t) + + # q(x_{t+1} | x_t) = (1 - beta) if x_t = x_{t+1} != mask type + # else: beta if x_t != mask type else 1. (beta is the probability of transitioning to the absorbing state at t). + # I.e., if x_{t+1} is in some non-masked state S, then the probability of transitioning from S in t to S in t+1 is (1 - beta). + # Else, if x_{t+1} is in the masked state, then the probability of transitioning from a non-masked state S in t to the masked state in t+1 is beta, + # and the probability of transitioning from the masked state to itself is 1. + non_mask_prob = (1 - beta)[:, None] * qt_plus_1[:, :-1] + beta[:, None] * qt_plus_1[:, -1:] + prob_at_time_t = ( + torch.eye(self.dim, device=qt_plus_1.device)[self.dim - 1][None] * qt_plus_1[:, -1:] + ) + prob_at_time_t[:, :-1] = non_mask_prob + + if return_logits: + return torch.log(prob_at_time_t + epsilon) + else: + return prob_at_time_t + + def get_qt_given_q0(self, q0, t, return_logits=False, make_one_hot=False, epsilon=1e-20): + """Get q(x_t), the n-step posterior. + + Can do efficiently for masks. + + For example, for t = 0, it returns q0 unchanged. + + Args: + q0: an array of floats specifying a distribution over p(x_0). + t: t in q(x_t | x_0). + return_logits: if True, return the output logits + make_one_hot: if True, will convert q0 to floats if needed. + epsilon: a small number to normalize logits conversion with, if needed. + + Returns: + q(x_t | x_0). + """ + if not self.supports_efficient_inference(): + return super().get_qt_given_q0( + q0, t, return_logits=return_logits, make_one_hot=make_one_hot, epsilon=epsilon + ) + + if make_one_hot: + assert q0.dtype in [torch.int32, torch.long] + q0 = torch.eye(self.dim, device=q0.device)[q0] + + assert q0.dtype == torch.float32 + assert len(q0.shape) == 2 + + # p is probability of staying the same. (1 - p) is prob of masking. + p = self.state.to(q0.device)[t] + + non_mask_prob = p[:, None] * q0[:, :-1] + mask_prob = 1 - non_mask_prob.sum(-1) + + prob_at_time_t = ( + mask_prob[:, None] * torch.eye(self.dim, device=q0.device)[self.dim - 1][None] + ) + prob_at_time_t[:, :-1] = non_mask_prob + + prob_at_time_t = torch.where(t[:, None] == 0, q0, prob_at_time_t) + + if return_logits: + return torch.log(prob_at_time_t + epsilon) + else: + return prob_at_time_t + + def supports_efficient_get(self): + return not self.use_fast_inference + + +def create_discrete_diffusion_schedule( + kind="linear", + beta_min=1e-3, + beta_max=1e-1, + num_steps=100, + scale=1.0, +): + """Creates a callable schedule object to use for diffusion rates. + + Args: + kind: str, one of 'standard', 'linear', 'cosine', 'mutual_information'. If + standard, performs standard binomial diffusion taken from Sohl-Dicksteein + et al, ignoring betas. Otherwise, linear schedule between beta_min and + beta_max. + beta_min: the minimum beta. Ignored if kind == standard. + beta_max: the maximum beta. + num_steps: int, the number of steps to take. + scale: for standard schedule, rescales num_steps by this amount. + + Returns: + a DiffusionSchedule object. + """ + + assert beta_min <= beta_max + assert num_steps > 0 + assert scale >= 1 + + if kind == "standard": + + def schedule_fn(step: Union[int, torch.Tensor]): + return 1 / (scale * num_steps - step) + + return DiffusionSchedule(schedule_fn, num_steps, is_constant=False) + + elif kind == "linear": + is_constant = beta_min == beta_max + + linspace = torch.linspace(beta_min, beta_max, num_steps) + + def schedule_fn(step: Union[int, torch.Tensor]): + return linspace[step] + + return DiffusionSchedule(schedule_fn, num_steps, is_constant=is_constant) + elif kind == "cosine": + s = 0.008 + + def cosine_fn(step: torch.Tensor): + return torch.cos((step / num_steps + s) / (1 + s) * torch.pi / 2) + + def schedule_fn(step: Union[int, torch.Tensor]): + if isinstance(step, int): + step = torch.tensor(step) + return torch.clamp(1 - (cosine_fn(step + 1) / cosine_fn(step)), 0, 0.999) + + return DiffusionSchedule(schedule_fn, num_steps, is_constant=False) + else: + raise ValueError(f"kind {kind} is not supported.") + + +def p_forward( + denoise_fn, + x_t, + t, + diffusion, + predict_x0=True, + return_x0=False, + return_logits=False, + special_case_x0=False, + transition_probs=None, + transition_probs_in_logits=True, + maximum_likelihood=False, + epsilon=1e-20, + step_size=1, +): + """Returns probabilities from the reverse process p(x_{t-1} | x_t). + + Args: + denoise_fn: the reverse process. Must support embed, call, and attend. + x_t: the current value of x_t to condition on. + t: the timestep t. + diffusion: the Diffusion object to use for noise. + predict_x0: if True, assumes the model output corresponds to its prediction + for p(x_0 | x_t). Otherwise assumes model predicts p(x_{t-1} | x_t). + return_x0: if True, will return probs for x_0 as well as x_{t-1}. + return_logits: if True, will return logits instead of probabilities. + special_case_x0: if True, will directly predict x0 instead of using the + forward process probabilities. + transition_probs: if provided, q(x_{t+1} | x_t) probs to reuse. + transition_probs_in_logits: if False, will ignore transition probs in logits + (only allowed if return_logits is True). This is because this term is + independent of theta. + maximum_likelihood: if true, will draw the most likely x0 before applying + the forward process. + epsilon: a small number. + step_size: step size to compute posterior from. + + Returns: + probabilities for q(x_{t-1} | x_t) (and probabilities for x0 if predict_x0 + is True) + """ + assert not (step_size > 1 and not predict_x0) + + logits = denoise_fn(targets=x_t, timestep=t) + probs = logits.softmax(dim=-1) + + if not predict_x0: + retval = logits if return_logits else probs + if return_x0: + return retval, None + else: + return retval + + if maximum_likelihood: + probs = probs.argmax(-1) + + # we use this to compute p(x_{t-1} | x_t) = sum_x0 q(x_{t-1} | x_t, x_0) + # p(x_0 | x_t). + qt_probs, _ = diffusion.sample_and_compute_posterior_q( + x_0=probs, + t=t - step_size, + make_one_hot=maximum_likelihood, + return_logits=return_logits, + transition_probs_in_logits=transition_probs_in_logits, + transition_probs=transition_probs, + samples=x_t, + epsilon=epsilon, + step_size=step_size, + ) + + retval_x0 = logits if return_logits else probs + retval = qt_probs + + # we can special case t = 1 to just use the raw logits outputs. + mask = (t == step_size) & special_case_x0 + retval = mask[:, None] * retval_x0 + (mask.logical_not())[:, None] * retval + + if return_x0: + return retval, retval_x0 + else: + return retval + + +def q_sample(x_start, t, diffusion, return_logits=False): + """Draws a sample from the posterior q(x_t | x_start).""" + + assert x_start.dtype in [torch.int32, torch.long] + + dim = diffusion.dim + x_start = torch.eye(dim, device=x_start.device)[x_start] + + logits = diffusion.get_qt_given_q0(q0=x_start, t=t, return_logits=True) + sample = Categorical(logits=logits).sample() + if return_logits: + return sample, logits + return sample + + +def compute_prior_kl(x_start, diffusion, target_mask=None): + """Computes KL divergence between q(x_T) and the true distribution.""" + assert x_start.dtype in [torch.long, torch.int32] + + num_steps = diffusion.num_steps + + q_probs = diffusion.get_qt_given_q0( + q0=x_start, + t=torch.tensor( + [ + num_steps, + ], + device=x_start.device, + ), + return_logits=False, + make_one_hot=True, + ) # get end step + p_probs = diffusion.stationary_probs(q_probs.shape[:-1]).to(q_probs.device) + + d1 = Categorical(probs=q_probs) + d2 = Categorical(probs=p_probs) + loss = torch.distributions.kl_divergence(d1, d2) + + if target_mask is not None: + loss = (loss * target_mask).sum() + else: + loss = loss.sum() + + return loss + + +def compute_kl_reverse_process( + x_start: torch.Tensor, + t: torch.Tensor, + *, + x_t_plus_1: Optional[torch.Tensor] = None, + diffusion: DiscreteDiffusionBase, + denoise_fn: Callable[[torch.Tensor, torch.Tensor], torch.Tensor], + predict_x0: bool = True, + log_space: bool = False, + label_smoothing: float = 0.0, + hybrid_lambda: float = 0.0, + use_cached_transition: bool = True, + target_mask: Optional[torch.Tensor] = None, + step_size: int = 1, +) -> Dict[str, torch.Tensor]: + """Returns the KL for one term in the ELBO (time t) (loss L_t). + + This assumes x_start is a sample from x_0, from which we draw samples from + q(x_t | x_0) and then compute q(x_{t-1} | x_t, x_0) following the LaTeX. This + is the KL divergence for terms L_1 through L_{T-1}. + + Args: + x_start: a sample from p(data) (or q(x_0)). + t: the loss term to compute. + diffusion: the diffusion object to use. + denoise_fn: a functool.partial-ed version of the model_apply function which + takes a set of targets (x_t) and noise level and returns q(x_{t-1} | x_t, + x_0). + predict_x0: if True, will predict a distribution over x0 instead of x_{t-1}. + log_space: if True, will perform the loss calculations in log space. + label_smoothing: label smoothing for cross entropy. + hybrid_lambda: coefficient for hybrid cross-entropy loss. + use_cached_transition: if True, will reuse q(x_{t+1} | x_t) computation. + target_mask: mask for target sequence. + step_size: the step size over which the ELBO is computed. + + Returns: + the KL divergence and denominator. + """ + assert x_start.dtype in [torch.int32, torch.long] + + if step_size > 1 and not predict_x0: + raise ValueError("cannot skip steps when not predicting x0.") + + # If x_t_plus_1 is None, sample from q(x_{t+1} | x_start). Otherwise use the provided samples for x_{t+1}. + # Then compute q(x_t | x_{t+1}, x_start) + # q_t and p_t can be logits or probs depending on log_space. + q_t, x_t_plus_1, transition_probs = diffusion.sample_and_compute_posterior_q( + x_0=x_start, + t=t, + return_logits=log_space, + return_transition_probs=True, + step_size=step_size, + samples=x_t_plus_1, + ) + + transition_probs = transition_probs if use_cached_transition else None + + p_t = p_forward( + denoise_fn=denoise_fn, + x_t=x_t_plus_1, + t=t + step_size, + diffusion=diffusion, + predict_x0=predict_x0, + return_x0=predict_x0 and hybrid_lambda > 0.0, + return_logits=log_space, + transition_probs=transition_probs, + step_size=step_size, + ) + + hybrid_loss = torch.tensor(0.0, device=x_start.device) + if predict_x0 and hybrid_lambda > 0.0: + # p_t, p_0 are shape [num_atoms, ]. + p_t, p_0 = p_t + if log_space: + # [num_atoms, ] + cross_entropy = F.cross_entropy( + input=p_0, target=x_start, label_smoothing=label_smoothing, reduction="none" + ) + else: + # [num_atoms, ] + cross_entropy = F.cross_entropy( + input=(p_0 + 1e-7).log(), + target=x_start, + label_smoothing=label_smoothing, + reduction="none", + ) + + hybrid_loss = hybrid_lambda * cross_entropy + + assert not q_t.isnan().any() and not p_t.isnan().any() + + if log_space: + d1 = Categorical(logits=q_t) + d2 = Categorical(logits=p_t) + # [num_atoms, ] + kl = torch.distributions.kl_divergence(p=d1, q=d2) + # [num_atoms, ] + cross_entropy = F.cross_entropy( + input=p_t, target=x_start, label_smoothing=label_smoothing, reduction="none" + ) + else: + d1 = Categorical(logits=(q_t + 1e-7).log()) + d2 = Categorical(logits=(p_t + 1e-7).log()) + # [num_atoms, ] + kl = torch.distributions.kl_divergence(p=d1, q=d2) + # [num_atoms, ] + cross_entropy = F.cross_entropy( + input=(p_t + 1e-7).log(), + target=x_start, + label_smoothing=label_smoothing, + reduction="none", + ) + + if target_mask is not None: # can be used for inpainting + kl = kl * target_mask + cross_entropy = cross_entropy * target_mask + hybrid_loss = hybrid_loss * target_mask + + # [num_atoms, ] + mask = t == 0 + base_loss = mask * cross_entropy + (mask.logical_not()) * kl + loss = base_loss + hybrid_loss + denominator = torch.tensor(1, device=x_start.device) + + metrics_dict = { + "loss": loss, + "denominator": denominator, + "kl/hybrid_loss": hybrid_loss, + "kl/base_loss": base_loss, + "kl/cross_entropy_loss": cross_entropy, + "kl/t0_loss": mask * cross_entropy, + "kl/kl_loss": kl, + } + + return metrics_dict diff --git a/data/mattergen/diffusion/d3pm/d3pm_predictors_correctors.py b/data/mattergen/diffusion/d3pm/d3pm_predictors_correctors.py new file mode 100644 index 0000000000000000000000000000000000000000..cc0d676ede8c1b9755e1b788db68d85552f005fa --- /dev/null +++ b/data/mattergen/diffusion/d3pm/d3pm_predictors_correctors.py @@ -0,0 +1,106 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Optional, cast + +import torch + +from mattergen.diffusion.corruption.corruption import Corruption +from mattergen.diffusion.corruption.d3pm_corruption import D3PMCorruption +from mattergen.diffusion.corruption.sde_lib import ScoreFunction +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.discrete_time import to_discrete_time +from mattergen.diffusion.sampling.predictors import Predictor +from mattergen.diffusion.sampling.predictors_correctors import SampleAndMean + + +class D3PMAncestralSamplingPredictor(Predictor): + """ + Ancestral sampling predictor for D3PM. + """ + + def __init__( + self, + *, + corruption: D3PMCorruption, + score_fn: ScoreFunction, + predict_x0: bool = True, + ): + super().__init__(corruption=corruption, score_fn=score_fn) + # if True, self.denoiser returns p(x_0|x_t), otherwise p(x_{t-1}|x_t) + self.predict_x0 = predict_x0 + + @classmethod + def is_compatible(cls, corruption: Corruption) -> bool: + return isinstance(corruption, D3PMCorruption) + + @property + def N(self) -> int: + self.corruption = cast(D3PMCorruption, self.corruption) # mypy + return self.corruption.N + + def update_given_score( + self, + *, + x: torch.Tensor, + t: torch.Tensor, + dt: torch.Tensor, + batch_idx: torch.LongTensor, + score: torch.Tensor, + batch: Optional[BatchedData], + ) -> SampleAndMean: + """ + Takes the atom coordinates, cell vectors and atom types at time t and + returns the atom types at time t-1, sampled using the learned reverse + atom diffusion model. + + Look at https://github.com/google-research/google-research/blob/master/d3pm/text/diffusion.py + + lines 3201-3229. NOTE: we do implement the taking the softmax of the initial + sample as per 3226-3227. This could be to avoid weird behaving for picking + initial states that happened to have very low probability in latent space. + Try adding if there proves to be a problem generating samples. + """ + # t is continuous, needs to be integer + t = to_discrete_time(t=t, N=self.N, T=self.corruption.T) + + class_logits = score + + assert isinstance(self.corruption, D3PMCorruption) + + # sample from categorical distribution + x_sample = self.corruption._to_non_zero_based( + torch.distributions.Categorical(logits=class_logits).sample() + ) + + # convert logit output to normalized probabilities + class_probs = torch.softmax(class_logits, dim=-1) + + # get expected atom type from categorical distribution + class_expected = self.corruption._to_non_zero_based(torch.argmax(class_probs, dim=-1)) + + if self.predict_x0: + # if self.predict_x0, the model predicts p(x_0|x_t), not p(x_{t-1}|x_t) + # We need to evaluate p(x_{t-1}|x_t) by Eq 4. in https://arxiv.org/pdf/2107.03006v1.pdf + assert isinstance(self.corruption, D3PMCorruption) + class_logits, _ = self.corruption.d3pm.sample_and_compute_posterior_q( + x_0=class_probs, + t=t[batch_idx].to(torch.long), # requires torch.long or torch.int32 + make_one_hot=False, + samples=self.corruption._to_zero_based( + x + ), # d3pm expects 0 offset atom type integers + return_logits=True, + ) + + x_sample = self.corruption._to_non_zero_based( + torch.distributions.Categorical(logits=class_logits).sample() + ) + + # get expected atom type + class_expected = self.corruption._to_non_zero_based( + torch.argmax(torch.softmax(class_logits.to(class_probs.dtype), dim=-1), dim=-1) + ) + + # (sampled states), (expected states) + return x_sample, class_expected diff --git a/data/mattergen/diffusion/data/__init__.py b/data/mattergen/diffusion/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/data/batched_data.py b/data/mattergen/diffusion/data/batched_data.py new file mode 100644 index 0000000000000000000000000000000000000000..5dad923174b210ac42d48d3ca039dded23cbe912 --- /dev/null +++ b/data/mattergen/diffusion/data/batched_data.py @@ -0,0 +1,188 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from __future__ import annotations + +import logging +from copy import deepcopy +from dataclasses import dataclass, replace +from typing import Any, Mapping, Protocol, Sequence, TypeVar, runtime_checkable + +import torch +from torch_scatter import scatter + +T = TypeVar("T") + +logger = logging.getLogger(__name__) + + +@runtime_checkable +class BatchedData(Protocol): + def replace(self: T, **vals: torch.Tensor) -> T: + """Return a copy of self with some fields replaced with new values.""" + + def get_batch_idx(self, field_name: str) -> torch.LongTensor | None: + """Get the batch index (i.e., which row belongs to which sample) for a given field. + For 'dense' type data, where every sample has the same shape and the first dimension is the + batch dimension, this method should return None. Mathematically, + returning None will be treated the same as returning a tensor [0, 1, 2, ..., batch_size - 1] + but I expect memory access in other functions to be more efficient if you return None. + """ + + def get_batch_size(self) -> int: + """Get the batch size.""" + + def device(self) -> torch.device: + """Get the device of the batch.""" + + def __getitem__(self, field_name: str) -> torch.Tensor: + """Get a field from the batch.""" + + def to(self: T, device: torch.device) -> T: + """Move the batch to a given device.""" + + def clone(self: T) -> T: + """Return a copy with all the tensors cloned.""" + + +@dataclass +class SimpleBatchedData(BatchedData): + """Implements BatchedData as a pair of mappings from field names to tensors.""" + + data: Mapping[str, Any] + batch_idx: Mapping[str, torch.LongTensor] + + def replace(self, **vals: torch.Tensor) -> SimpleBatchedData: + """Return a copy of self with some fields of self.data replaced with new values.""" + return replace(self, data=self._updated_data(**vals)) + + def get_batch_idx(self, field_name: str) -> torch.LongTensor | None: + return self.batch_idx[field_name] + + def _updated_data(self, **vals): + return dict(self.data, **vals) + + def __getitem__(self, key): + return self.data[key] + + def __contains__(self, key): + return key in self.data + + def get_batch_size(self) -> int: + L = [] + for k, v in self.batch_idx.items(): + if v is None: + d = self.data[k] + L.append(d.shape[0] if isinstance(d, torch.Tensor) else len(d)) + else: + if len(v) == 0: + logger.warning(f"Empty batch index for field {k}") + L.append(0) + else: + L.append(int(torch.max(v).item()) + 1) + return max(L) + + @property + def device(self) -> torch.device: + # Beware, there are no checks that all values are on the same device + return next(v.device for v in self.data.values()) + + def to(self, device) -> "SimpleBatchedData": + """Modify self in-place to move all tensors to the given device, and return self""" + if isinstance(self.data, dict): + for k in self.data.keys(): + if isinstance(self.data[k], torch.Tensor): + self.data[k] = self.data[k].to(device) + if isinstance(self.batch_idx, dict): + for key in self.batch_idx.keys(): + if self.batch_idx[key] is None: + continue + self.batch_idx[key] = self.batch_idx[key].to(device) + + return self + + def clone(self) -> SimpleBatchedData: + return SimpleBatchedData( + data={ + k: v.clone() if isinstance(v, torch.Tensor) else deepcopy(v) + for k, v in self.data.items() + }, + batch_idx={k: v.clone() if v is not None else None for k, v in self.batch_idx.items()}, + ) + + def to_data_list(self) -> list[dict[str, torch.Tensor]]: + """Converts this instance to a list of dictionaries, each of which corresponds to a single datapoint in + `batched_data`. The keys of the dictionaries match the keys of `batched_data`. + """ + + batch_size = self.get_batch_size() + if batch_size == 0: + return [] + + def _unpack(k, i): + if self.batch_idx[k] is not None: + return self.data[k][self.batch_idx[k] == i] + elif isinstance(self.data[k], torch.Tensor): + return self.data[k][i : i + 1] + else: + return self.data[k][i] + + return [{k: _unpack(k, i) for k in self.data.keys()} for i in range(batch_size)] + + +def collate_fn( + states: list[dict[str, Any]], dense_field_names: Sequence[str] = () +) -> SimpleBatchedData: + """ + Combine a list of samples into a SimpleBatchedData object. + + The association between the index in `states[i][k]` and a row in the `batched_data[k]` is + stored in `batched_data.batch_idx[k]`. If the `k` appears in + `dense_field_names`, `batched_data.batch_idx[k]` is `None` and the data is + simply stacked along the first dimension. + + Non-tensor values are put into lists. + """ + assert states, "Cannot collate empty list" + concatenated_data = {} + batch_idx: dict[str, torch.Tensor | None] = {} + for k, v in states[0].items(): + if isinstance(v, torch.Tensor): + concatenated_data[k] = torch.cat([x[k] for x in states], dim=0) + if k in dense_field_names: + if any(x[k].shape[0] != 1 for x in states): + raise ValueError( + f"First dimension should be batch dimension. Instead key {k} has shape {states[0][k].shape}" + ) + batch_idx[k] = None + else: + batch_idx[k] = _construct_batch_idx(states, k) + else: + concatenated_data[k] = [x[k] for x in states] + batch_idx[k] = None + + batch = SimpleBatchedData(data=concatenated_data, batch_idx=batch_idx) + if "edge_index" in batch.data: + batch = batch.replace( + edge_index=_batch_edge_index( + batch["edge_index"], + batch.batch_idx["atomic_numbers"], + batch.batch_idx["edge_index"], + ), + ) + return batch + + +def _batch_edge_index(edge_index, atom_batch_idx, edge_batch_idx): + num_atoms = scatter(torch.ones_like(atom_batch_idx), atom_batch_idx) + num_atoms_acc = torch.nn.functional.pad(torch.cumsum(num_atoms, 0)[:-1], [1, 0], "constant", 0) + return edge_index + num_atoms_acc[edge_batch_idx].unsqueeze(1) + + +def _construct_batch_idx(data_list: list[Any], field_name: str) -> torch.LongTensor: + """Construct batch index tensor for one field.""" + batch_size = len(data_list) + return torch.repeat_interleave( + torch.arange(0, batch_size), + torch.tensor([x[field_name].shape[0] for x in data_list]), + ) diff --git a/data/mattergen/diffusion/diffusion_module.py b/data/mattergen/diffusion/diffusion_module.py new file mode 100644 index 0000000000000000000000000000000000000000..06d26835ba85afaad8f6ae05bc29c0adafb7d512 --- /dev/null +++ b/data/mattergen/diffusion/diffusion_module.py @@ -0,0 +1,158 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Callable, Generic, TypeVar + +import torch + +from mattergen.diffusion.corruption.multi_corruption import MultiCorruption, apply +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.losses import Loss +from mattergen.diffusion.model_target import ModelTarget +from mattergen.diffusion.model_utils import convert_model_out_to_score +from mattergen.diffusion.score_models.base import ScoreModel +from mattergen.diffusion.timestep_samplers import TimestepSampler, UniformTimestepSampler + +T = TypeVar("T", bound=BatchedData) +BatchTransform = Callable[[T], T] + + +def identity(x: T) -> T: + return x + + +class DiffusionModule(torch.nn.Module, Generic[T]): + """Denoising diffusion model for a multi-part state""" + + def __init__( + self, + model: ScoreModel[T], + corruption: MultiCorruption[T], + loss_fn: Loss, + pre_corruption_fn: BatchTransform | None = None, + timestep_sampler: TimestepSampler | None = None, + ) -> None: + super().__init__() + self.model = model + self.corruption = corruption + self.loss_fn = loss_fn + self.pre_corruption_fn = pre_corruption_fn or identity + self.model_targets = {k: ModelTarget(v) for k, v in loss_fn.model_targets.items()} + + self.timestep_sampler = timestep_sampler or UniformTimestepSampler( + min_t=1e-5, + max_t=corruption.T, + ) + + # Check corruption for nn.Modules and register them here. + self._register_corruption_modules() + + def _register_corruption_modules(self): + """ + Register corruptions that are instances of `torch.nn.Module`s for proper device, parameter, + etc handling. + """ + assert isinstance(self.corruption, MultiCorruption) + for idx, (key, _corruption) in enumerate(self.corruption._corruptions.items()): + if isinstance(_corruption, torch.nn.Module): + self.register_module(f"MultiCorruption:{idx}:{key}", _corruption) + + def calc_loss( + self, batch: T, node_is_unmasked: torch.LongTensor | None = None + ) -> tuple[torch.Tensor, dict[str, torch.Tensor]]: + """ + Calculate loss and metrics given a batch of clean data which may include + context/conditioning fields. Add noise, predict score using score model, then calculate + loss. + + Args: + batch: batch of training data + node_is_unmasked: mask that has a value 1 for nodes that are included in the loss, and + a value of 0 for nodes that should be ignored. If None, all nodes are included. + + Returns: + loss: the loss for the batch + metrics: a dictionary of metrics for the batch + """ + batch = self.pre_corruption_fn(batch) + + noisy_batch, t = self._corrupt_batch(batch) + + score_model_output = self.model(noisy_batch, t) + loss, metrics = self.loss_fn( + multi_corruption=self.corruption, + batch=batch, + noisy_batch=noisy_batch, + score_model_output=score_model_output, + t=t, + node_is_unmasked=node_is_unmasked, + ) + assert loss.numel() == 1 + + return loss, metrics + + def _corrupt_batch( + self, + batch: T, + ) -> tuple[T, torch.Tensor]: + """ + Corrupt a batch of data for use in a training step: + - sample a different timestep for each sample in the batch + - add noise according to the corruption process + + Args: + batch: Batch of clean states + + Returns: + noisy_batch: batch of noisy samples + t: the timestep used for each sample in the batch + + """ + # Sample timesteps + t = self.sample_timesteps(batch) + + # Add noise to data + noisy_batch = self.corruption.sample_marginal(batch, t) + + return noisy_batch, t + + def score_fn(self, x: T, t: torch.Tensor) -> T: + """Calculate the score of a batch of data at a given timestep + + Args: + x: batch of data + t: timestep + + Returns: + score: score of the batch of data at the given timestep + """ + model_out: T = self.model(x, t) + fns = {k: convert_model_out_to_score for k in self.corruption.sdes.keys()} + + scores = apply( + fns=fns, + model_out=model_out, + broadcast=dict(t=t, batch=x), + sde=self.corruption.sdes, + model_target=self.model_targets, + batch_idx=self.corruption._get_batch_indices(x), + ) + + return model_out.replace(**scores) + + def sample_timesteps(self, batch: T) -> torch.Tensor: + """Sample the timesteps, which will be used to determine how much noise + to add to data. + + Args: + batch: batch of data to be corrupted + + Returns: sampled timesteps + """ + return self.timestep_sampler( + batch_size=batch.get_batch_size(), + device=self._get_device(batch), + ) + + def _get_device(self, batch: T) -> torch.device: + return next(batch[k].device for k in self.corruption.sdes.keys()) diff --git a/data/mattergen/diffusion/discrete_time.py b/data/mattergen/diffusion/discrete_time.py new file mode 100644 index 0000000000000000000000000000000000000000..6829d3a0103c615ef2e0d9623879bfbb4238f2f2 --- /dev/null +++ b/data/mattergen/diffusion/discrete_time.py @@ -0,0 +1,17 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import torch + + +def to_discrete_time(t: torch.Tensor, N: int, T: float) -> torch.LongTensor: + """Convert continuous time to integer timestep. + + Args: + t: continuous time between 0 and T + N: number of timesteps + T: max time + Returns: + Integer timesteps between 0 and N-1 + """ + return ((t * (N - 1)) / T).long() diff --git a/data/mattergen/diffusion/exceptions.py b/data/mattergen/diffusion/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..fb36a0beeadec5c2c7da571fb6d2f044a7da9876 --- /dev/null +++ b/data/mattergen/diffusion/exceptions.py @@ -0,0 +1,11 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +class IncompatibleSampler(ValueError): + # Raised when sampler type and SDE are incompatible. + pass + + +class AmbiguousConfig(ValueError): + # Raised when the config is ambiguous + pass diff --git a/data/mattergen/diffusion/lightning_module.py b/data/mattergen/diffusion/lightning_module.py new file mode 100644 index 0000000000000000000000000000000000000000..e4066d0a75fbeaeebf27878131a9bc547d4cfc4f --- /dev/null +++ b/data/mattergen/diffusion/lightning_module.py @@ -0,0 +1,172 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from __future__ import annotations + +from collections import deque +from typing import Any, Dict, Generic, Optional, Protocol, Sequence, TypeVar, Union + +import numpy as np +import pytorch_lightning as pl +import torch +from hydra.errors import InstantiationException +from hydra.utils import instantiate +from omegaconf import DictConfig +from pytorch_lightning.utilities.types import STEP_OUTPUT +from torch.optim import AdamW, Optimizer +from tqdm import tqdm + +from mattergen.diffusion.config import Config +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.diffusion_module import DiffusionModule + +T = TypeVar("T", bound=BatchedData) + + +class OptimizerPartial(Protocol): + """Callable to instantiate an optimizer.""" + + def __call__(self, params: Any) -> Optimizer: + raise NotImplementedError + + +class SchedulerPartial(Protocol): + """Callable to instantiate a learning rate scheduler.""" + + def __call__(self, optimizer: Optimizer) -> Any: + raise NotImplementedError + + +def get_default_optimizer(params): + return AdamW(params=params, lr=1e-4, weight_decay=0, amsgrad=True) + + +class DiffusionLightningModule(pl.LightningModule, Generic[T]): + """LightningModule for instantiating and training a DiffusionModule.""" + + def __init__( + self, + diffusion_module: DiffusionModule[T], + optimizer_partial: Optional[OptimizerPartial] = None, + scheduler_partials: Optional[Sequence[Dict[str, Union[Any, SchedulerPartial]]]] = None, + ): + """_summary_ + + Args: + diffusion_module: The diffusion module to use. + optimizer_partial: Used to instantiate optimizer. + scheduler_partials: used to instantiate learning rate schedulers + """ + super().__init__() + scheduler_partials = scheduler_partials or [] + optimizer_partial = optimizer_partial or get_default_optimizer + self.save_hyperparameters( + ignore=("optimizer_partial", "scheduler_partials", "diffusion_module") + ) + + self.diffusion_module = diffusion_module + self._optimizer_partial = optimizer_partial + self._scheduler_partials = scheduler_partials + + @classmethod + def load_from_checkpoint( + cls, + checkpoint_path: str, + map_location: Optional[str] = None, + **kwargs, + ) -> DiffusionLightningModule: + """Load model from checkpoint. kwargs are passed to hydra's instantiate and can override + arguments from the checkpoint config.""" + checkpoint = torch.load(checkpoint_path, map_location=map_location) + + # The config should have been saved in the checkpoint by AddConfigCallback in run.py + config = Config(**checkpoint["config"]) + try: + lightning_module = instantiate(config.lightning_module, **kwargs) + except InstantiationException as e: + print("Could not instantiate model from the checkpoint.") + print( + "If the error is due to an unexpected argument because the checkpoint and the code have diverged, try using load_from_checkpoint_and_config instead." + ) + raise e + assert isinstance(lightning_module, cls) + + # Restore state of the DiffusionLightningModule. + lightning_module.load_state_dict(checkpoint["state_dict"]) + return lightning_module + + @classmethod + def load_from_checkpoint_and_config( + cls, + checkpoint_path: str, + config: DictConfig, + map_location: Optional[str] = None, + strict: bool = True, + ) -> tuple[DiffusionLightningModule, torch.nn.modules.module._IncompatibleKeys]: + """Load model from checkpoint, but instead of using the config stored in the checkpoint, + use the config passed in as an argument. This is useful when, e.g., an unused argument was + removed in the code but is still present in the checkpoint config.""" + checkpoint = torch.load(checkpoint_path, map_location=map_location) + + lightning_module = instantiate(config) + assert isinstance(lightning_module, cls) + + # Restore state of the DiffusionLightningModule. + result = lightning_module.load_state_dict(checkpoint["state_dict"], strict=strict) + + return lightning_module, result + + def configure_optimizers(self) -> Any: + optimizer = self._optimizer_partial(params=self.diffusion_module.parameters()) + if self._scheduler_partials: + lr_schedulers = [ + { + **scheduler_dict, + "scheduler": scheduler_dict["scheduler"]( + optimizer=optimizer, + ), + } + for scheduler_dict in self._scheduler_partials + ] + + return [ + optimizer, + ], lr_schedulers + else: + return optimizer + + def training_step(self, train_batch: T, batch_idx: int) -> STEP_OUTPUT: + return self._calc_loss(train_batch, True) + + def validation_step(self, val_batch: T, batch_idx: int) -> Optional[STEP_OUTPUT]: + return self._calc_loss(val_batch, False) + + def test_step(self, test_batch: T, batch_idx: int) -> Optional[STEP_OUTPUT]: + return self._calc_loss(test_batch, False) + + def _calc_loss(self, batch: T, train: bool) -> Optional[STEP_OUTPUT]: + """Calculate loss and metrics given a batch of clean data.""" + loss, metrics = self.diffusion_module.calc_loss(batch) + # Log the results + step_type = "train" if train else "val" + batch_size = batch.get_batch_size() + self.log( + f"loss_{step_type}", + loss, + on_step=train, + on_epoch=True, + prog_bar=train, + batch_size=batch_size, + sync_dist=True, + ) + for k, v in metrics.items(): + self.log( + f"{k}_{step_type}", + v, + on_step=train, + on_epoch=True, + prog_bar=train, + batch_size=batch_size, + sync_dist=True, + ) + return loss diff --git a/data/mattergen/diffusion/losses.py b/data/mattergen/diffusion/losses.py new file mode 100644 index 0000000000000000000000000000000000000000..880ecc22f25b0a3fa654d0944e36fc297a161a96 --- /dev/null +++ b/data/mattergen/diffusion/losses.py @@ -0,0 +1,125 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from functools import partial +from typing import Dict, Literal, Optional, Protocol, Tuple, TypeVar + +import torch + +from mattergen.diffusion.corruption.multi_corruption import MultiCorruption, apply +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.model_target import ModelTargets +from mattergen.diffusion.training.field_loss import FieldLoss, denoising_score_matching + +T = TypeVar("T", bound=BatchedData) + + +class Loss(Protocol[T]): + """Loss function for training a score model on multi-field data.""" + + def __call__( + self, + *, + multi_corruption: MultiCorruption[T], + batch: T, + noisy_batch: T, + score_model_output: T, + t: torch.Tensor, + node_is_unmasked: Optional[torch.LongTensor] = None, + ) -> Tuple[torch.Tensor, Dict[str, float]]: + pass + + """model_targets tells us what this loss function trains the score model to predict. + We need this information in order to convert the model output to a score during sampling. + """ + model_targets: ModelTargets + + +class SummedFieldLoss(Loss[T]): + """(Weighted) sum of different loss functions applied on each field.""" + + def __init__( + self, + loss_fns: Dict[str, FieldLoss], + model_targets: ModelTargets, + weights: Optional[Dict[str, float]] = None, + ) -> None: + self.model_targets = model_targets + self.loss_fns = loss_fns + # weights are optional, if not provided, all fields are weighted equally with weight 1. + if weights is None: + self.loss_weights = {k: 1.0 for k in self.loss_fns.keys()} + else: + assert set(weights.keys()) == set( + self.loss_fns.keys() + ), f"weight keys {set(weights.keys())} do not match loss_fns keys {set(self.loss_fns.keys())}" + self.loss_weights = weights + + def __call__( + self, + *, + multi_corruption: MultiCorruption[T], + batch: T, + noisy_batch: T, + score_model_output: T, + t: torch.Tensor, + node_is_unmasked: Optional[torch.LongTensor] = None, + ) -> Tuple[torch.Tensor, Dict[str, float]]: + batch_idx = {k: batch.get_batch_idx(k) for k in self.loss_fns.keys()} + node_is_unmasked = {k: node_is_unmasked for k in self.loss_fns.keys()} + + # Dict[str, torch.Tensor] + # Keys are field names and values are loss per sample, with shape (batch_size,). + loss_per_sample_per_field = apply( + fns=self.loss_fns, + corruption=multi_corruption.corruptions, + x=batch, + noisy_x=noisy_batch, + score_model_output=score_model_output, + batch_idx=batch_idx, + broadcast=dict(t=t, batch_size=batch.get_batch_size(), batch=batch), + node_is_unmasked=node_is_unmasked, + ) + assert set([v.shape for v in loss_per_sample_per_field.values()]) == { + (batch.get_batch_size(),) + }, "All losses should have shape (batch_size,)." + # Aggregate losses per field over samples. + scalar_loss_per_field = {k: v.mean() for k, v in loss_per_sample_per_field.items()} + + # Dict[str, torch.Tensor], dictionary containing metrics to be logged, + metrics_dict = scalar_loss_per_field + # This is the loss that is used for backpropagation (after mean aggregation over samples). + # Shape: (batch_size,) + agg_loss = torch.stack( + [self.loss_weights[k] * v for k, v in loss_per_sample_per_field.items()], dim=0 + ).sum(0) + + return ( + agg_loss.mean(), + metrics_dict, + ) + + +class DenoisingScoreMatchingLoss(SummedFieldLoss): + def __init__( + self, + model_targets: ModelTargets, + reduce: Literal["sum", "mean"] = "mean", + weights: Optional[Dict[str, float]] = None, + field_center_zero: Optional[Dict[str, bool]] = None, # Whether to zero center each field. + ): + if field_center_zero is not None: + assert set(field_center_zero.keys()) == set(model_targets.keys()) + + super().__init__( + loss_fns={ + k: partial( + denoising_score_matching, + reduce=reduce, + model_target=v, + ) + for k, v in model_targets.items() + }, + model_targets=model_targets, + weights=weights, + ) diff --git a/data/mattergen/diffusion/model_target.py b/data/mattergen/diffusion/model_target.py new file mode 100644 index 0000000000000000000000000000000000000000..1a473762fcf9e2c32fefada351de9a9309cb0004 --- /dev/null +++ b/data/mattergen/diffusion/model_target.py @@ -0,0 +1,16 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from enum import Enum +from typing import Mapping, Union + + +class ModelTarget(Enum): + """Specifies what the score model is trained to predict. + Only relevant for fields that are corrupted with an SDE.""" + + score_times_std = "score_times_std" # Predict -z where z is gaussian noise with unit variance used to corrupt the data + logits = "logits" # Predict logits for a categorical variable + + +ModelTargets = Mapping[str, Union[ModelTarget, str]] diff --git a/data/mattergen/diffusion/model_utils.py b/data/mattergen/diffusion/model_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..7193aeb9472ee8bc35f8230733d5828e8af2406c --- /dev/null +++ b/data/mattergen/diffusion/model_utils.py @@ -0,0 +1,74 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import math +from typing import Any, TypeVar + +import torch + +from mattergen.diffusion.corruption.sde_lib import SDE +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.model_target import ModelTarget + +T = TypeVar("T", bound=BatchedData) + + +def convert_model_out_to_score( + *, + model_target: ModelTarget, + sde: SDE, + model_out: torch.Tensor, + batch_idx: torch.LongTensor, + t: torch.Tensor, + batch: Any +) -> torch.Tensor: + """ + Convert a model output to a score, according to the specified model_target. + + model_target: says what the model predicts. + For example, in RFDiffusion the model predicts clean coordinates; + in EDM the model predicts the raw noise. + sde: corruption process + model_out: model output + batch_idx: indicates which sample each row of model_out belongs to + noisy_x: noisy data + t: diffusion timestep + batch: noisy batch, ignored except by strange SDEs + """ + _, std = sde.marginal_prob( + x=torch.ones_like(model_out), + t=t, + batch_idx=batch_idx, + batch=batch, + ) + # Note the slack tolerances in test_model_utils.py: the choice of ModelTarget does make a difference. + if model_target == ModelTarget.score_times_std: + return model_out / std + elif model_target == ModelTarget.logits: + # Not really a score, but logits will be handled downstream. + return model_out + else: + raise NotImplementedError + + +class NoiseLevelEncoding(torch.nn.Module): + """ + From: https://pytorch.org/tutorials/beginner/transformer_tutorial.html + """ + + def __init__(self, d_model: int, dropout: float = 0.0): + super().__init__() + self.dropout = torch.nn.Dropout(p=dropout) + self.d_model = d_model + div_term = torch.exp(torch.arange(0, d_model, 2) * (-math.log(10000.0) / d_model)) + self.register_buffer("div_term", div_term) + + def forward(self, t: torch.Tensor) -> torch.Tensor: + """ + Args: + t: Tensor, shape [batch_size] + """ + x = torch.zeros((t.shape[0], self.d_model), device=self.div_term.device) + x[:, 0::2] = torch.sin(t[:, None] * self.div_term[None]) + x[:, 1::2] = torch.cos(t[:, None] * self.div_term[None]) + return self.dropout(x) diff --git a/data/mattergen/diffusion/run.py b/data/mattergen/diffusion/run.py new file mode 100644 index 0000000000000000000000000000000000000000..432fcd7298535e221897a6b8b69f5e63314432fd --- /dev/null +++ b/data/mattergen/diffusion/run.py @@ -0,0 +1,179 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import argparse +import logging +import os +import random +import re +from glob import glob +from typing import Any, Mapping, TypeVar + +import numpy as np +import pytorch_lightning as pl +import torch +import yaml +from hydra.utils import instantiate +from omegaconf import DictConfig, OmegaConf +from pytorch_lightning import Callback +from pytorch_lightning.callbacks import ModelCheckpoint +from pytorch_lightning.cli import SaveConfigCallback +from pytorch_lightning.utilities import rank_zero_only + +from mattergen.common.utils.config_utils import get_config +from mattergen.diffusion.config import Config +from mattergen.diffusion.exceptions import AmbiguousConfig +from mattergen.diffusion.lightning_module import DiffusionLightningModule + +T = TypeVar("T") + +# logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + + +def maybe_instantiate(instance_or_config: T | Mapping, expected_type=None, **kwargs) -> T: + """ + If instance_or_config is a mapping with a _target_ field, instantiate it. + Otherwise, return it as is. + """ + if isinstance(instance_or_config, Mapping) and "_target_" in instance_or_config: + instance = instantiate(instance_or_config, **kwargs) + else: + instance = instance_or_config + assert expected_type is None or isinstance( + instance, expected_type + ), f"Expected {expected_type}, got {type(instance)}" + return instance + + +def _find_latest_checkpoint(dirpath: str) -> str | None: + """Finds the most recent checkpoint inside `dirpath`.""" + + # checkpoint names are like "epoch=0-step=0.ckpt." + # Find the checkpoint with highest epoch: + def extract_epoch(ckpt): + match = re.search(r"epoch=(\d+)", ckpt) + if match: + return int(match.group(1)) + return -1 + + ckpts = glob(f"{dirpath}/*.ckpt") + epochs = np.array([extract_epoch(ckpt) for ckpt in ckpts]) + if len(epochs) == 0 or epochs.max() < 0: + # No checkpoints found. + return None + latest_checkpoint = ckpts[epochs.argmax()] + return latest_checkpoint + + +class SimpleParser: + def save(self, config, path, **_): + with open(path, "w") as f: + yaml.dump(config, f) + + +class AddConfigCallback(Callback): + """Adds a copy of the config to the checkpoint, so that `load_from_checkpoint` can use it to instantiate everything.""" + + def __init__(self, config: dict[str, Any]): + self._config_dict = config + + def on_save_checkpoint( + self, trainer: "pl.Trainer", pl_module: "pl.LightningModule", checkpoint: dict[str, Any] + ) -> None: + checkpoint["config"] = self._config_dict + + +def main( + config: Config | DictConfig, save_config: bool = True, seed: int | None = None +) -> tuple[pl.Trainer, pl.LightningModule]: + """ + Main entry point to train and evaluate a diffusion model. + + save_config: if True, the config will be saved both as a YAML file and in each checkpoint. This doesn't work if the config contains things that can't be `yaml.dump`-ed, so + if you don't care about saving and loading checkpoints and want to use a config that contains things like `torch.nn.Module`s already instantiated, set this to False. + """ + if config.checkpoint_path and config.auto_resume: + raise AmbiguousConfig( + f"Ambiguous config: you set both a checkpoint path {config.checkpoint_path} and `auto_resume` which means automatically select a checkpoint path to resume from." + ) + + if seed is not None: + torch.manual_seed(seed) + torch.cuda.manual_seed(seed) + torch.cuda.manual_seed_all(seed) + np.random.seed(seed) + random.seed(seed) + + trainer: pl.Trainer = maybe_instantiate(config.trainer, pl.Trainer) + + if save_config: + if isinstance(config, DictConfig): + config_as_dict = OmegaConf.to_container(config, resolve=True) + # This callback will save a config.yaml file. + trainer.callbacks.append( + SaveConfigCallback( + parser=SimpleParser(), + config=config_as_dict, + overwrite=True if config.auto_resume else False, + ) + ) + + # This callback will add a copy of the config to each checkpoint. + trainer.callbacks.append(AddConfigCallback(config_as_dict)) + else: + raise NotImplementedError + datamodule: pl.LightningDataModule = maybe_instantiate( + config.data_module, pl.LightningDataModule + ) + + # If checkpoint_path is provided training will be resumed from this point. + # Beware: the old checkpoint will be deleted when a new one is saved. + + ckpt_path = config.checkpoint_path + if config.auto_resume: + # Add an additional checkpointer with a fixed directory path to restore from. + dirpath = os.path.join(trainer.default_root_dir, "checkpoints") + trainer.callbacks.append(ModelCheckpoint(dirpath=dirpath)) + ckpt_path = _find_latest_checkpoint(dirpath) + pl_module: DiffusionLightningModule = maybe_instantiate( + config.lightning_module, DiffusionLightningModule + ) + if rank_zero_only.rank == 0 and isinstance(trainer.logger, pl.loggers.WandbLogger): + # Log the config to wandb so that it shows up in the portal. + trainer.logger.experiment.config.update( + {**OmegaConf.to_container(config, resolve=True)}, + allow_val_change=True, + ) + trainer.fit( + pl_module, + datamodule=datamodule, + ckpt_path=ckpt_path, + ) + + return trainer, pl_module + + +def cli(argv: list[str] | None) -> None: + """ + Args: + argv: list of command-line arguments as strings, or None. If None, + command-line arguments will be got from sys.argv + """ + + parser = argparse.ArgumentParser(allow_abbrev=False) # prevent prefix matching issues + parser.add_argument( + "--seed", + type=int, + help="Random seed to use. If not provided, a random seed will be used.", + ) + args, argv = parser.parse_known_args(argv) + + # Create config from command-line arguments. + config = get_config(argv, Config) + main(config, seed=args.seed) + + +if __name__ == "__main__": + cli(argv=None) diff --git a/data/mattergen/diffusion/sampling/__init__.py b/data/mattergen/diffusion/sampling/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/sampling/classifier_free_guidance.py b/data/mattergen/diffusion/sampling/classifier_free_guidance.py new file mode 100644 index 0000000000000000000000000000000000000000..69b65ef4d5fac4f732b5a0f963cdfdb53b29d259 --- /dev/null +++ b/data/mattergen/diffusion/sampling/classifier_free_guidance.py @@ -0,0 +1,84 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Callable + +import torch + +from mattergen.diffusion.sampling.pc_sampler import Diffusable, PredictorCorrector + +BatchTransform = Callable[[Diffusable], Diffusable] + + +def identity(x: Diffusable) -> Diffusable: + """ + Default function that transforms data to its conditional state + """ + return x + + +class GuidedPredictorCorrector(PredictorCorrector): + """ + Sampler for classifier-free guidance. + """ + + def __init__( + self, + *, + guidance_scale: float, + remove_conditioning_fn: BatchTransform, + keep_conditioning_fn: BatchTransform | None = None, + **kwargs, + ): + """ + guidance_scale: gamma in p_gamma(x|y)=p(x)p(y|x)**gamma for classifier-free guidance + remove_conditioning_fn: function that removes conditioning from the data + keep_conditioning_fn: function that will be applied to the data before evaluating the conditional score. For example, this function might drop some fields that you never want to condition on or add fields that indicate which conditions should be respected. + **kwargs: passed on to parent class constructor. + """ + + super().__init__(**kwargs) + self._remove_conditioning_fn = remove_conditioning_fn + self._keep_conditioning_fn = keep_conditioning_fn or identity + self._guidance_scale = guidance_scale + + def _score_fn( + self, + x: Diffusable, + t: torch.Tensor, + ) -> Diffusable: + """For each field, regardless of whether the corruption process is SDE or D3PM, we guide the score in the same way here, + by taking a linear combination of the conditional and unconditional score model output. + + For discrete fields, the score model outputs are interpreted as logits, so the linear combination here means we compute logits for + p_\gamma(x|y)=p(x)^(1-\gamma) p(x|y)^\gamma + + """ + + def get_unconditional_score(): + return super(GuidedPredictorCorrector, self)._score_fn( + x=self._remove_conditioning_fn(x), t=t + ) + + def get_conditional_score(): + return super(GuidedPredictorCorrector, self)._score_fn( + x=self._keep_conditioning_fn(x), t=t + ) + + if abs(self._guidance_scale - 1) < 1e-15: + return get_conditional_score() + elif abs(self._guidance_scale) < 1e-15: + return get_unconditional_score() + else: + # guided_score = guidance_factor * conditional_score + (1-guidance_factor) * unconditional_score + + conditional_score = get_conditional_score() + unconditional_score = get_unconditional_score() + return unconditional_score.replace( + **{ + k: torch.lerp( + unconditional_score[k], conditional_score[k], self._guidance_scale + ) + for k in self._multi_corruption.corrupted_fields + } + ) diff --git a/data/mattergen/diffusion/sampling/pc_partials.py b/data/mattergen/diffusion/sampling/pc_partials.py new file mode 100644 index 0000000000000000000000000000000000000000..1011fa723fcf541e43a9306a5cd5478ffccf8b47 --- /dev/null +++ b/data/mattergen/diffusion/sampling/pc_partials.py @@ -0,0 +1,21 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Protocol + +from mattergen.diffusion.corruption.corruption import Corruption +from mattergen.diffusion.corruption.sde_lib import ScoreFunction +from mattergen.diffusion.sampling.predictors import Predictor +from mattergen.diffusion.sampling.predictors_correctors import LangevinCorrector + + +class PredictorPartial(Protocol): + def __call__(self, *, corruption: Corruption, score_fn: ScoreFunction | None) -> Predictor: + raise NotImplementedError + + +class CorrectorPartial(Protocol): + def __call__( + self, *, corruption: Corruption, n_steps: int, score_fn: ScoreFunction | None + ) -> LangevinCorrector: + raise NotImplementedError diff --git a/data/mattergen/diffusion/sampling/pc_sampler.py b/data/mattergen/diffusion/sampling/pc_sampler.py new file mode 100644 index 0000000000000000000000000000000000000000..474ec5c03fae2c97f822ecfdfc9f64d9262ae964 --- /dev/null +++ b/data/mattergen/diffusion/sampling/pc_sampler.py @@ -0,0 +1,279 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from __future__ import annotations + +from typing import Generic, Mapping, Tuple, TypeVar + +import torch +from tqdm.auto import tqdm + +from mattergen.diffusion.corruption.multi_corruption import MultiCorruption, apply +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.diffusion_module import DiffusionModule +from mattergen.diffusion.lightning_module import DiffusionLightningModule +from mattergen.diffusion.sampling.pc_partials import CorrectorPartial, PredictorPartial + +Diffusable = TypeVar( + "Diffusable", bound=BatchedData +) # Don't use 'T' because it clashes with the 'T' for time +SampleAndMean = Tuple[Diffusable, Diffusable] +SampleAndMeanAndMaybeRecords = Tuple[Diffusable, Diffusable, list[Diffusable] | None] +SampleAndMeanAndRecords = Tuple[Diffusable, Diffusable, list[Diffusable]] + + +class PredictorCorrector(Generic[Diffusable]): + """Generates samples using predictor-corrector sampling.""" + + def __init__( + self, + *, + diffusion_module: DiffusionModule, + predictor_partials: dict[str, PredictorPartial] | None = None, + corrector_partials: dict[str, CorrectorPartial] | None = None, + device: torch.device, + n_steps_corrector: int, + N: int, + eps_t: float = 1e-3, + max_t: float | None = None, + ): + """ + Args: + diffusion_module: diffusion module + predictor_partials: partials for constructing predictors. Keys are the names of the corruptions. + corrector_partials: partials for constructing correctors. Keys are the names of the corruptions. + device: device to run on + n_steps_corrector: number of corrector steps + N: number of noise levels + eps_t: diffusion time to stop denoising at + max_t: diffusion time to start denoising at. If None, defaults to the maximum diffusion time. You may want to start at T-0.01, say, for numerical stability. + """ + self._diffusion_module = diffusion_module + self.N = N + + if max_t is None: + max_t = self._multi_corruption.T + assert max_t <= self._multi_corruption.T, "Denoising cannot start from beyond T" + + self._max_t = max_t + assert ( + corrector_partials or predictor_partials + ), "Must specify at least one predictor or corrector" + corrector_partials = corrector_partials or {} + predictor_partials = predictor_partials or {} + if self._multi_corruption.discrete_corruptions: + # These all have property 'N' because they are D3PM type + assert set(c.N for c in self._multi_corruption.discrete_corruptions.values()) == {N} # type: ignore + + self._predictors = { + k: v(corruption=self._multi_corruption.corruptions[k], score_fn=None) + for k, v in predictor_partials.items() + } + + self._correctors = { + k: v( + corruption=self._multi_corruption.corruptions[k], + n_steps=n_steps_corrector, + score_fn=None, + ) + for k, v in corrector_partials.items() + } + self._eps_t = eps_t + self._n_steps_corrector = n_steps_corrector + self._device = device + + @property + def diffusion_module(self) -> DiffusionModule: + return self._diffusion_module + + @property + def _multi_corruption(self) -> MultiCorruption: + return self._diffusion_module.corruption + + def _score_fn(self, x: Diffusable, t: torch.Tensor) -> Diffusable: + return self._diffusion_module.score_fn(x, t) + + @classmethod + def from_pl_module(cls, pl_module: DiffusionLightningModule, **kwargs) -> PredictorCorrector: + return cls(diffusion_module=pl_module.diffusion_module, device=pl_module.device, **kwargs) + + @torch.no_grad() + def sample( + self, conditioning_data: BatchedData, mask: Mapping[str, torch.Tensor] | None = None + ) -> SampleAndMean: + """Create one sample for each of a batch of conditions. + Args: + conditioning_data: batched conditioning data. Even if you think you don't want conditioning, you still need to pass a batch of conditions + because the sampler uses these to determine the shapes of things to generate. + mask: for inpainting. Keys should be a subset of the keys in `data`. 1 indicates data that should be fixed, 0 indicates data that should be replaced with sampled values. + Shapes of values in `mask` must match the shapes of values in `conditioning_data`. + Returns: + (batch, mean_batch). The difference between these is that `mean_batch` has no noise added at the final denoising step. + + """ + return self._sample_maybe_record(conditioning_data, mask=mask, record=False)[:2] + + @torch.no_grad() + def sample_with_record( + self, conditioning_data: BatchedData, mask: Mapping[str, torch.Tensor] | None = None + ) -> SampleAndMeanAndRecords: + """Create one sample for each of a batch of conditions. + Args: + conditioning_data: batched conditioning data. Even if you think you don't want conditioning, you still need to pass a batch of conditions + because the sampler uses these to determine the shapes of things to generate. + mask: for inpainting. Keys should be a subset of the keys in `data`. 1 indicates data that should be fixed, 0 indicates data that should be replaced with sampled values. + Shapes of values in `mask` must match the shapes of values in `conditioning_data`. + Returns: + (batch, mean_batch). The difference between these is that `mean_batch` has no noise added at the final denoising step. + + """ + return self._sample_maybe_record(conditioning_data, mask=mask, record=True) + + @torch.no_grad() + def _sample_maybe_record( + self, + conditioning_data: BatchedData, + mask: Mapping[str, torch.Tensor] | None = None, + record: bool = False, + ) -> SampleAndMeanAndMaybeRecords: + """Create one sample for each of a batch of conditions. + Args: + conditioning_data: batched conditioning data. Even if you think you don't want conditioning, you still need to pass a batch of conditions + because the sampler uses these to determine the shapes of things to generate. + mask: for inpainting. Keys should be a subset of the keys in `data`. 1 indicates data that should be fixed, 0 indicates data that should be replaced with sampled values. + Shapes of values in `mask` must match the shapes of values in `conditioning_data`. + Returns: + (batch, mean_batch, recorded_samples, recorded_predictions). + The difference between the former two is that `mean_batch` has no noise added at the final denoising step. + The latter two are only returned if `record` is True, and contain the samples and predictions from each step of the diffusion process. + + """ + if isinstance(self._diffusion_module, torch.nn.Module): + self._diffusion_module.eval() + mask = mask or {} + conditioning_data = conditioning_data.to(self._device) + mask = {k: v.to(self._device) for k, v in mask.items()} + batch = _sample_prior(self._multi_corruption, conditioning_data, mask=mask) + return self._denoise(batch=batch, mask=mask, record=record) + + @torch.no_grad() + def _denoise( + self, + batch: Diffusable, + mask: dict[str, torch.Tensor], + record: bool = False, + ) -> SampleAndMeanAndMaybeRecords: + """Denoise from a prior sample to a t=eps_t sample.""" + recorded_samples = None + if record: + recorded_samples = [] + for k in self._predictors: + mask.setdefault(k, None) + for k in self._correctors: + mask.setdefault(k, None) + mean_batch = batch.clone() + + # Decreasing timesteps from T to eps_t + timesteps = torch.linspace(self._max_t, self._eps_t, self.N, device=self._device) + dt = -torch.tensor((self._max_t - self._eps_t) / (self.N - 1)).to(self._device) + + for i in tqdm(range(self.N), miniters=50, mininterval=5): + # Set the timestep + t = torch.full((batch.get_batch_size(),), timesteps[i], device=self._device) + + # Corrector updates. + if self._correctors: + for _ in range(self._n_steps_corrector): + score = self._score_fn(batch, t) + fns = { + k: corrector.step_given_score for k, corrector in self._correctors.items() + } + samples_means: dict[str, Tuple[torch.Tensor, torch.Tensor]] = apply( + fns=fns, + broadcast={"t": t}, + x=batch, + score=score, + batch_idx=self._multi_corruption._get_batch_indices(batch), + ) + if record: + recorded_samples.append(batch.clone().to("cpu")) + batch, mean_batch = _mask_replace( + samples_means=samples_means, batch=batch, mean_batch=mean_batch, mask=mask + ) + + # Predictor updates + score = self._score_fn(batch, t) + predictor_fns = { + k: predictor.update_given_score for k, predictor in self._predictors.items() + } + samples_means = apply( + fns=predictor_fns, + x=batch, + score=score, + broadcast=dict(t=t, batch=batch, dt=dt), + batch_idx=self._multi_corruption._get_batch_indices(batch), + ) + if record: + recorded_samples.append(batch.clone().to("cpu")) + batch, mean_batch = _mask_replace( + samples_means=samples_means, batch=batch, mean_batch=mean_batch, mask=mask + ) + + return batch, mean_batch, recorded_samples + + +def _mask_replace( + samples_means: dict[str, Tuple[torch.Tensor, torch.Tensor]], + batch: BatchedData, + mean_batch: BatchedData, + mask: dict[str, torch.Tensor | None], +) -> SampleAndMean: + # Apply masks + samples_means = apply( + fns={k: _mask_both for k in samples_means}, + broadcast={}, + sample_and_mean=samples_means, + mask=mask, + old_x=batch, + ) + + # Put the updated values in `batch` and `mean_batch` + batch = batch.replace(**{k: v[0] for k, v in samples_means.items()}) + mean_batch = mean_batch.replace(**{k: v[1] for k, v in samples_means.items()}) + return batch, mean_batch + + +def _mask_both( + *, sample_and_mean: Tuple[torch.Tensor, torch.Tensor], old_x: torch.Tensor, mask: torch.Tensor +) -> Tuple[torch.Tensor, torch.Tensor]: + return tuple(_mask(old_x=old_x, new_x=x, mask=mask) for x in sample_and_mean) # type: ignore + + +def _mask(*, old_x: torch.Tensor, new_x: torch.Tensor, mask: torch.Tensor | None) -> torch.Tensor: + """Replace new_x with old_x where mask is 1.""" + if mask is None: + return new_x + else: + return new_x.lerp(old_x, mask) + + +def _sample_prior( + multi_corruption: MultiCorruption, + conditioning_data: BatchedData, + mask: Mapping[str, torch.Tensor] | None, +) -> BatchedData: + samples = { + k: multi_corruption.corruptions[k] + .prior_sampling( + shape=conditioning_data[k].shape, + conditioning_data=conditioning_data, + batch_idx=conditioning_data.get_batch_idx(field_name=k), + ) + .to(conditioning_data[k].device) + for k in multi_corruption.corruptions + } + mask = mask or {} + for k, msk in mask.items(): + if k in multi_corruption.corrupted_fields: + samples[k].lerp_(conditioning_data[k], msk) + return conditioning_data.replace(**samples) diff --git a/data/mattergen/diffusion/sampling/predictors.py b/data/mattergen/diffusion/sampling/predictors.py new file mode 100644 index 0000000000000000000000000000000000000000..0083ecbbeac4440842f53fe3cec4c1d27a0ea7dc --- /dev/null +++ b/data/mattergen/diffusion/sampling/predictors.py @@ -0,0 +1,169 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +"""Adapted from https://github.com/yang-song/score_sde_pytorch which is released under Apache license. + +Key changes: +- Introduced batch_idx argument to work with graph-like data (e.g. molecules) +- Introduced `..._given_score` methods so that multiple fields can be sampled at once using a shared score model. See PredictorCorrector for how this is used. +""" + +import abc +import logging + +import torch + +from mattergen.diffusion.corruption.corruption import Corruption +from mattergen.diffusion.corruption.sde_lib import SDE, ScoreFunction, check_score_fn_defined +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.sampling.predictors_correctors import SampleAndMean, Sampler +from mattergen.diffusion.wrapped.wrapped_sde import WrappedSDEMixin + +logger = logging.getLogger(__name__) + + +class Predictor(Sampler): + """The abstract class for something that takes x_t and predicts x_{t-dt}, + where t is diffusion timestep.""" + + def __init__( + self, + corruption: Corruption, + score_fn: ScoreFunction | None, + ): + super().__init__(corruption, score_fn=score_fn) + + def update_fn( + self, + *, + x: torch.Tensor, + t: torch.Tensor, + dt: torch.Tensor, + batch_idx: torch.LongTensor, + batch: BatchedData | None, + ) -> SampleAndMean: + """One update of the predictor. + + Args: + x: current state + t: timesteps + batch_idx: indicates which sample each row of x belongs to + + Returns: + (sampled next state, mean next state) + """ + check_score_fn_defined(self.score_fn, "update_given_score") + assert self.score_fn is not None + score = self.score_fn(x=x, t=t, batch_idx=batch_idx) + return self.update_given_score( + x=x, t=t, dt=dt, batch_idx=batch_idx, score=score, batch=batch + ) + + @abc.abstractmethod + def update_given_score( + self, + *, + x: torch.Tensor, + t: torch.Tensor, + dt: torch.Tensor, + batch_idx: torch.LongTensor, + score: torch.Tensor, + batch: BatchedData | None, + ) -> SampleAndMean: + pass + + +class AncestralSamplingPredictor(Predictor): + """Suitable for all linear SDEs. + + This predictor is derived by converting the score prediction to a prediction of x_0 given x_t, and then + sampling from the conditional distribution of x_{t-dt} given x_0 and x_t according to the corruption process. + It corresponds to equation (47) in Song et al. for VESDE (https://openreview.net/forum?id=PxTIG12RRHS) + and equation (7) in Ho et al. for VPSDE (https://arxiv.org/abs/2006.11239) + + In more detail: suppose the SDE has marginals x_t ~ N(alpha_t *x_0, sigma_t**2) + + We estimate x_0 as follows: + x_0 \approx (x_t + sigma_t^2 * score) / alpha_t + + For any s < t, the forward corruption process implies that + x_t| x_s ~ N(alpha_t/alpha_s * x_s, sigma_t^2 - sigma_s^2 * alpha_t^2 / alpha_s^2) + + Now go away and do some algebra to get the mean and variance of x_s given x_t + and x_0, and you will get the coefficients in the `update_given_score` method below. + + """ + + def update_given_score( + self, + *, + x: torch.Tensor, + t: torch.Tensor, + dt: torch.Tensor, + batch_idx: torch.LongTensor, + score: torch.Tensor, + batch: BatchedData | None, + ) -> SampleAndMean: + x_coeff, score_coeff, std = self._get_coeffs( + x=x, + t=t, + dt=dt, + batch_idx=batch_idx, + batch=batch, + ) + # Sample random noise. + z = torch.randn_like(x_coeff) + + mean = x_coeff * x + score_coeff * score + sample = mean + std * z + + return sample, mean + + def _get_coeffs(self, x, t, dt, batch_idx, batch): + """ + Compute coefficients for ancestral sampling. + This is in a separate method to make it easier to test.""" + sde = self.corruption + assert isinstance(sde, SDE) + + # Previous timestep + s = t + dt + + alpha_t, sigma_t = sde.mean_coeff_and_std(x=x, t=t, batch_idx=batch_idx, batch=batch) + if batch_idx is None: + is_time_zero = s <= 0 + else: + is_time_zero = s[batch_idx] <= 0 + alpha_s, sigma_s = sde.mean_coeff_and_std(x=x, t=s, batch_idx=batch_idx, batch=batch) + sigma_s[is_time_zero] = 0 + + # If you are trying to match this up with algebra in papers, it may help to + # notice that for VPSDE, sigma2_t_given_s == 1 - alpha_t_given_s**2, except + # that alpha_t_given_s**2 is clipped. + sigma2_t_given_s = sigma_t**2 - sigma_s**2 * alpha_t**2 / alpha_s**2 + sigma_t_given_s = torch.sqrt(sigma2_t_given_s) + std = sigma_t_given_s * sigma_s / sigma_t + + # Clip alpha_t_given_s so that we do not divide by zero. + min_alpha_t_given_s = 0.001 + alpha_t_given_s = alpha_t / alpha_s + if torch.any(alpha_t_given_s < min_alpha_t_given_s): + # If this warning is raised, you probably should change something: either modify your noise schedule + # so that the diffusion coefficient does not blow up near sde.T, or only denoise from sde.T - eps, + # rather than sde.T. + logger.warning( + f"Clipping alpha_t_given_s to {min_alpha_t_given_s} to avoid divide-by-zero. You should probably change something else to avoid this." + ) + alpha_t_given_s = torch.clip(alpha_t_given_s, min_alpha_t_given_s, 1) + + score_coeff = sigma2_t_given_s / alpha_t_given_s + + x_coeff = 1.0 / alpha_t_given_s + + std[is_time_zero] = 0 + + return x_coeff, score_coeff, std + + @classmethod + def is_compatible(cls, corruption: Corruption) -> bool: + return super().is_compatible(corruption) and not isinstance(corruption, WrappedSDEMixin) diff --git a/data/mattergen/diffusion/sampling/predictors_correctors.py b/data/mattergen/diffusion/sampling/predictors_correctors.py new file mode 100644 index 0000000000000000000000000000000000000000..359ca1657354c585d25bf14ef6473e26716c35fd --- /dev/null +++ b/data/mattergen/diffusion/sampling/predictors_correctors.py @@ -0,0 +1,125 @@ +# Copyright 2020 The Google Research Authors. +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Adapted from https://github.com/yang-song/score_sde_pytorch which is released under Apache license. + +# Key changes: +# - Introduced batch_idx argument to work with graph-like data (e.g. molecules) +# - Introduced `..._given_score` methods so that multiple fields can be sampled at once using a shared score model. See PredictorCorrector for how this is used. + +import abc + +import torch +from torch_scatter import scatter_add + +from mattergen.diffusion.corruption.corruption import maybe_expand +from mattergen.diffusion.corruption.sde_lib import ( + VESDE, + VPSDE, + BaseVPSDE, + Corruption, + ScoreFunction, +) +from mattergen.diffusion.exceptions import IncompatibleSampler +from mattergen.diffusion.wrapped.wrapped_sde import WrappedSDEMixin + +SampleAndMean = tuple[torch.Tensor, torch.Tensor] + + +class Sampler(abc.ABC): + def __init__(self, corruption: Corruption, score_fn: ScoreFunction | None): + if not self.is_compatible(corruption): + raise IncompatibleSampler( + f"{self.__class__.__name__} is not compatible with {corruption}" + ) + self.corruption = corruption + self.score_fn = score_fn + + @classmethod + def is_compatible(cls, corruption: Corruption) -> bool: + return True + + +class LangevinCorrector(Sampler): + def __init__( + self, + corruption: Corruption, + score_fn: ScoreFunction | None, + n_steps: int, + snr: float = 0.2, + max_step_size: float = 1.0, + ): + """The Langevin corrector. + + Args: + corruption: corruption process + score_fn: score function + n_steps: number of Langevin steps at each noise level + snr: signal-to-noise ratio + max_step_size: largest coefficient that the score can be multiplied by for each Langevin step. + """ + super().__init__(corruption=corruption, score_fn=score_fn) + self.n_steps = n_steps + self.snr = snr + self.max_step_size = torch.tensor(max_step_size) + + @classmethod + def is_compatible(cls, corruption: Corruption): + return ( + isinstance(corruption, (VESDE, BaseVPSDE)) + and super().is_compatible(corruption) + and not isinstance(corruption, WrappedSDEMixin) + ) + + def update_fn(self, *, x, t, batch_idx) -> SampleAndMean: + assert self.score_fn is not None, "Did you mean to use step_given_score?" + for _ in range(self.n_steps): + score = self.score_fn(x, t, batch_idx) + x, x_mean = self.step_given_score( + x=x, + batch_idx=batch_idx, + score=score, + t=t, + ) + + return x, x_mean + + def get_alpha(self, t: torch.FloatTensor) -> torch.Tensor: + sde = self.corruption + + if isinstance(sde, VPSDE): + alpha = 1 - sde.beta(t) * sde.T / 1000 + else: + alpha = torch.ones_like(t) + return alpha + + def step_given_score(self, *, x, batch_idx: torch.LongTensor | None, score, t) -> SampleAndMean: + alpha = self.get_alpha(t) + snr = self.snr + noise = torch.randn_like(score) + grad_norm_square = torch.square(score).reshape(score.shape[0], -1).sum(dim=1) + noise_norm_square = torch.square(noise).reshape(noise.shape[0], -1).sum(dim=1) + if batch_idx is None: + grad_norm = grad_norm_square.sqrt().mean() + noise_norm = noise_norm_square.sqrt().mean() + else: + grad_norm = torch.sqrt(scatter_add(grad_norm_square, dim=-1, index=batch_idx)).mean() + + noise_norm = torch.sqrt(scatter_add(noise_norm_square, dim=-1, index=batch_idx)).mean() + + # If gradient is zero (i.e., we are sampling from an improper distribution that's flat over the whole of R^n) + # the step_size blows up. Clip step_size to avoid this. + # The EGNN reports zero scores when there are no edges between nodes. + step_size = (snr * noise_norm / grad_norm) ** 2 * 2 * alpha + step_size = torch.minimum(step_size, self.max_step_size) + step_size[grad_norm == 0, :] = self.max_step_size + + # Expand step size to batch structure (score and noise have the same shape). + step_size = maybe_expand(step_size, batch_idx, score) + + # Perform update, using custom update for SO(3) diffusion on frames. + mean = x + step_size * score + x = mean + torch.sqrt(step_size * 2) * noise + + return x, mean diff --git a/data/mattergen/diffusion/score_models/__init__.py b/data/mattergen/diffusion/score_models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/score_models/base.py b/data/mattergen/diffusion/score_models/base.py new file mode 100644 index 0000000000000000000000000000000000000000..a70a791bffc3631021ec7131f77179ce9a2ec6a4 --- /dev/null +++ b/data/mattergen/diffusion/score_models/base.py @@ -0,0 +1,23 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import abc +from typing import Generic, TypeVar + +import torch + +from mattergen.diffusion.data.batched_data import BatchedData + +Diffusable = TypeVar("Diffusable", bound=BatchedData) + + +class ScoreModel(torch.nn.Module, Generic[Diffusable], abc.ABC): + """Abstract base class for score models.""" + + @abc.abstractmethod + def forward(self, x: Diffusable, t: torch.Tensor) -> Diffusable: + """Args: + x: batch of noisy data + t: timestep. Shape (batch_size, 1) + """ + ... diff --git a/data/mattergen/diffusion/tests/__init__.py b/data/mattergen/diffusion/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/tests/conftest.py b/data/mattergen/diffusion/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..4deb8a198dd542449b200313e1501cadf5b77459 --- /dev/null +++ b/data/mattergen/diffusion/tests/conftest.py @@ -0,0 +1,120 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import random +from typing import Dict, List + +import numpy +import pytest +import torch + +from mattergen.diffusion.corruption.corruption import Corruption +from mattergen.diffusion.corruption.d3pm_corruption import D3PMCorruption +from mattergen.diffusion.corruption.sde_lib import SDE, VESDE, VPSDE +from mattergen.diffusion.data.batched_data import BatchedData, SimpleBatchedData, collate_fn +from mattergen.diffusion.sampling import predictors +from mattergen.diffusion.sampling import predictors_correctors as pc +from mattergen.diffusion.wrapped.wrapped_predictors_correctors import ( + WrappedAncestralSamplingPredictor, + WrappedLangevinCorrector, +) +from mattergen.diffusion.wrapped.wrapped_sde import WrappedVESDE, WrappedVPSDE + +SDE_TYPES = [ + VPSDE, + VESDE, + WrappedVPSDE, + WrappedVESDE, +] +DISCRETE_CORRUPTION_TYPES = [D3PMCorruption] +CORRUPTION_TYPES = SDE_TYPES + DISCRETE_CORRUPTION_TYPES + +DEFAULT_PREDICTORS = [ + predictors.AncestralSamplingPredictor, +] +WRAPPED_PREDICTORS = [WrappedAncestralSamplingPredictor] +WRAPPED_CORRECTORS = [WrappedLangevinCorrector] +DEFAULT_CORRECTORS = [ + pc.LangevinCorrector, +] + +DummyState = Dict[str, torch.Tensor] + + +def seed_all(seed): + """Set the seed of all computational frameworks.""" + random.seed(seed) + numpy.random.seed(seed) + torch.manual_seed(seed) + torch.cuda.manual_seed_all(seed) + + +@pytest.fixture(autouse=True) +def seed_random_state(seed: int = 42): + """ + Fixture for seeding random states of every unit test. Is invoked automatically before each test. + + Args: + seed (int, optional): Random seed. Defaults to 42. + """ + seed_all(seed) + yield + + +@pytest.fixture +def EPS(): + return 1e-5 + + +def dummy_score_fn(batch: SimpleBatchedData, t: torch.Tensor, train: bool) -> SimpleBatchedData: + return batch.replace(**{k: torch.ones_like(batch[k]) for k in batch.data}) + + +@pytest.fixture +def diffusion_mocks(): + class Mocks: + DummyState = DummyState + dummy_score_fn = dummy_score_fn + + return Mocks + + +@pytest.fixture(scope="function") +def make_state_batch(): + def make_batch(sde_type): + return collate_fn([_make_sample(i) for i in range(0, 10)]) + + return make_batch + + +@pytest.fixture(scope="function") +def tiny_state_batch() -> BatchedData: + return collate_fn([_make_sample(i) for i in range(0, 10)]) + + +def _make_sample(bigness) -> DummyState: + foo_per_sample = 3 * (bigness + 1) + bar_per_sample = 1 * (bigness + 1) + + return dict(foo=torch.randn(foo_per_sample, 3), bar=torch.randn(bar_per_sample, 4)) + + +@pytest.fixture +def get_multi_corruption(): + from mattergen.diffusion.corruption.multi_corruption import MultiCorruption + + def factory(corruption_type, keys: List[str]): + discrete_corruptions = { + k: corruption_type() + for k in keys + if issubclass(corruption_type, Corruption) and not issubclass(corruption_type, SDE) + } + sdes = {k: corruption_type() for k in keys if issubclass(corruption_type, SDE)} + return MultiCorruption(sdes=sdes, discrete_corruptions=discrete_corruptions) + + return factory + + +@pytest.fixture +def dummy_state() -> DummyState: + return _make_sample(3) diff --git a/data/mattergen/diffusion/tests/data/__init__.py b/data/mattergen/diffusion/tests/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/tests/data/test_batched_data.py b/data/mattergen/diffusion/tests/data/test_batched_data.py new file mode 100644 index 0000000000000000000000000000000000000000..cc8bf66ca7b3d50142a214ddb52ddfa867ecafa6 --- /dev/null +++ b/data/mattergen/diffusion/tests/data/test_batched_data.py @@ -0,0 +1,33 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import torch + +from mattergen.diffusion.data.batched_data import collate_fn + + +def test_collate_fn(): + """Collate two pieces of data""" + data1 = {"a": torch.tensor([1, 2, 3, 4]), "b": torch.tensor([[1, 2, 3]]), "name": "data1"} + data2 = {"a": torch.tensor([10, 11]), "b": torch.tensor([[10, 11, 12]]), "name": "data2"} + collated = collate_fn([data1, data2], dense_field_names=["b"]) + assert collated["a"].tolist() == [1, 2, 3, 4, 10, 11] + assert collated["b"].tolist() == [[1, 2, 3], [10, 11, 12]] + assert collated["name"] == ["data1", "data2"] + assert collated.get_batch_idx("a").tolist() == [0, 0, 0, 0, 1, 1] + assert collated.get_batch_idx("b") is None + assert collated.get_batch_idx("name") is None + + +def test_to_data_list(): + """Collate and then unpack two pieces of data.""" + data1 = {"a": torch.tensor([1, 2, 3, 4]), "b": torch.tensor([[1, 2, 3]]), "name": "data1"} + data2 = {"a": torch.tensor([10, 11]), "b": torch.tensor([[10, 11, 12]]), "name": "data2"} + collated = collate_fn([data1, data2], dense_field_names=["b"]) + data_list = collated.to_data_list() + assert data_list[0]["a"].tolist() == [1, 2, 3, 4] + assert data_list[0]["b"].tolist() == [[1, 2, 3]] + assert data_list[0]["name"] == "data1" + assert data_list[1]["a"].tolist() == [10, 11] + assert data_list[1]["b"].tolist() == [[10, 11, 12]] + assert data_list[1]["name"] == "data2" diff --git a/data/mattergen/diffusion/tests/test_d3pm.py b/data/mattergen/diffusion/tests/test_d3pm.py new file mode 100644 index 0000000000000000000000000000000000000000..7b8940d27df42a67aa035ea929551b1cc4c572ef --- /dev/null +++ b/data/mattergen/diffusion/tests/test_d3pm.py @@ -0,0 +1,318 @@ +# Copyright (c) 2022 The Google Research Authors +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# from https://github.com/google-research/google-research/blob/master/d3pm/text/diffusion_test.py +# Keeping the original copyright notice +# Changes +# * adapt code style +# * Jax -> PyTorch +# * Remove Diffusion types that are not used by MatterGen +# # coding=utf-8 +# Copyright 2022 The Google Research Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tests for d3pm.py.""" +import functools + +import numpy as np +import pytest +import torch + +from mattergen.diffusion.d3pm import d3pm as diffusion + + +@pytest.mark.parametrize("schedule_kind", ["linear", "standard", "cosine"]) +def test_prior_kl(schedule_kind: str): + """Test the prior KL computation.""" + + schedule = diffusion.create_discrete_diffusion_schedule( + kind=schedule_kind, + beta_min=1e-3, + beta_max=1e-1, + num_steps=1000, + ) + + dim = 100 + num_samples = 71 + x_in = torch.randint(0, dim, size=(num_samples,)) + diff = diffusion.MaskDiffusion(dim=dim + 1, schedule=schedule) + prior_kl = diffusion.compute_prior_kl(x_in, diff) + assert torch.isclose(prior_kl, torch.tensor(0.0), atol=1e-5) + + +def test_product_the_hard_way(): + """Tests that the discrete transition matrices computed via q(x_t | x_0) and q(x_t|x_{t-1}) are equivalent + for t in {0, 1}. Uses the slow iterative method of computing the transition matrix q(x_t | x_0). + """ + schedule = diffusion.create_discrete_diffusion_schedule( + kind="linear", + beta_min=1e-3, + beta_max=1e-3, + num_steps=100, + ) + + diff = diffusion.MaskDiffusion(dim=100, schedule=schedule, use_fast_inference=False) + + assert not diff.supports_efficient_inference() + + product = diff.get_qt_matrix(torch.tensor(0)) + np.testing.assert_array_almost_equal(product, torch.eye(100)) + + product = diff.get_qt_matrix(torch.tensor(1)[None]) + np.testing.assert_array_almost_equal(product, diff.get(torch.tensor(0))) + + +def test_product_fast(): + """Tests that the discrete transition matrices computed via q(x_t | x_0) and q(x_t|x_{t-1}) are equivalent + for t in {0, 1}. Uses the fast closed-form method of computing the transition matrix q(x_t | x_0). + """ + schedule = diffusion.create_discrete_diffusion_schedule( + kind="linear", + beta_min=1e-3, + beta_max=1e-3, + num_steps=100, + ) + + diff = diffusion.MaskDiffusion(dim=100, schedule=schedule, use_fast_inference=True) + + assert diff.supports_efficient_inference() + + product = diff.get_qt_matrix(torch.tensor(0)) + np.testing.assert_array_almost_equal(product, torch.eye(100)) + + product = diff.get_qt_matrix(torch.tensor(1)) + np.testing.assert_array_almost_equal(product, diff.get(torch.tensor(0))) + + +def test_product_constant(): + """Tests, when we have a constant beta schedule (transition probabilities don't change over time), + whether the transition matrices computed via q(x_t | x_0) and q(x_t|x_{t-1}), and via explicit matrix + multiplication are equivalent.""" + schedule = diffusion.create_discrete_diffusion_schedule( + kind="linear", + beta_min=1e-3, + beta_max=1e-3, + num_steps=100, + ) + + diff = diffusion.MaskDiffusion(dim=100, schedule=schedule) + + assert diff.supports_efficient_inference() + + product = diff.get_qt_matrix(0) + np.testing.assert_array_almost_equal(product, torch.eye(100)) + + product = diff.get_qt_matrix(1) + np.testing.assert_array_almost_equal(product, diff.get(torch.tensor(0))) + + product = diff.get_qt_matrix(10) + expected = np.linalg.matrix_power(diff.get(torch.tensor(0)), 10) + np.testing.assert_array_almost_equal(product, expected) + + +def test_sample_and_posterior(): + """Tests whether the samples and posterior are as expected when providing timestep 0 for the sampling.""" + + schedule = diffusion.create_discrete_diffusion_schedule( + kind="linear", + beta_min=1e-3, + beta_max=1e-3, + num_steps=100, + ) + + diff = diffusion.MaskDiffusion(dim=100, schedule=schedule) + + inputs = torch.ones((1,), dtype=torch.long) + + probs, sample = diff.sample_and_compute_posterior_q( + inputs, torch.tensor([0]), return_logits=False + ) + + assert probs.shape == (1, 100) + assert torch.allclose(probs[0, 1], torch.tensor(1.0), atol=1e-5) + + assert sample.shape == (1,) + np.testing.assert_array_equal(sample, np.array([1])) + + +def test_compute_posterior(): + """Tests that the forward diffusion probabilities are correct for t=0.""" + + schedule = diffusion.create_discrete_diffusion_schedule( + kind="linear", + beta_min=1e-3, + beta_max=1e-3, + num_steps=100, + ) + + diff = diffusion.MaskDiffusion(dim=100, schedule=schedule) + + inputs = torch.ones((2,), dtype=torch.long) + q_t = diff.get_qt_given_q0(inputs, torch.tensor([0, 0]), make_one_hot=True) + + assert q_t.shape == (2, 100) + assert torch.allclose((q_t[0][1]), torch.tensor(1.0)) + assert torch.allclose((q_t[0][0]), torch.tensor(0.0)) + + +def test_model(): + """Test the Diffusion noise diffusion.""" + schedule = diffusion.create_discrete_diffusion_schedule( + kind="standard", + beta_min=1e-3, + beta_max=1e-3, + num_steps=100, + ) + dim = 100 + length = 100 + x0 = torch.randint(0, dim, (length,)) + diff = diffusion.MaskDiffusion(dim=100, schedule=schedule) + if hasattr(diffusion, "get"): + np.testing.assert_allclose(diff.get(0).sum(0), 1.0, rtol=1e-6) + np.testing.assert_allclose(diff.get(10).sum(0), 1.0, rtol=1e-6) + np.testing.assert_allclose(diff.get(99).sum(0), 1.0, rtol=1e-6) + np.testing.assert_allclose(diff.get_qt_matrix(0), torch.eye(100), rtol=1e-6) + expected = torch.eye(dim)[x0] + result = diff.get_qt_given_q0(q0=x0, t=torch.tensor([0]), make_one_hot=True) + np.testing.assert_allclose(result, expected) + expected = torch.randn((length, dim)).softmax(-1) + result = diff.get_qt_given_q0(q0=expected, t=torch.tensor([0]), make_one_hot=False) + np.testing.assert_allclose(result, expected) + q0 = torch.randn((length, dim)).softmax(-1) + result = diff.get_qt_given_q0(q0=q0, t=torch.tensor([0]), make_one_hot=False) + np.testing.assert_allclose(result.sum(axis=-1), 1.0, rtol=1e-6) + expected = diff.stationary_probs(x0.shape) + result = diff.get_qt_given_q0(q0=x0, t=torch.tensor([100]), make_one_hot=True) + np.testing.assert_allclose(result, expected) + + +def test_mask_diffusion(): + """Test the Diffusion noise diffusion.""" + schedule = diffusion.create_discrete_diffusion_schedule( + kind="linear", + beta_min=1e-3, + beta_max=1e-1, + num_steps=100, + ) + diff = diffusion.MaskDiffusion(dim=100, schedule=schedule) + np.testing.assert_allclose(diff.get(torch.tensor(0)).sum(0), 1.0, rtol=1e-6) + np.testing.assert_allclose(diff.get(torch.tensor(10)).sum(0), 1.0, rtol=1e-6) + np.testing.assert_allclose(diff.get(torch.tensor(0))[0, 0], 1.0 - schedule(0), rtol=1e-6) + np.testing.assert_allclose(diff.get(torch.tensor(1))[0, 0], 1.0 - schedule(1), rtol=1e-6) + np.testing.assert_allclose(diff.get_qt_matrix(0), torch.eye(100), rtol=1e-6) + + +def test_mask_diffusion_slow_and_fast(): + """Compares fast and slow inference for mask diffusion.""" + schedule = diffusion.create_discrete_diffusion_schedule( + kind="standard", + beta_min=5e-4, + beta_max=5e-2, + num_steps=100, + ) + dim = 16 + length = 16 + fast_diff = diffusion.MaskDiffusion(dim=dim, schedule=schedule, use_fast_inference=True) + slow_diff = diffusion.MaskDiffusion(dim=dim, schedule=schedule, use_fast_inference=False) + x0 = torch.randint(0, dim, (length,)) + for _t in range(100): + t = torch.tensor([_t]).expand_as(x0) + _t_item = torch.tensor(_t) + qt_slow = slow_diff.get_qt_matrix(_t_item) + qt_fast = fast_diff.get_qt_matrix(t) + np.testing.assert_array_almost_equal(qt_slow, qt_fast, decimal=3) + qt_slow = slow_diff.get_qt_given_q0(q0=x0, t=t, make_one_hot=True) + qt_fast = fast_diff.get_qt_given_q0(q0=x0, t=t, make_one_hot=True) + np.testing.assert_array_almost_equal(qt_slow, qt_fast, decimal=3) + np.testing.assert_array_almost_equal(qt_slow.sum(axis=-1), 1.0, decimal=3) + np.testing.assert_array_almost_equal(qt_fast.sum(axis=-1), 1.0, decimal=3) + torch.manual_seed(234) + posterior_slow, samples_slow = slow_diff.sample_and_compute_posterior_q( + x_0=x0, t=t, make_one_hot=True + ) + torch.manual_seed(234) + posterior_fast, samples_fast = fast_diff.sample_and_compute_posterior_q( + x_0=x0, t=t, make_one_hot=True + ) + np.testing.assert_array_almost_equal(posterior_slow, posterior_fast, decimal=3) + np.testing.assert_array_equal(samples_slow, samples_fast) + t_100 = torch.tensor([100]).expand_as(x0) + qt = fast_diff.get_qt_given_q0(q0=x0, t=t_100, make_one_hot=True) + np.testing.assert_allclose( + qt, torch.eye(dim)[torch.full(x0.shape, fill_value=dim - 1)], rtol=1e-6 + ) + qt = slow_diff.get_qt_given_q0(q0=x0, t=t_100, make_one_hot=True) + np.testing.assert_allclose( + qt, torch.eye(dim)[torch.full(x0.shape, fill_value=dim - 1)], rtol=1e-6 + ) + + +def test_large_matrices(): + """Tests precision for large matrices.""" + dim = 1000 + length = 64 + x0 = torch.randint(0, dim, (length,)) + schedule = diffusion.create_discrete_diffusion_schedule( + kind="linear", + beta_min=5e-4, + beta_max=5e-2, + num_steps=100, + ) + diff = diffusion.MaskDiffusion(dim, schedule, use_fast_inference=True) + fn = functools.partial(diff.get_qt_given_q0, make_one_hot=True) + result = fn(x0, torch.tensor([100])) + np.testing.assert_array_almost_equal(result.sum(axis=-1), 1.0) + + +def test_loss_computation(): + """Tests whether the loss computation uses the right terms (KL / cross-entropy) and broadcasts correctly.""" + torch.manual_seed(234) + num_steps = 100 + num_classes = 7 + hybrid_lambda = 0.0 + schedule = diffusion.create_discrete_diffusion_schedule( + kind="linear", + beta_min=1e-3, + beta_max=1e-3, + num_steps=num_steps, + ) + t = torch.arange(0, 100) + diff = diffusion.MaskDiffusion(dim=num_classes, schedule=schedule) + inputs = torch.ones((num_steps,), dtype=torch.long) + q_t_minus_one, x_t_samples = diff.sample_and_compute_posterior_q( + inputs, t, make_one_hot=True, return_logits=True + ) + + # Ground-truth denoising function + def denoise_fn(targets, timestep): + return q_t_minus_one + + loss_dict = diffusion.compute_kl_reverse_process( + x_start=inputs, + t=t, + x_t_plus_1=x_t_samples, + diffusion=diff, + denoise_fn=denoise_fn, + predict_x0=False, + hybrid_lambda=hybrid_lambda, + ) + loss = loss_dict.pop("loss") + kl_loss = loss_dict.pop("kl/kl_loss") + cross_entropy_loss = loss_dict.pop("kl/cross_entropy_loss") + assert loss.shape == t.shape + # KL loss should be the same as the loss for all timesteps except the first one, where cross-entropy is used. + assert torch.allclose(kl_loss[1:], loss[1:]) + assert torch.allclose(cross_entropy_loss[:1], loss[:1]) + assert torch.allclose(kl_loss, torch.zeros_like(kl_loss), atol=1e-6) diff --git a/data/mattergen/diffusion/tests/test_data_utils.py b/data/mattergen/diffusion/tests/test_data_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..5bbc67d19eef8905711410f55757b6a916dec4a1 --- /dev/null +++ b/data/mattergen/diffusion/tests/test_data_utils.py @@ -0,0 +1,53 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import torch + +from mattergen.diffusion.data.batched_data import SimpleBatchedData, _batch_edge_index, collate_fn + + +def test_collate_fn(): + state1 = dict(foo=torch.ones(2, 3), bar=torch.ones(5, 2)) + state2 = dict(foo=torch.zeros(3, 3), bar=torch.zeros(2, 2)) + batch = collate_fn([state1, state2]) + + field_names = list(state1.keys()) + + expected = SimpleBatchedData( + data=dict( + foo=torch.Tensor( + [ + [1.0, 1.0, 1.0], + [1.0, 1.0, 1.0], + [0.0, 0.0, 0.0], + [0.0, 0.0, 0.0], + [0.0, 0.0, 0.0], + ] + ), + bar=torch.Tensor( + [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0], [1.0, 1.0], [1.0, 1.0], [0.0, 0.0], [0.0, 0.0]] + ), + ), + batch_idx={ + "foo": torch.tensor([0, 0, 1, 1, 1], dtype=torch.long), + "bar": torch.tensor([0, 0, 0, 0, 0, 1, 1], dtype=torch.long), + }, + ) + + for k in field_names: + assert torch.equal(batch[k], expected[k]) + assert torch.equal(batch.get_batch_idx(k), expected.get_batch_idx(k)) + + assert batch.get_batch_size() == 2 + + +def test_batch_edge_index(): + edge_index = torch.tensor( + [[0, 1], [0, 2], [1, 2], [0, 1], [0, 3], [1, 2], [2, 3], [0, 1], [1, 3]] + ) + atom_batch_idx = torch.tensor([0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2]) + edge_batch_idx = torch.tensor([0, 0, 0, 1, 1, 1, 1, 2, 2]) + torch.testing.assert_close( + _batch_edge_index(edge_index, atom_batch_idx, edge_batch_idx), + torch.tensor([[0, 1], [0, 2], [1, 2], [2, 3], [2, 5], [3, 4], [4, 5], [7, 8], [8, 10]]), + ) diff --git a/data/mattergen/diffusion/tests/test_losses.py b/data/mattergen/diffusion/tests/test_losses.py new file mode 100644 index 0000000000000000000000000000000000000000..fc5a7e5dfe007f1e3c13be4fa79a0c9d3f9e7ab8 --- /dev/null +++ b/data/mattergen/diffusion/tests/test_losses.py @@ -0,0 +1,205 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from functools import partial +from typing import Dict, List, Type + +import pytest +import torch + +from mattergen.diffusion.corruption.corruption import Corruption +from mattergen.diffusion.corruption.multi_corruption import MultiCorruption, apply +from mattergen.diffusion.corruption.sde_lib import SDE +from mattergen.diffusion.data.batched_data import SimpleBatchedData +from mattergen.diffusion.losses import DenoisingScoreMatchingLoss +from mattergen.diffusion.tests.conftest import SDE_TYPES +from mattergen.diffusion.training.field_loss import ( + aggregate_per_sample, + compute_noise_given_sample_and_corruption, +) +from mattergen.diffusion.wrapped.wrapped_normal_loss import wrapped_normal_loss +from mattergen.diffusion.wrapped.wrapped_sde import WrappedVESDE + + +def get_multi_corruption(corruption_type, keys: List[str]): + discrete_corruptions = { + k: corruption_type() + for k in keys + if issubclass(corruption_type, Corruption) and not issubclass(corruption_type, SDE) + } + sdes = {k: corruption_type() for k in keys if issubclass(corruption_type, SDE)} + return MultiCorruption(sdes=sdes, discrete_corruptions=discrete_corruptions) + + +@pytest.mark.parametrize("corruption_type", SDE_TYPES) +def test_calc_loss(tiny_state_batch, corruption_type: Type[Corruption]): + """Check that calc_loss returns expected values for a few examples.""" + + clean_batch = tiny_state_batch + multi_corruption = get_multi_corruption(corruption_type=corruption_type, keys=["foo", "bar"]) + + t = torch.ones(clean_batch.get_batch_size()) + noisy_batch = multi_corruption.sample_marginal(batch=clean_batch, t=t) + + raw_noise = apply( + {k: compute_noise_given_sample_and_corruption for k in multi_corruption.corrupted_fields}, + x=clean_batch, + x_noisy=noisy_batch, + corruption=multi_corruption.corruptions, + batch_idx=clean_batch.batch_idx, + broadcast={"t": t, "batch": clean_batch}, + ) + + zero_scores = {k: torch.zeros_like(v) for k, v in clean_batch.data.items()} + calc_loss = partial( + DenoisingScoreMatchingLoss( + model_targets={"foo": "score_times_std"}, + ), + multi_corruption=multi_corruption, + t=t, + batch=clean_batch, + ) + + score_model_output = SimpleBatchedData(data=zero_scores, batch_idx=clean_batch.batch_idx) + loss, _ = calc_loss(score_model_output=score_model_output, noisy_batch=noisy_batch) + target_loss = aggregate_per_sample( + raw_noise["foo"].pow(2), + batch_idx=clean_batch.batch_idx["foo"], + reduce="mean", + batch_size=clean_batch.get_batch_size(), + ).mean() + torch.testing.assert_allclose(loss, target_loss) + + # Errors in bar should not affect the loss, only foo. + score_model_output = score_model_output.replace(bar=score_model_output["bar"] + 100) + + loss_with_bad_bar, _ = calc_loss(score_model_output=score_model_output, noisy_batch=noisy_batch) + + torch.testing.assert_allclose(loss, loss_with_bad_bar) + + # Increasing error in foo should increase the loss; doubling raw noise leads to 4x loss. + raw_noise.update(foo=raw_noise["foo"] * 2) + mean, std = multi_corruption.corruptions["foo"].marginal_prob( + x=clean_batch["foo"], + t=t[clean_batch.batch_idx["foo"]], + batch_idx=clean_batch.batch_idx["foo"], + batch=clean_batch, + ) + noisy_batch = clean_batch.replace(foo=raw_noise["foo"] * std + mean) + loss, _ = calc_loss(score_model_output=score_model_output, noisy_batch=noisy_batch) + torch.testing.assert_allclose( + loss, + target_loss * 4, + ) + + +@pytest.mark.parametrize("corruption_type", SDE_TYPES) +def test_weighted_summed_field_loss( + tiny_state_batch, + corruption_type: Type[Corruption], +): + """Check that SummedFieldLoss returns expected values for a few examples.""" + + clean_batch = tiny_state_batch + multi_corruption = get_multi_corruption( + corruption_type=corruption_type, + keys=[ + "foo", + "bar", + ], + ) + zero_scores = {k: torch.zeros_like(v) for k, v in clean_batch.data.items()} + score_model_output = SimpleBatchedData(data=zero_scores, batch_idx=clean_batch.batch_idx) + t = torch.ones(clean_batch.get_batch_size()) + noisy_batch = multi_corruption.sample_marginal(batch=clean_batch, t=t) + + weights = { + "foo": 1.0, + "bar": 2.9, + } + model_targets: Dict[str, str] = { + k: "score_times_std" for k in multi_corruption.corrupted_fields + } + unweighted_loss_fn = DenoisingScoreMatchingLoss(model_targets=model_targets) + weighted_loss_fn = DenoisingScoreMatchingLoss( + weights=weights, + model_targets=model_targets, + ) + + unweighted_loss, unweighted_loss_per_field = unweighted_loss_fn( + batch=clean_batch, + multi_corruption=multi_corruption, + t=t, + score_model_output=score_model_output, + noisy_batch=noisy_batch, + ) + weighted_loss, weighted_loss_per_field = weighted_loss_fn( + batch=clean_batch, + multi_corruption=multi_corruption, + t=t, + score_model_output=score_model_output, + noisy_batch=noisy_batch, + ) + torch.testing.assert_allclose( + weighted_loss, + unweighted_loss_per_field["foo"] * weights["foo"] + + unweighted_loss_per_field["bar"] * weights["bar"], + ) + torch.testing.assert_allclose( + torch.stack([unweighted_loss_per_field[k] for k in unweighted_loss_per_field.keys()]), + torch.stack([weighted_loss_per_field[k] for k in weighted_loss_per_field.keys()]), + ) + torch.testing.assert_allclose(sum(weighted_loss_per_field.values()), unweighted_loss) + + +def test_wrapped_normal_loss(tiny_state_batch): + # Simulate the case that wrapping has basically no effect and the loss is equivalent to DenoisingScoreMatchingLoss + clean_batch = tiny_state_batch.replace( + foo=tiny_state_batch["foo"] + 500, bar=tiny_state_batch["bar"][:, :3] + 500 + ) + fields = ["foo", "bar"] + multi_corruption: MultiCorruption = MultiCorruption( + sdes={k: WrappedVESDE(wrapping_boundary=1000.0, sigma_max=1.0) for k in fields} + ) + model_targets = {k: "score_times_std" for k in fields} + zero_scores = {k: torch.zeros_like(v) for k, v in clean_batch.data.items()} + score_model_output = SimpleBatchedData(data=zero_scores, batch_idx=clean_batch.batch_idx) + t = torch.rand(clean_batch.get_batch_size()) + noisy_batch = multi_corruption.sample_marginal(batch=clean_batch, t=t) + wrapped_loss_foo = wrapped_normal_loss( + corruption=multi_corruption.sdes["foo"], + score_model_output=score_model_output["foo"], + t=t, + batch_idx=clean_batch.get_batch_idx("foo"), + batch_size=clean_batch.get_batch_size(), + x=clean_batch["foo"], + noisy_x=noisy_batch["foo"], + batch=clean_batch, + reduce="mean", + ).mean() + wrapped_loss_bar = wrapped_normal_loss( + corruption=multi_corruption.sdes["bar"], + score_model_output=score_model_output["bar"], + t=t, + batch_idx=clean_batch.get_batch_idx("bar"), + batch_size=clean_batch.get_batch_size(), + x=clean_batch["bar"], + noisy_x=noisy_batch["bar"], + batch=clean_batch, + reduce="mean", + ).mean() + wrapped_loss = {"foo": wrapped_loss_foo, "bar": wrapped_loss_bar} + non_wrapped_loss_fn = DenoisingScoreMatchingLoss( + model_targets=model_targets, + ) + _, non_wrapped_loss_per_field = non_wrapped_loss_fn( + batch=clean_batch, + multi_corruption=multi_corruption, + t=t, + score_model_output=score_model_output, + noisy_batch=noisy_batch, + ) + torch.testing.assert_allclose( + torch.stack([wrapped_loss[k] for k in wrapped_loss.keys()]), + torch.stack([non_wrapped_loss_per_field[k] for k in non_wrapped_loss_per_field.keys()]), + ) diff --git a/data/mattergen/diffusion/tests/test_model_utils.py b/data/mattergen/diffusion/tests/test_model_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..2bce0a3147167d7998378bf33f156a52c39244e7 --- /dev/null +++ b/data/mattergen/diffusion/tests/test_model_utils.py @@ -0,0 +1,30 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from functools import partial + +import pytest +import torch + +from mattergen.diffusion.model_target import ModelTarget +from mattergen.diffusion.model_utils import convert_model_out_to_score +from mattergen.diffusion.tests.conftest import SDE_TYPES + + +@pytest.mark.parametrize("sde_type", SDE_TYPES) +def test_conversions_match(sde_type): + """Check that we get the same score whether the model output is interpreted as prediction of clean data, noise, or minus noise.""" + sde = sde_type() + t = torch.linspace(0.1, 0.9, 10) + clean = torch.randn(10, 3) + z = torch.randn_like(clean) + _, std = sde.marginal_prob(x=clean, t=t, batch_idx=torch.arange(10), batch=None) + _convert = partial( + convert_model_out_to_score, + sde=sde, + batch_idx=torch.arange(10), + t=t, + batch=None, + ) + score1 = _convert(model_target=ModelTarget.score_times_std, model_out=-z) + assert torch.allclose(score1, -z / std, atol=1e-4) # slack tolerance for this test diff --git a/data/mattergen/diffusion/tests/test_multi_corruption.py b/data/mattergen/diffusion/tests/test_multi_corruption.py new file mode 100644 index 0000000000000000000000000000000000000000..c32d5a1c481cfd3b642f8beab9012858f9cd7863 --- /dev/null +++ b/data/mattergen/diffusion/tests/test_multi_corruption.py @@ -0,0 +1,35 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Any, Dict, Type + +import pytest +import torch + +from mattergen.diffusion.corruption.multi_corruption import MultiCorruption +from mattergen.diffusion.corruption.sde_lib import SDE +from mattergen.diffusion.tests.conftest import SDE_TYPES + + +# .sde() is only defined for continuous corruptions, hence we only test SDEs here (and not discrete corruptions) +@pytest.mark.parametrize("corruption_type", SDE_TYPES) +def test_multi_corruption( + corruption_type: Type[SDE], tiny_state_batch, diffusion_mocks, get_multi_corruption +): + multi_corruption = get_multi_corruption(corruption_type=corruption_type, keys=["foo", "bar"]) + t = torch.rand(tiny_state_batch.get_batch_size()) + + _check_keys_shapes(multi_corruption=multi_corruption, batch=tiny_state_batch, t=t) + + +def _check_keys_shapes(multi_corruption: MultiCorruption, batch, t: torch.Tensor): + drifts_diffusions = multi_corruption.sde(batch=batch, t=t) + _assert_keys(drifts_diffusions) + + for k, (drift, diffusion) in drifts_diffusions.items(): + assert drift.shape == batch[k].shape + assert diffusion.shape[0] == batch[k].shape[0] + + +def _assert_keys(d: Dict[str, Any]): + assert set(d.keys()) == {"foo", "bar"} diff --git a/data/mattergen/diffusion/tests/test_reverse_sampling.py b/data/mattergen/diffusion/tests/test_reverse_sampling.py new file mode 100644 index 0000000000000000000000000000000000000000..3c653b1b2691855ca13ede0922714c9e385fc03c --- /dev/null +++ b/data/mattergen/diffusion/tests/test_reverse_sampling.py @@ -0,0 +1,169 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +""" +This is an integeratation test of reverse sampling. For a known data distribution that +is Gaussian, we substitute the known ground truth score for an approximate model +prediction and reverse sample to check we retrieve correct moments of the data distribution. +""" + +from argparse import Namespace +from contextlib import nullcontext +from functools import partial +from typing import List, Type + +import pytest +import torch + +from mattergen.diffusion.corruption.multi_corruption import MultiCorruption +from mattergen.diffusion.corruption.sde_lib import SDE +from mattergen.diffusion.data.batched_data import BatchedData, SimpleBatchedData +from mattergen.diffusion.diffusion_module import DiffusionModule +from mattergen.diffusion.exceptions import IncompatibleSampler +from mattergen.diffusion.model_target import ModelTarget +from mattergen.diffusion.sampling.pc_sampler import PredictorCorrector +from mattergen.diffusion.tests.conftest import ( + DEFAULT_CORRECTORS, + DEFAULT_PREDICTORS, + SDE_TYPES, + WRAPPED_CORRECTORS, + WRAPPED_PREDICTORS, +) +from mattergen.diffusion.tests.test_sampling import INCOMPATIBLE_SAMPLERS +from mattergen.diffusion.wrapped.wrapped_sde import WrappedVESDE, WrappedVPSDE + + +def score_given_xt( + x: BatchedData, + t: torch.Tensor, + multi_corruption: MultiCorruption, + x0_mean: torch.Tensor, + x0_std: torch.Tensor, +) -> BatchedData: + def _score_times_std(x_t: torch.Tensor, sde: SDE) -> torch.Tensor: + a_t, s_t = sde.marginal_prob(x=torch.ones_like(x_t), t=t) + mean = a_t * x0_mean + std = torch.sqrt(a_t**2 * x0_std**2 + s_t**2) + score_times_std = -(x_t - mean) / (std**2) * s_t + return score_times_std + + return x.replace( + **{ + k: _score_times_std(x_t=x[k], sde=multi_corruption.sdes[k]) + for k in multi_corruption.sdes.keys() + } + ) + + +def get_diffusion_module(x0_mean, x0_std, multi_corruption: MultiCorruption) -> DiffusionModule: + return DiffusionModule( + model=partial(score_given_xt, x0_mean=x0_mean, x0_std=x0_std, multi_corruption=multi_corruption), # type: ignore + corruption=multi_corruption, + loss_fn=Namespace( + model_targets={k: ModelTarget.score_times_std for k in multi_corruption.sdes.keys()} + ), # type: ignore + ) + + +predictor_corrector_pairs = [(p, None) for p in DEFAULT_PREDICTORS] + [ + (None, c) for c in DEFAULT_CORRECTORS +] + + +@pytest.mark.parametrize( + "predictor_type,corrector_type", + predictor_corrector_pairs, +) +@pytest.mark.parametrize("corruption_type", SDE_TYPES) +def test_reverse_sampling(corruption_type: Type, predictor_type: Type, corrector_type: Type): + N = 1000 if corrector_type is None else 200 + + if predictor_type is None and corrector_type is None: + # Nothing to be done here. + return + fields = ["x", "y", "z", "a"] + batch_size = 10_000 + x0_mean = torch.tensor(-3.0) + x0_std = torch.tensor(4.3) + + multi_corruption: MultiCorruption = MultiCorruption(sdes={f: corruption_type() for f in fields}) + + with pytest.raises(IncompatibleSampler) if predictor_type in INCOMPATIBLE_SAMPLERS[ + corruption_type + ] or corrector_type in INCOMPATIBLE_SAMPLERS[corruption_type] else nullcontext(): + multi_sampler = PredictorCorrector( + diffusion_module=get_diffusion_module( + multi_corruption=multi_corruption, x0_mean=x0_mean, x0_std=x0_std + ), + device=torch.device("cpu"), + predictor_partials={} if predictor_type is None else {k: predictor_type for k in fields}, # type: ignore + corrector_partials={} if corrector_type is None else {k: corrector_type for k in fields}, # type: ignore + n_steps_corrector=5, + N=N, + eps_t=0.001, + max_t=None, + ) + conditioning_data = _get_conditioning_data(batch_size=batch_size, fields=fields) + + samples, _ = multi_sampler.sample(conditioning_data=conditioning_data) + means = torch.tensor([samples[k].mean() for k in multi_corruption.corruptions.keys()]) + stds = torch.tensor([samples[k].std() for k in multi_corruption.corruptions.keys()]) + assert torch.isclose(means.mean(), x0_mean, atol=1e-1) + assert torch.isclose(stds.mean(), x0_std, atol=1e-1) + + +wrapped_pc_pairs = [(p, None) for p in WRAPPED_PREDICTORS] + [(None, c) for c in WRAPPED_CORRECTORS] + + +@pytest.mark.parametrize("predictor_type, corrector_type", wrapped_pc_pairs) +@pytest.mark.parametrize("sde_type", [WrappedVESDE, WrappedVPSDE]) +def test_wrapped_reverse_sampling(sde_type: Type, predictor_type: Type, corrector_type: Type): + if predictor_type is None and corrector_type is None: + # Nothing to be done here. + return + N = 50 + fields = ["x", "y", "z", "a"] + batch_size = 10_000 + x0_mean = torch.tensor(-2.0) + x0_std = torch.tensor(2.3) + wrapping_boundary = -2.4 + empirical_samples = torch.remainder( + torch.randn(batch_size) * x0_std + x0_mean, wrapping_boundary + ) + empirical_x0_mean = empirical_samples.mean() + empirical_x0_std = empirical_samples.std() + + multi_corruption: MultiCorruption = MultiCorruption( + sdes={k: sde_type(wrapping_boundary=wrapping_boundary) for k in fields} + ) + + predictor_partials = {} if predictor_type is None else {k: predictor_type for k in fields} + corrector_partials = {} if corrector_type is None else {k: corrector_type for k in fields} + + n_steps_corrector = 5 + + multi_sampler: PredictorCorrector = PredictorCorrector( + diffusion_module=get_diffusion_module( + x0_mean=x0_mean, x0_std=x0_std, multi_corruption=multi_corruption + ), + n_steps_corrector=n_steps_corrector, + predictor_partials=predictor_partials, # type: ignore + corrector_partials=corrector_partials, # type: ignore + device=None, + N=N, + ) + + conditioning_data = _get_conditioning_data(batch_size=batch_size, fields=fields) + (samples, _) = multi_sampler.sample(conditioning_data=conditioning_data, mask=None) + assert min(samples[k].min() for k in multi_corruption.corruptions.keys()) >= wrapping_boundary + assert max(samples[k].max() for k in multi_corruption.corruptions.keys()) <= 0.0 + means = torch.tensor([samples[k].mean() for k in multi_corruption.corruptions.keys()]) + stds = torch.tensor([samples[k].std() for k in multi_corruption.corruptions.keys()]) + assert torch.isclose(means.mean(), empirical_x0_mean, atol=1e-1) + assert torch.isclose(stds.mean(), empirical_x0_std, atol=1e-1) + + +def _get_conditioning_data(batch_size: int, fields: List[str]) -> SimpleBatchedData: + return SimpleBatchedData( + data={k: torch.randn(batch_size, 1) for k in fields}, batch_idx={k: None for k in fields} + ) diff --git a/data/mattergen/diffusion/tests/test_sampling.py b/data/mattergen/diffusion/tests/test_sampling.py new file mode 100644 index 0000000000000000000000000000000000000000..4e09e7ea75bbfb9de0c9f71e369cb8c9ef43cbc0 --- /dev/null +++ b/data/mattergen/diffusion/tests/test_sampling.py @@ -0,0 +1,113 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from collections import defaultdict +from contextlib import nullcontext +from typing import Callable, Dict, List, Type, Union + +import pytest +import torch + +from mattergen.diffusion.corruption.sde_lib import SDE, VESDE, VPSDE +from mattergen.diffusion.d3pm.d3pm_predictors_correctors import D3PMAncestralSamplingPredictor +from mattergen.diffusion.exceptions import IncompatibleSampler +from mattergen.diffusion.sampling import predictors_correctors as pc +from mattergen.diffusion.sampling.predictors import AncestralSamplingPredictor, Predictor +from mattergen.diffusion.tests.conftest import ( + DEFAULT_CORRECTORS, + DEFAULT_PREDICTORS, + SDE_TYPES, + WRAPPED_CORRECTORS, + WRAPPED_PREDICTORS, +) +from mattergen.diffusion.wrapped.wrapped_predictors_correctors import ( + WrappedAncestralSamplingPredictor, + WrappedLangevinCorrector, +) +from mattergen.diffusion.wrapped.wrapped_sde import WrappedVESDE, WrappedVPSDE + +D3PM_SAMPLERS = [ + D3PMAncestralSamplingPredictor, +] +INCOMPATIBLE_SAMPLERS: Dict[ + Type[SDE], List[Type[Union[Predictor, pc.LangevinCorrector]]] +] = defaultdict(list) +INCOMPATIBLE_SAMPLERS[VPSDE] = [ + WrappedLangevinCorrector, + WrappedAncestralSamplingPredictor, + *D3PM_SAMPLERS, +] +INCOMPATIBLE_SAMPLERS[VESDE] = [ + WrappedLangevinCorrector, + WrappedAncestralSamplingPredictor, + *D3PM_SAMPLERS, +] +INCOMPATIBLE_SAMPLERS[WrappedVPSDE] = [ + AncestralSamplingPredictor, + pc.LangevinCorrector, + *D3PM_SAMPLERS, +] +INCOMPATIBLE_SAMPLERS[WrappedVESDE] = [ + AncestralSamplingPredictor, + pc.LangevinCorrector, + *D3PM_SAMPLERS, +] + + +@pytest.mark.parametrize("predictor_type", DEFAULT_PREDICTORS + WRAPPED_PREDICTORS) +@pytest.mark.parametrize("sde_type", SDE_TYPES) +def test_predictor(make_state_batch: Callable, predictor_type: Type, sde_type, EPS: float): + """Tests whether implemented predictors return arrays of consistent + graph shape + """ + tiny_state_batch = make_state_batch(sde_type) + + with pytest.raises(IncompatibleSampler) if predictor_type in INCOMPATIBLE_SAMPLERS[ + sde_type + ] else nullcontext(): + sde = sde_type() + batch_size = tiny_state_batch.get_batch_size() + t = torch.rand(batch_size) * (sde.T - EPS) + EPS + + old_x: torch.Tensor = tiny_state_batch["foo"] + + pr: Predictor = predictor_type(corruption=sde, score_fn=dummy_score_fn) + dt = torch.tensor(-(sde.T - EPS) / 50) + x, x_mean = pr.update_fn( + x=old_x, + t=t, + dt=dt, + batch_idx=tiny_state_batch.get_batch_idx("foo"), + batch=tiny_state_batch, + ) + + assert x.shape == x_mean.shape == old_x.shape + + +def dummy_score_fn(x, t, batch_idx): + score = torch.zeros(*x.shape[:2]) + return score + + +@pytest.mark.parametrize("corrector_type", DEFAULT_CORRECTORS + WRAPPED_CORRECTORS) +@pytest.mark.parametrize("sde_type", SDE_TYPES) +def test_corrector(make_state_batch: Callable, corrector_type: Type, sde_type, EPS: float): + """Tests whether implemented correctors return arrays of consistent + graph shape + """ + tiny_state_batch = make_state_batch(sde_type) + + with pytest.raises(IncompatibleSampler) if corrector_type in INCOMPATIBLE_SAMPLERS[ + sde_type + ] else nullcontext(): + sde = sde_type() + t = torch.rand(tiny_state_batch.get_batch_size()) * (sde.T - EPS) + EPS + old_x: torch.Tensor = tiny_state_batch["foo"] + + corrector: pc.LangevinCorrector = corrector_type(sde, score_fn=dummy_score_fn, n_steps=5) + + x, x_mean = corrector.update_fn( + x=old_x, t=t, batch_idx=tiny_state_batch.get_batch_idx("foo") + ) + + assert x.shape == x_mean.shape == old_x.shape diff --git a/data/mattergen/diffusion/tests/test_sde_lib.py b/data/mattergen/diffusion/tests/test_sde_lib.py new file mode 100644 index 0000000000000000000000000000000000000000..697da3f8ee7d0ec9c381c3dfa1b6f96c9ed88065 --- /dev/null +++ b/data/mattergen/diffusion/tests/test_sde_lib.py @@ -0,0 +1,57 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Type + +import pytest +import torch + +from mattergen.diffusion.corruption.sde_lib import SDE +from mattergen.diffusion.tests.conftest import SDE_TYPES + + +def _check_batch_shape(x: torch.Tensor, batch_size: torch.LongTensor): + """Checks sde outputs that should be (batch_size, )""" + assert len(x.shape) == 1 + assert x.shape[0] == batch_size + + +@pytest.mark.parametrize("sparse", [True, False]) +@pytest.mark.parametrize("sdetype", SDE_TYPES) +def test_sde(tiny_state_batch, sdetype: Type[SDE], sparse, EPS): + """Tests correct shapes for all methods of the SDE class""" + x: torch.Tensor = tiny_state_batch["foo"] + sde: SDE = sdetype() + + if sparse: + batch_size = tiny_state_batch.get_batch_size() + batch_idx = tiny_state_batch.get_batch_idx("foo") + else: + batch_size = x.shape[0] + batch_idx = None + + t = torch.rand(batch_size) * (sde.T - EPS) + EPS + + def _check_shapes(drift, diffusion): + assert drift.shape == x.shape + assert diffusion.shape[0] == x.shape[0] + + # Forward SDE methods + drift, diffusion = sde.sde(x, t, batch_idx) + _check_shapes(drift, diffusion) + + mean, std = sde.marginal_prob(x, t, batch_idx) + + _check_shapes(mean, std) + + z = sde.prior_sampling(x.shape) + + assert z.shape == x.shape + + prior_logp = sde.prior_logp(z, batch_idx=batch_idx) + + _check_batch_shape(prior_logp, batch_size) + + +def dummy_score_fn(x, t, batch_idx): + return torch.zeros_like(x) diff --git a/data/mattergen/diffusion/tests/test_wrapped_normal.py b/data/mattergen/diffusion/tests/test_wrapped_normal.py new file mode 100644 index 0000000000000000000000000000000000000000..e5e6066241fec88eb7543aa429db23947559a932 --- /dev/null +++ b/data/mattergen/diffusion/tests/test_wrapped_normal.py @@ -0,0 +1,40 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import torch +from torch.distributions import Categorical, Independent, MixtureSameFamily, Normal + +from mattergen.diffusion.wrapped.wrapped_normal_loss import get_pbc_offsets, wrapped_normal_score +from mattergen.diffusion.wrapped.wrapped_sde import wrap_at_boundary + + +def test_wrapped_normal_score_isotropic(): + variance = torch.rand((1,)) * 5 + max_offsets = 3 + num_atoms = 1 + batch = torch.zeros(num_atoms, dtype=torch.long) + cell = torch.tensor([[[3.4641, 0.0, 2.0], [-1.1196, 1.6572, 0], [0.0, 0.0, 3.0]]]) + lattice_offsets = get_pbc_offsets(cell, max_offsets) + + mean = torch.zeros((3,)) + shifted_means = mean[None, None] + lattice_offsets + + normal_distributions = Normal(shifted_means[0], variance.sqrt().item()) + noisy_frac_coords = torch.rand((num_atoms, 3)) + noisy_cart_coords = wrap_at_boundary(noisy_frac_coords, 1.0) + noisy_cart_coords.requires_grad = True + comp_scores = wrapped_normal_score( + noisy_cart_coords, + mean[None], + cell, + variance.repeat(num_atoms), + batch, + max_offsets, + ) + + mix = Categorical(probs=torch.ones(shifted_means.shape[1])) + comp = Independent(normal_distributions, 1) + gmm = MixtureSameFamily(mix, comp) + gmm.log_prob(noisy_cart_coords).backward() + coord_score = noisy_cart_coords.grad + assert torch.allclose(coord_score, comp_scores, atol=1e-5) diff --git a/data/mattergen/diffusion/timestep_samplers.py b/data/mattergen/diffusion/timestep_samplers.py new file mode 100644 index 0000000000000000000000000000000000000000..8c0f0ce28025b5dd1a5976a7d02a0ea0025a244c --- /dev/null +++ b/data/mattergen/diffusion/timestep_samplers.py @@ -0,0 +1,39 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Protocol + +import torch + +from mattergen.diffusion.corruption.sde_lib import SDE + + +class TimestepSampler(Protocol): + min_t: float + max_t: float + + def __call__(self, batch_size: int, device: torch.device) -> torch.FloatTensor: + raise NotImplementedError + + +class UniformTimestepSampler: + """Samples diffusion timesteps uniformly over the training time.""" + + def __init__( + self, + *, + min_t: float, + max_t: float, + ): + """Initializes the sampler. + + Args: + min_t (float): Smallest timestep that will be seen during training. + max_t (float): Largest timestep that will be seen during training. + """ + super().__init__() + self.min_t = min_t + self.max_t = max_t + + def __call__(self, batch_size: int, device: torch.device) -> torch.FloatTensor: + return torch.rand(batch_size, device=device) * (self.max_t - self.min_t) + self.min_t diff --git a/data/mattergen/diffusion/training/__init__.py b/data/mattergen/diffusion/training/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/training/field_loss.py b/data/mattergen/diffusion/training/field_loss.py new file mode 100644 index 0000000000000000000000000000000000000000..a650fd77f939e548fd0e5501b610587ce4e3919f --- /dev/null +++ b/data/mattergen/diffusion/training/field_loss.py @@ -0,0 +1,198 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Literal, Protocol + +import torch +from torch_scatter import scatter + +from mattergen.diffusion.corruption.corruption import Corruption +from mattergen.diffusion.corruption.sde_lib import maybe_expand +from mattergen.diffusion.d3pm.d3pm import compute_kl_reverse_process +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.discrete_time import to_discrete_time +from mattergen.diffusion.model_target import ModelTarget + + +def compute_noise_given_sample_and_corruption( + x: torch.Tensor, + x_noisy: torch.Tensor, + corruption: Corruption, + t: torch.Tensor, + batch_idx: torch.LongTensor | None, + batch: BatchedData, +) -> torch.Tensor: + """ + Recover the (unit-Gaussian-distributed) raw noise that was used to corrupt a batch of samples. + We first obtain the mean and std of the noisy samples from the corruption via `t` and the clean batch. + Then we solve: + x_noisy = x_mean + noise * std w.r.t. `noise`: + noise = (x_noisy - x_mean) / std + """ + x_mean, std = corruption.marginal_prob( + x, + t=t, + batch_idx=batch_idx, + batch=batch, + ) + return (x_noisy - x_mean) / std + + +class FieldLoss(Protocol): + """Loss function for a single field. Because loss functions are defined different ways in different papers, + we pass loads of keyword arguments. Each loss function will only use a subset of these arguments. + """ + + def __call__( + self, + *, + corruption: Corruption, + score_model_output: torch.Tensor, + t: torch.Tensor, + batch_idx: torch.LongTensor | None, + batch_size: int, + x: torch.Tensor, + noisy_x: torch.Tensor, + reduce: Literal["sum", "mean"], + batch: BatchedData, + ) -> torch.Tensor: + """Calculate loss per sample for a single field. Returns a loss tensor of shape (batch_size,).""" + pass + + +def denoising_score_matching( + *, + corruption: Corruption, + score_model_output: torch.Tensor, + t: torch.Tensor, + batch_idx: torch.LongTensor | None, + batch_size: int, + x: torch.Tensor, + noisy_x: torch.Tensor, + reduce: Literal["sum", "mean"], + batch: BatchedData, + model_target: ModelTarget, + node_is_unmasked: torch.LongTensor | None = None, + **_, +) -> torch.Tensor: + """Mean square error in predicting raw noise, optionally reweighted.""" + assert score_model_output.ndim >= 2 + model_target = ModelTarget(model_target) # in case str was passed + + losses = get_losses( + corruption=corruption, + score_model_output=score_model_output, + t=t, + batch_idx=batch_idx, + x=x, + noisy_x=noisy_x, + batch=batch, + model_target=model_target, + ) + + if node_is_unmasked is not None: + losses = node_is_unmasked.unsqueeze(-1) * losses # Apply masking. + original_reduce = reduce + reduce = "sum" # We sum first and handle the division by nodes_per_sample for the mean manually later. + + loss_per_sample = aggregate_per_sample(losses, batch_idx, reduce=reduce, batch_size=batch_size) + + if (node_is_unmasked is not None) and (original_reduce == "mean"): + nodes_per_sample = scatter(node_is_unmasked, batch_idx, dim=0, reduce="sum") + loss_per_sample /= nodes_per_sample + + return loss_per_sample + + +def get_losses( + corruption: Corruption, + score_model_output: torch.Tensor, + t: torch.Tensor, + batch_idx: torch.LongTensor | None, + x: torch.Tensor, + noisy_x: torch.Tensor, + batch: BatchedData, + model_target: ModelTarget, +) -> torch.Tensor: + if model_target == ModelTarget.score_times_std: + raw_noise = compute_noise_given_sample_and_corruption( + x=x, x_noisy=noisy_x, corruption=corruption, t=t, batch_idx=batch_idx, batch=batch + ) + target = -raw_noise + losses = (score_model_output - target).square() + else: + raise ValueError(f"Unknown model_target {model_target}") + return losses + + +def aggregate_per_sample( + loss_per_row: torch.Tensor, + batch_idx: torch.Tensor | None, + reduce: Literal["sum", "mean"], + batch_size: int, +): + """ + Aggregate (potentially) batched input tensor to get a scalar for each sample in the batch. + E.g., (num_atoms, d1, d2, ..., dn) -> (batch_size, d1, d2, ..., dn) -> (batch_size,), + where the first aggregation only happens when batch_idx is provided. + + Args: + loss_per_row: shape (num_nodes, any_more_dims). May contain multiple nodes per sample. + batch_idx: shape (num_nodes,). Indicates which sample each row belongs to. If not provided, + then we assume the first dimension is the batch dimension. + reduce: determines how to aggregate over nodes within each sample. (Aggregation over samples + and within dims for one node is always mean.) + batch_size: number of samples in the batch. + + Returns: + Scalar for each sample, shape (batch_size,). + + """ + # Sum over all but 0th dimension. + loss_per_row = torch.mean(loss_per_row.reshape(loss_per_row.shape[0], -1), dim=1) + + if batch_idx is None: + # First dimension is batch dimension. In this case 'reduce' is ignored. + loss_per_sample = loss_per_row + else: + # Aggregate over nodes within each sample. + loss_per_sample = scatter( + src=loss_per_row, + index=batch_idx, + dim_size=batch_size, + reduce=reduce, + ) + return loss_per_sample + + +def d3pm_loss( + *, + corruption: Corruption, + score_model_output: torch.Tensor, + t: torch.Tensor, + batch_idx: torch.LongTensor | None, + batch_size: int, + x: torch.Tensor, + noisy_x: torch.Tensor, + reduce: Literal["sum", "mean"], + d3pm_hybrid_lambda: float = 0.0, + **_, +) -> torch.Tensor: + assert hasattr(corruption, "N") # mypy + assert hasattr(corruption, "_to_zero_based") # mypy + assert hasattr(corruption, "d3pm") # mypy + t = maybe_expand(to_discrete_time(t, N=corruption.N, T=corruption.T), batch_idx) + metrics_dict = compute_kl_reverse_process( + corruption._to_zero_based(x.long()), + t, + diffusion=corruption.d3pm, + log_space=True, + denoise_fn=lambda targets, timestep: score_model_output, + hybrid_lambda=d3pm_hybrid_lambda, + x_t_plus_1=corruption._to_zero_based(noisy_x.long()), + ) + loss = metrics_dict.pop("loss") + loss_per_structure = aggregate_per_sample( + loss, batch_idx=batch_idx, reduce=reduce, batch_size=batch_size + ) + return loss_per_structure diff --git a/data/mattergen/diffusion/training/metrics.py b/data/mattergen/diffusion/training/metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..86ae919c9d51ef8a4f1975397d1f93dadc337aa8 --- /dev/null +++ b/data/mattergen/diffusion/training/metrics.py @@ -0,0 +1,136 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Dict, Iterable, Protocol + +import torch +from torch_scatter import scatter + +from mattergen.diffusion.corruption.multi_corruption import MultiCorruption +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.score_models.base import Diffusable + + +class Metric(Protocol): + """ + Computes a metric to be logged during training. + Each metric must have a name which is used as a prefix for the metric in the log. + """ + + name: str + + def __call__( + self, + *, + loss_per_sample_per_field: Dict[str, torch.Tensor], + multi_corruption: MultiCorruption, + score_model_output: Diffusable, + t: torch.Tensor, + batch_idx: Dict[str, torch.LongTensor], + batch: BatchedData, + noisy_batch: BatchedData, + ) -> Dict[str, torch.Tensor]: + """ + Computes a metric to be logged during training. Useful, e.g., for plotting loss over time. + + Args: + loss_per_sample_per_field: Dict[str, torch.Tensor], where each tensor has shape (batch_size,). + multi_corruption: MultiCorruption + score_model_output: the output produced by the model per field. + t: shape (batch_size,). Time for each element in the loss. + batch_idx: Dict[str, torch.LongTensor]: batch indices per field + batch: BatchedData: the clean (un-perturbed) batched data + noisy_batch: BatchedData: the corrupted batched data + """ + pass + + +def loss_per_time_bin( + loss_per_sample: torch.Tensor, t: torch.Tensor, bins: torch.Tensor +) -> torch.Tensor: + """ + Aggregate loss per bin. Useful for plotting loss over time. + + Args: + loss_per_sample: shape (batch_size,). Loss for each sample. + t: shape (batch_size,). Time for each element in the loss. + bins: shape (num_bins,). Upper boundaries of the time bins. + Returns: + avg_loss_per_bin: shape (num_bins,). Average loss per time bin. + """ + bin_per_element = torch.bucketize(t, bins) + avg_loss_per_bin = scatter( + src=loss_per_sample, index=bin_per_element, dim_size=bins.shape[0], reduce="mean" + ) + return avg_loss_per_bin + + +class LossPerTimeBin(Metric): + name = "loss_per_time_bin" + + def __init__(self, t_min: float = 0.0, t_max: float = 1.0, num_bins: int = 10): + self.bins = torch.linspace(t_min, t_max, num_bins + 1) + + def __call__( + self, + *, + loss_per_sample_per_field: Dict[str, torch.Tensor], + t: torch.Tensor, + **_, + ) -> Dict[str, torch.Tensor]: + """ + Compute loss bins per diffusion time bin. Useful for plotting loss over diffusion time. + """ + metrics_dict = {} + for k, v in loss_per_sample_per_field.items(): + assert v.shape == t.shape + + # first bin is always empty because no time is less than t_min, so we skip it + avg_loss_per_bin = loss_per_time_bin( + loss_per_sample_per_field[k], + t, + bins=self.bins.to(loss_per_sample_per_field[k].device)[1:], + ) + metrics_dict.update( + { + f"{k}_{self.bins[ix]:.2f}-{self.bins[ix + 1]:.2f}": avg_loss_per_bin[ix] + for ix in range(len(avg_loss_per_bin)) + if avg_loss_per_bin[ix] > 0.0 + } + ) + return metrics_dict + + +class MetricsCalculator: + """ + Computes a set of metrics to be logged during training. + """ + + def __init__(self, metric_fns: Iterable[Metric]): + self.metric_fns = metric_fns + + def __call__( + self, + *, + loss_per_sample_per_field: Dict[str, torch.Tensor], + multi_corruption: MultiCorruption, + score_model_output: torch.Tensor, + t: torch.Tensor, + batch_idx: Dict[str, torch.LongTensor], + batch: BatchedData, + noisy_batch: BatchedData, + ) -> Dict[str, torch.Tensor]: + metrics_dict = {} + for metric_fn in self.metric_fns: + _metrics_dict = metric_fn( + loss_per_sample_per_field=loss_per_sample_per_field, + multi_corruption=multi_corruption, + score_model_output=score_model_output, + t=t, + batch_idx=batch_idx, + batch=batch, + noisy_batch=noisy_batch, + ) + # prepend metric name to each metric + metrics_dict.update({f"{metric_fn.name}_{k}": v for k, v in _metrics_dict.items()}) + return metrics_dict diff --git a/data/mattergen/diffusion/training/utils.py b/data/mattergen/diffusion/training/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..d1f7647361af4153b278453f29b29d715a44370b --- /dev/null +++ b/data/mattergen/diffusion/training/utils.py @@ -0,0 +1,32 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Iterable, Union + +import torch + + +def get_grad_norm( + parameters: Union[torch.Tensor, Iterable[torch.Tensor]], norm_type: float = 2.0 +) -> torch.Tensor: + """ + Adapted from: https://pytorch.org/docs/stable/_modules/torch/nn/utils/clip_grad.html#clip_grad_norm_ + """ + + if isinstance(parameters, torch.Tensor): + parameters = [parameters] + parameters = [p for p in parameters if p.grad is not None] + + norm_type = float(norm_type) + + if len(parameters) == 0: + return torch.tensor(0.0) + + device = parameters[0].grad.device + + total_norm = torch.norm( + torch.stack([torch.norm(p.grad.detach(), norm_type).to(device) for p in parameters]), + norm_type, + ) + + return total_norm diff --git a/data/mattergen/diffusion/wrapped/__init__.py b/data/mattergen/diffusion/wrapped/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/diffusion/wrapped/wrapped_normal_loss.py b/data/mattergen/diffusion/wrapped/wrapped_normal_loss.py new file mode 100644 index 0000000000000000000000000000000000000000..f1085dabf9d58d0424f21ba5d51e0fa527b42756 --- /dev/null +++ b/data/mattergen/diffusion/wrapped/wrapped_normal_loss.py @@ -0,0 +1,119 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Literal, Optional + +import torch + +from mattergen.diffusion.corruption.sde_lib import SDE, maybe_expand +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.training.field_loss import aggregate_per_sample + + +def get_pbc_offsets(pbc: torch.Tensor, max_offset_integer: int = 3) -> torch.Tensor: + """Build the Cartesian product of integer offsets of the periodic boundary. That is, if dim=3 and max_offset_integer=1 we build the (2*1 + 1)^3 = 27 + possible combinations of the Cartesian product of (i,j,k) for i,j,k in -max_offset_integer, ..., max_offset_integer. Then, we construct + the tensor of integer offsets of the pbc vectors, i.e., L_{ijk} = row_stack([i * l_1, j * l_2, k * l_3]). + + Args: + pbc (torch.Tensor, [batch_size, dim, dim]): The input pbc matrix. + max_offset_integer (int): The maximum integer offset per dimension to consider for the Cartesian product. Defaults to 3. + + Returns: + torch.Tensor, [batch_size, (2 * max_offset_integer + 1)^dim, dim]: The tensor containing the integer offsets of the pbc vectors. + """ + offset_range = torch.arange(-max_offset_integer, max_offset_integer + 1, device=pbc.device) + meshgrid = torch.stack( + torch.meshgrid(offset_range, offset_range, offset_range, indexing="xy"), dim=-1 + ) + offset = (pbc[:, None, None, None] * meshgrid[None, :, :, :, :, None]).sum(-2) + pbc_offset_per_molecule = offset.reshape(pbc.shape[0], -1, 3) + return pbc_offset_per_molecule + + +def wrapped_normal_score( + x: torch.Tensor, + mean: torch.Tensor, + wrapping_boundary: torch.Tensor, + variance_diag: torch.Tensor, + batch: torch.Tensor, + max_offset_integer: int = 3, +) -> torch.Tensor: + """Approximate the the score of a 3D wrapped normal distribution with diagonal covariance matrix w.r.t. x via a truncated sum. + See docstring of `wrapped_normal_score` for details about the arguments + + Args: + x (torch.Tensor, [num_atoms, dim]) + mean (torch.Tensor, [num_atoms, dim]) + wrapping_boundary (torch.Tensor, [num_molecules, dim, dim]) + variance_diag (torch.Tensor, [num_atoms,]) + batch (torch.Tensor, [num_atoms, ]) + max_offset_integer (int), Defaults to 3. + + Returns: + torch.Tensor, [num_atoms, dim]: The approximated score of the wrapped normal distribution. + """ + offset_add = get_pbc_offsets( + wrapping_boundary, + max_offset_integer, + ) + diffs_k = (x - mean)[:, None] + offset_add[batch] + dists_sqr_k = diffs_k.pow(2).sum(-1) + score_softmax = torch.softmax(-dists_sqr_k / (2 * variance_diag[:, None]), dim=-1) + score = -(score_softmax[:, :, None] * diffs_k).sum((-2)) / (variance_diag[:, None]) + return score + + +def wrapped_normal_loss( + *, + corruption: SDE, + score_model_output: torch.Tensor, + t: torch.Tensor, + batch_idx: Optional[torch.LongTensor], + batch_size: int, + x: torch.Tensor, + noisy_x: torch.Tensor, + reduce: Literal["sum", "mean"], + batch: BatchedData, + **_ +) -> torch.Tensor: + """Compute the loss for a wrapped normal distribution. + Compares the score of the wrapped normal distribution to the score of the score model. + """ + assert len(t) == batch_size + _, std = corruption.marginal_prob( + x=torch.zeros((x.shape[0], 1), device=t.device), + t=t, + batch_idx=batch_idx, + batch=batch, + ) # std does not depend on x + + pred: torch.Tensor = score_model_output + if pred.ndim != 2: + raise NotImplementedError + + assert hasattr( + corruption, "wrapping_boundary" + ), "SDE must be a WrappedSDE, i.e., must have a wrapping boundary." + wrapping_boundary = corruption.wrapping_boundary + # Scaled identity matrix, i.e., in each dimension we wrap at `wrapping_boundary`. + wrapping_boundary = wrapping_boundary * torch.eye(x.shape[-1], device=t.device)[None].expand( + batch_size, -1, -1 + ) + + # We multiply the score by the standard deviation because we don't use raw_noise here; raw_noise is -score * std, i.e., we multiply the score by std. + target = ( + wrapped_normal_score( + x=noisy_x, + mean=x, + wrapping_boundary=wrapping_boundary, + variance_diag=std.squeeze() ** 2, + batch=batch_idx, + ) + * std + ) + delta = target - pred + + losses = delta.square() + + return aggregate_per_sample(losses, batch_idx, reduce=reduce, batch_size=batch_size) diff --git a/data/mattergen/diffusion/wrapped/wrapped_predictors_correctors.py b/data/mattergen/diffusion/wrapped/wrapped_predictors_correctors.py new file mode 100644 index 0000000000000000000000000000000000000000..a067b441ab0671d74c311c242027d7397ff2deae --- /dev/null +++ b/data/mattergen/diffusion/wrapped/wrapped_predictors_correctors.py @@ -0,0 +1,88 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Optional, Tuple + +import torch + +import mattergen.diffusion.sampling.predictors_correctors as pc +from mattergen.diffusion.corruption import sde_lib +from mattergen.diffusion.corruption.corruption import Corruption +from mattergen.diffusion.data.batched_data import BatchedData +from mattergen.diffusion.exceptions import IncompatibleSampler +from mattergen.diffusion.sampling import predictors +from mattergen.diffusion.wrapped.wrapped_sde import WrappedSDEMixin + +# importing SampleAndMean does not work because of circular imports, so we have to redefine it here. +SampleAndMean = Tuple[torch.Tensor, torch.Tensor] + + +class WrappedPredictorMixin: + """A mixin for wrapping the predictor in a WrappedSDE.""" + + def update_given_score( + self, + *, + x: torch.Tensor, + t: torch.Tensor, + dt: torch.Tensor, + batch_idx: torch.LongTensor, + score: torch.Tensor, + batch: Optional[BatchedData], + ) -> SampleAndMean: + # mypy + assert isinstance(self, predictors.Predictor) + _super = super() + assert hasattr(_super, "update_given_score") + assert hasattr(self, "corruption") + if not hasattr(self.corruption, "wrap"): + raise IncompatibleSampler( + f"{self.__class__.__name__} is not compatible with {self.corruption}." + ) + + sample, mean = _super.update_given_score( + x=x, t=t, dt=dt, batch_idx=batch_idx, score=score, batch=batch + ) + return self.corruption.wrap(sample), self.corruption.wrap(mean) + + +class WrappedCorrectorMixin: + """A mixin for wrapping the corrector in a WrappedSDE.""" + + def step_given_score( + self, + *, + x: torch.Tensor, + batch_idx: torch.LongTensor, + score: torch.Tensor, + t: torch.Tensor, + ) -> SampleAndMean: + # mypy + assert isinstance(self, pc.LangevinCorrector) + _super = super() + assert hasattr(_super, "step_given_score") + assert hasattr(self, "corruption") and hasattr(self.corruption, "wrap") + if not hasattr(self.corruption, "wrap"): + raise IncompatibleSampler( + f"{self.__class__.__name__} is not compatible with {self.corruption}." + ) + sample, mean = _super.step_given_score(x=x, score=score, t=t, batch_idx=batch_idx) + return self.corruption.wrap(sample), self.corruption.wrap(mean) + + +class WrappedAncestralSamplingPredictor( + WrappedPredictorMixin, predictors.AncestralSamplingPredictor +): + @classmethod + def is_compatible(cls, corruption: Corruption): + return isinstance(corruption, (sde_lib.VPSDE, sde_lib.VESDE)) and isinstance( + corruption, WrappedSDEMixin + ) + + +class WrappedLangevinCorrector(WrappedCorrectorMixin, pc.LangevinCorrector): + @classmethod + def is_compatible(cls, corruption: Corruption): + return isinstance(corruption, (sde_lib.VPSDE, sde_lib.VESDE)) and isinstance( + corruption, WrappedSDEMixin + ) diff --git a/data/mattergen/diffusion/wrapped/wrapped_sde.py b/data/mattergen/diffusion/wrapped/wrapped_sde.py new file mode 100644 index 0000000000000000000000000000000000000000..aece6318b681e9945c4917522106535db58863ee --- /dev/null +++ b/data/mattergen/diffusion/wrapped/wrapped_sde.py @@ -0,0 +1,82 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Optional, Tuple, Union + +import torch + +from mattergen.diffusion.corruption.sde_lib import SDE, VESDE, VPSDE +from mattergen.diffusion.data.batched_data import BatchedData + +B = Optional[torch.LongTensor] + + +def wrap_at_boundary(x: torch.Tensor, wrapping_boundary: float) -> torch.Tensor: + """Wrap x at the boundary given by wrapping_boundary. + Args: + x: tensor of shape (batch_size, dim) + wrapping_boundary: float): wrap at [0, wrapping_boundary] in all dimensions. + Returns: + wrapped_x: tensor of shape (batch_size, dim) + """ + return torch.remainder( + x, wrapping_boundary + ) # remainder is the same as mod, but works with negative numbers. + + +class WrappedSDEMixin: + def sample_marginal( + self, + x: torch.Tensor, + t: torch.Tensor, + batch_idx: torch.LongTensor = None, + batch: Optional[BatchedData] = None, + ) -> torch.Tensor: + _super = super() + assert ( + isinstance(self, SDE) + and hasattr(_super, "sample_marginal") + and hasattr(self, "wrapping_boundary") + ) + if (x > self.wrapping_boundary).any() or (x < 0).any(): + # Values outside the wrapping boundary are valid in principle, but could point to an issue in the data preprocessing, + # as typically we assume that the input data is inside the wrapping boundary (e.g., angles between 0 and 2*pi). + print("Warning: Wrapped SDE has received input outside of the wrapping boundary.") + noisy_x = _super.sample_marginal(x=x, t=t, batch_idx=batch_idx, batch=batch) + return self.wrap(noisy_x) + + def prior_sampling( + self, + shape: Union[torch.Size, Tuple], + conditioning_data: Optional[BatchedData] = None, + batch_idx: B = None, + ) -> torch.Tensor: + _super = super() + assert isinstance(self, SDE) and hasattr(_super, "prior_sampling") + return self.wrap(_super.prior_sampling(shape=shape, conditioning_data=conditioning_data)) + + def wrap(self, x): + assert isinstance(self, SDE) and hasattr(self, "wrapping_boundary") + return wrap_at_boundary(x, self.wrapping_boundary) + + +class WrappedVESDE(WrappedSDEMixin, VESDE): + def __init__( + self, + wrapping_boundary: float = 1.0, + sigma_min: float = 0.01, + sigma_max: float = 50.0, + ): + super().__init__(sigma_min=sigma_min, sigma_max=sigma_max) + self.wrapping_boundary = wrapping_boundary + + +class WrappedVPSDE(WrappedSDEMixin, VPSDE): + def __init__( + self, + wrapping_boundary: float = 1.0, + beta_min: float = 0.1, + beta_max: float = 20, + ): + super().__init__(beta_min=beta_min, beta_max=beta_max) + self.wrapping_boundary = wrapping_boundary diff --git a/data/mattergen/evaluation/__init__.py b/data/mattergen/evaluation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/evaluation/evaluate.py b/data/mattergen/evaluation/evaluate.py new file mode 100644 index 0000000000000000000000000000000000000000..39e6a62d36998e117623825a20bf6d3e357099f8 --- /dev/null +++ b/data/mattergen/evaluation/evaluate.py @@ -0,0 +1,62 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from pymatgen.core.structure import Structure + +from mattergen.common.utils.globals import get_device +from mattergen.evaluation.metrics.evaluator import MetricsEvaluator +from mattergen.evaluation.reference.reference_dataset import ReferenceDataset +from mattergen.evaluation.utils.relaxation import relax_structures +from mattergen.evaluation.utils.structure_matcher import ( + DefaultDisorderedStructureMatcher, + DisorderedStructureMatcher, + OrderedStructureMatcher, +) + + +def evaluate( + structures: list[Structure], + relax: bool = True, + energies: list[float] | None = None, + reference: ReferenceDataset | None = None, + structure_matcher: ( + OrderedStructureMatcher | DisorderedStructureMatcher + ) = DefaultDisorderedStructureMatcher(), + save_as: str | None = None, + potential_load_path: str | None = None, + device: str = str(get_device()), +) -> dict[str, float | int]: + """Evaluate the structures against a reference dataset. + + Args: + structures: List of structures to evaluate. + relax: Whether to relax the structures before evaluation. Note that if this is run, `energies` will be ignored. + energies: Energies of the structures if already relaxed and computed externally (e.g., from DFT). + reference_dataset: Reference dataset. + ordered_structure_matcher: Matcher for ordered structures. + disordered_structure_matcher: Matcher for disordered structures. + n_jobs: Number of parallel jobs. + + Returns: + metrics: a dictionary of metrics and their values. + """ + if relax and energies is not None: + raise ValueError("Cannot accept energies if relax is True.") + if relax: + relaxed_structures, energies = relax_structures( + structures, device=device, load_path=potential_load_path + ) + else: + relaxed_structures = structures + evaluator = MetricsEvaluator.from_structures_and_energies( + structures=relaxed_structures, + energies=energies, + original_structures=structures, + reference=reference, + structure_matcher=structure_matcher, + ) + return evaluator.compute_metrics( + metrics=evaluator.available_metrics, + save_as=save_as, + pretty_print=True, + ) diff --git a/data/mattergen/evaluation/metrics/__init__.py b/data/mattergen/evaluation/metrics/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/evaluation/metrics/core.py b/data/mattergen/evaluation/metrics/core.py new file mode 100644 index 0000000000000000000000000000000000000000..ba41b5f5f17f4fc8427b2f8517b9f71abc450778 --- /dev/null +++ b/data/mattergen/evaluation/metrics/core.py @@ -0,0 +1,96 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import abc +from copy import deepcopy +from functools import cached_property +from typing import Literal, Type + +import numpy as np +import numpy.typing +from pandas import DataFrame + +from mattergen.evaluation.reference.reference_dataset import ReferenceDataset +from mattergen.evaluation.utils.metrics_structure_summary import MetricsStructureSummary + + +class BaseMetricsCapability: + """Base class for capabilities.""" + + name: str = "base_capability" + + def __init__( + self, structure_summaries: list[MetricsStructureSummary], n_failed_jobs: int = 0 + ) -> None: + assert len(structure_summaries) > 0, "No data provided." + self._structure_summaries = structure_summaries + self.n_failed_jobs = n_failed_jobs + + @property + def total_submitted_jobs(self) -> int: + return len(self.dataset) + self.n_failed_jobs + + @cached_property + def dataset(self) -> ReferenceDataset: + """ + Returns a ReferenceDataset. While not all capabilities require energies, + the entry IDs are useful to keep track of entry IDs. + """ + data_entries = [deepcopy(s.entry) for s in self._structure_summaries] + for i, e in enumerate(data_entries): + e.entry_id = i + + return ReferenceDataset.from_entries("data_entries", data_entries) + + @abc.abstractmethod + def as_dataframe(self) -> DataFrame: + """Returns a pandas DataFrame containing information about this capability.""" + + +class BaseMetric: + """Abstract base class for metrics.""" + + required_capabilities: tuple[Type[BaseMetricsCapability], ...] + + @property + def name(self) -> str: + return "base_metric" + + @property + def description(self) -> str: + raise NotImplementedError + + @cached_property + def value(self) -> float | int: + raise NotImplementedError + + +class BaseAggregateMetric(BaseMetric): + """Abstract base class for aggregate metrics.""" + + aggregation_method: Literal[ + "mean", "nanmean", + ] = "not implemented" + + @property + def pre_aggregation_name(self) -> str: + return "base_metric" + + @abc.abstractmethod + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + """Compute metric values for each sample in the dataset.""" + + @cached_property + def pre_aggregation_values(self) -> numpy.typing.NDArray: + """Metric values for each sample in the dataset before aggregation.""" + return self.compute_pre_aggregation_values() + + @cached_property + def value(self) -> float | int: + values = self.pre_aggregation_values + if self.aggregation_method == "mean": + return values.mean() + elif self.aggregation_method == "nanmean": + return np.nanmean(values) + else: + raise ValueError(f"Unknown aggregation method {self.aggregation_method}") diff --git a/data/mattergen/evaluation/metrics/energy.py b/data/mattergen/evaluation/metrics/energy.py new file mode 100644 index 0000000000000000000000000000000000000000..49227c35b1572c54f81d7e9baee0d0c5ea8a53d8 --- /dev/null +++ b/data/mattergen/evaluation/metrics/energy.py @@ -0,0 +1,358 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from dataclasses import dataclass +from functools import cached_property, lru_cache +from typing import Literal + +import numpy as np +import numpy.typing +from pandas import DataFrame +from pymatgen.analysis.phase_diagram import PhaseDiagram +from tqdm import tqdm + +from mattergen.evaluation.metrics.core import BaseAggregateMetric, BaseMetric, BaseMetricsCapability +from mattergen.evaluation.metrics.structure import StructureMetricsCapability +from mattergen.evaluation.reference.reference_dataset import ReferenceDataset +from mattergen.evaluation.utils.globals import DEFAULT_STABILITY_THRESHOLD +from mattergen.evaluation.utils.logging import logger +from mattergen.evaluation.utils.metrics_structure_summary import MetricsStructureSummary +from mattergen.evaluation.utils.utils import expand_into_subsystems + +# -----------------------------# +# Capabilities +# -----------------------------# + + +class MissingTerminalsError(ValueError): + pass + + +def get_set_of_all_elements(structure_summaries: list[MetricsStructureSummary]) -> set[str]: + """Returns a set of terminal chemical systems in the dataset.""" + return set( + str(element) for x in structure_summaries for element in x.entry.composition.elements + ) + + +@dataclass(frozen=True) +class MissingTerminalsAndEnergy: + """ + Class to store information about missing terminal systems and energy data in the reference dataset. + """ + + missing_terminals: list[str] + missing_energy: list[str] + + @classmethod + def from_dataset_and_reference( + cls, + structure_summaries: list[MetricsStructureSummary], + reference: ReferenceDataset, + ) -> "MissingTerminalsAndEnergy": + terminal_systems = get_set_of_all_elements(structure_summaries) + missing_terminals = list(terminal_systems - set(reference.entries_by_chemsys.keys())) + # among non-missing terminal systems, check if any of them have missing energy data + terminals_in_reference = terminal_systems & set(reference.entries_by_chemsys.keys()) + missing_energy = [ + chemsys + for chemsys in terminals_in_reference + if all([np.isnan(e.energy) for e in reference.entries_by_chemsys[chemsys]]) + ] + return cls(missing_terminals=missing_terminals, missing_energy=missing_energy) + + @property + def has_missing_terminals(self) -> bool: + return len(self.missing_terminals) > 0 + + @property + def has_missing_energy(self) -> bool: + return len(self.missing_energy) > 0 + + @property + def has_missing_data(self) -> bool: + return self.has_missing_terminals or self.has_missing_energy + + +class EnergyMetricsCapability(BaseMetricsCapability): + name: str = "energy_capability" + missing_terminals_error_str = "Reference dataset does not contain sufficient data to compute energy metrics for the given dataset." + + """Capability for computing structure metrics.""" + + @classmethod + def check_missing_reference_terminal_systems( + cls, + structure_summaries: list[MetricsStructureSummary], + reference_dataset: ReferenceDataset, + ) -> MissingTerminalsAndEnergy: + return MissingTerminalsAndEnergy.from_dataset_and_reference( + structure_summaries=structure_summaries, + reference=reference_dataset, + ) + + @classmethod + def warn_missing_data(cls, missing_terminals: MissingTerminalsAndEnergy) -> None: + logger.warning(cls.missing_terminals_error_str) + if missing_terminals.has_missing_terminals: + logger.warning(f"Missing terminal systems: {missing_terminals.missing_terminals}") + if missing_terminals.has_missing_energy: + logger.warning( + f"Missing energy data for terminal systems: {missing_terminals.missing_energy}" + ) + + def __init__( + self, + structure_summaries: list[MetricsStructureSummary], + reference_dataset: ReferenceDataset, + stability_threshold: float = DEFAULT_STABILITY_THRESHOLD, + n_failed_jobs: int = 0, + ) -> None: + if ( + missing_terminals := self.check_missing_reference_terminal_systems( + structure_summaries, reference_dataset + ) + ).has_missing_data: + self.warn_missing_data(missing_terminals) + raise MissingTerminalsError(self.missing_terminals_error_str) + super().__init__(structure_summaries=structure_summaries, n_failed_jobs=n_failed_jobs) + self.reference_dataset = reference_dataset + self.stability_threshold = stability_threshold + + @property + def is_stable(self) -> numpy.typing.NDArray[np.bool_]: + """ + Returns a boolean mask of the same length as data_entries + indicating whether each entry is stable or not. + """ + return self.energy_above_hull <= self.stability_threshold + + @property + def is_self_consistent_stable(self) -> numpy.typing.NDArray[np.bool_]: + """ + Returns a boolean mask of the same length as data_entries + indicating whether each entry is self-consistently stable or not. + """ + return self.self_consistent_energy_above_hull <= self.stability_threshold + + @cached_property + def energy_above_hull(self) -> numpy.typing.NDArray: + """Returns energy above hull (eV) per atom with respect to the reference dataset.""" + result = np.zeros(len(self.dataset)) + for chemsys, entries in tqdm( + self.dataset.entries_by_chemsys.items(), + desc="Computing energies above hull", + ): + result[[e.entry_id for e in entries]] = np.array( + self._get_energy_above_hull_per_atom_chemsys(chemsys) + ) + return result + + @cached_property + def self_consistent_energy_above_hull(self) -> numpy.typing.NDArray: + """Returns the energy above hull (eV) per atom with respect to the convex hull that + combines the reference dataset and the samples.""" + result = np.zeros(len(self.dataset)) + for chemsys, entries in tqdm( + self.dataset.entries_by_chemsys.items(), + desc="Computing self-consistent energies above hull", + ): + result[[e.entry_id for e in entries]] = np.array( + self._get_self_consistent_energy_above_hull_per_atom_chemsys(chemsys) + ) + return result + + def as_dataframe(self) -> DataFrame: + return DataFrame( + data={ + "energy_above_hull": self.energy_above_hull, + "self_consistent_energy_above_hull": self.self_consistent_energy_above_hull, + }, + index=[e.entry_id for e in self.dataset], + ) + + # ---------------------------------------------# + # Helper functions shared by multiple metrics # + # ---------------------------------------------# + + def _get_phase_diagram(self, chemical_system: str) -> PhaseDiagram: + """Returns the phase diagram for a given chemical system.""" + subsys = expand_into_subsystems(chemical_system) + reference_entries = [ + entry + for s in subsys + for key in ["-".join(sorted(s))] + for entry in self.reference_dataset.entries_by_chemsys.get(key, []) + if not np.isnan( + entry.energy + ) # skip disordered structures, which have nan energy currently + ] + assert len(reference_entries) > 0, f"No reference data for {chemical_system}." + return PhaseDiagram(reference_entries) + + @lru_cache + def _get_energy_above_hull_per_atom_chemsys(self, chemsys: str) -> list[float]: + """Returns a list of energies above hull per atom for a given chemical system.""" + phase_diagram = self._get_phase_diagram(chemsys) + e_above_hull = [ + phase_diagram.get_e_above_hull(entry=e, allow_negative=True) + for e in self.dataset.entries_by_chemsys[chemsys] + ] + for e, ehull in zip(self.dataset.entries_by_chemsys[chemsys], e_above_hull): + logger.debug( + f"{e.composition.reduced_formula}: energy above hull {ehull} (threshold {self.stability_threshold})" + ) + return e_above_hull + + def _get_self_consistent_phase_diagram(self, chemical_system: str) -> PhaseDiagram: + """Returns the internal phase diagram for a given chemical system. + This is comprised of all reference entries that do not exactly match the chemical system, and + of all entries belonging to the chemical system.""" + subsys = expand_into_subsystems(chemical_system) + reference_entries = [ + entry + for s in subsys + for key in ["-".join(sorted(s))] + for entry in self.reference_dataset.entries_by_chemsys.get(key, []) + if key != chemical_system # Do not get reference entries for the chemical system itself + and not np.isnan( + entry.energy + ) # skip disordered structures, which have nan energy currently + ] + reference_entries += self.dataset.entries_by_chemsys.get(chemical_system, []) + assert len(reference_entries) > 0, f"No data for {chemical_system}." + return PhaseDiagram(reference_entries) + + def _get_full_phase_diagram(self, chemical_system: str) -> PhaseDiagram: + """Returns the total phase diagram for a given chemical system. + This is comprised of all reference entries and + of all entries belonging to the chemical system.""" + subsys = expand_into_subsystems(chemical_system) + reference_entries = [ + entry + for s in subsys + for key in ["-".join(sorted(s))] + for entry in self.reference_dataset.entries_by_chemsys.get(key, []) + if not np.isnan( + entry.energy + ) # skip disordered structures, which have nan energy currently + ] + reference_entries += self.dataset.entries_by_chemsys.get(chemical_system, []) + assert len(reference_entries) > 0, f"No data for {chemical_system}." + return PhaseDiagram(reference_entries) + + @lru_cache + def _get_self_consistent_energy_above_hull_per_atom_chemsys(self, chemsys: str) -> list[float]: + """Returns a list of self-consistent energies above hull per atom for a given chemical system.""" + phase_diagram = self._get_self_consistent_phase_diagram(chemsys) + e_above_hull = [ + phase_diagram.get_e_above_hull(entry=e, allow_negative=True) + for e in self.dataset.entries_by_chemsys[chemsys] + ] + return e_above_hull + + +# -----------------------------# +# Metrics +# -----------------------------# + + +@dataclass(frozen=True) +class BaseEnergyMetric(BaseMetric): + # Use for metrics that have access to structure and energy data. + # In principle, we could have two classes, one for energy-only capabilities and one for structure+energy capabilities; + # however, since the input data already contains both structure and energy data, we can use a single class for both. + required_capabilities = (StructureMetricsCapability, EnergyMetricsCapability) + + @property + def name(self) -> str: + return "base_energy_metric" + + def __init__( + self, + structure_capability: StructureMetricsCapability, + energy_capability: EnergyMetricsCapability, + **kwargs, # eat up unused kwargs (i.e., other capabilities) + ): + self.structure_capability = structure_capability + self.energy_capability = energy_capability + self.reference_dataset = self.energy_capability.reference_dataset + + +class FracSuccessfulJobs(BaseEnergyMetric): + name = "frac_successful_jobs" + + @property + def description(self) -> str: + return "Fraction of structures whose jobs ran successfully." + + @cached_property + def value(self) -> float: + return ( + len(self.energy_capability._structure_summaries) / self.energy_capability.total_submitted_jobs + ) + + +class AvgRMSDFromRelaxation(BaseEnergyMetric, BaseAggregateMetric): + aggregation_method: Literal["nanmean"] = "nanmean" + name = "avg_rmsd_from_relaxation" + pre_aggregation_name = "rmsd_from_relaxation" + + @property + def description(self) -> str: + return "root mean square displacements of atoms (Angstrom) from initial to final DFT relaxation steps in sampled data." + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return np.array([d.rmsd_from_relaxation for d in self.energy_capability._structure_summaries]) + + +class AvgEnergyAboveHullPerAtom(BaseEnergyMetric, BaseAggregateMetric): + aggregation_method: Literal["mean"] = "mean" + name = "avg_energy_above_hull_per_atom" + pre_aggregation_name = "energy_above_hull_per_atom" + + @property + def description(self) -> str: + return "Average energy above hull per atom (eV/atom) of structures in sampled data." + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return self.energy_capability.energy_above_hull + + +class FracStableStructures(BaseEnergyMetric, BaseAggregateMetric): + name = "frac_stable_structures" + pre_aggregation_name = "stable" + + @property + def description(self) -> str: + return f"Fraction of stable structures in sampled data within {self.energy_capability.stability_threshold} (eV/atom) above convex hull of {self.reference_dataset.name}." + + @cached_property + def value(self) -> float: + return self.pre_aggregation_values.sum() / self.energy_capability.total_submitted_jobs + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return self.energy_capability.is_stable + + +class FracNovelUniqueStableStructures(BaseEnergyMetric, BaseAggregateMetric): + name = "frac_novel_unique_stable_structures" + pre_aggregation_name = "novel_unique_stable" + + @property + def description(self) -> str: + return ( + f"Fraction of novel unique stable structures in sampled data within {self.energy_capability.stability_threshold} (eV/atom) " + + f"above convex hull of {self.reference_dataset.name}." + ) + + @cached_property + def value(self) -> float: + return self.pre_aggregation_values.sum() / self.energy_capability.total_submitted_jobs + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return ( + self.structure_capability.is_novel + & self.structure_capability.is_unique + & self.energy_capability.is_stable + ) diff --git a/data/mattergen/evaluation/metrics/evaluator.py b/data/mattergen/evaluation/metrics/evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..25fd53c08595aefd4dcde48f71599eaad4bcf0c1 --- /dev/null +++ b/data/mattergen/evaluation/metrics/evaluator.py @@ -0,0 +1,353 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import json +import os +from collections.abc import Iterable, Sequence +from functools import cached_property +from inspect import getmembers, isclass +from pathlib import Path +from typing import Literal, Sequence, Type, TypeVar + +import numpy.typing +import pandas as pd +from monty.serialization import dumpfn +from pandas import DataFrame +from pymatgen.core.structure import Structure +from pymatgen.entries.compatibility import Compatibility, MaterialsProject2020Compatibility +from typing_extensions import Self + +import mattergen.evaluation.metrics.energy as energy_metrics +import mattergen.evaluation.metrics.property as property_metrics +import mattergen.evaluation.metrics.structure as structure_metrics +from mattergen.evaluation.metrics.core import BaseAggregateMetric, BaseMetric, BaseMetricsCapability +from mattergen.evaluation.metrics.energy import EnergyMetricsCapability, MissingTerminalsError +from mattergen.evaluation.metrics.property import PropertyMetricsCapability +from mattergen.evaluation.metrics.structure import StructureMetricsCapability +from mattergen.evaluation.reference.presets import ReferenceMP2020Correction +from mattergen.evaluation.reference.reference_dataset import ReferenceDataset +from mattergen.evaluation.utils.globals import DEFAULT_STABILITY_THRESHOLD +from mattergen.evaluation.utils.logging import logger +from mattergen.evaluation.utils.metrics_structure_summary import ( + MetricsStructureSummary, + get_metrics_structure_summaries, +) +from mattergen.evaluation.utils.structure_matcher import ( + DefaultDisorderedStructureMatcher, + DisorderedStructureMatcher, + OrderedStructureMatcher, +) +from mattergen.evaluation.utils.utils import PropertyConstraint + +T = TypeVar("T") + + +def unique_item(iterable: Iterable[T]) -> T: + """returns the content of a sequence containing a single item.""" + lst = list(iterable) + assert len(lst) == 1, f"Tried to call unique_item, but {lst} contains {len(lst)} items." + return lst[0] + + +class MetricsEvaluator: + """ + This class is used to evaluate a set of metrics on a set of structures. + """ + + def __init__(self, capabilities: Sequence[BaseMetricsCapability]): + assert len(capabilities) > 0, "At least one capability is required." + self.capabilities = capabilities + + self._metrics: dict[ + Type[BaseMetric], BaseMetric + ] = {} # use to cache previously instantiated metrics + + @classmethod + def from_structures( + cls, + structures: list[Structure], + reference: ReferenceDataset | None = None, + structure_matcher: OrderedStructureMatcher + | DisorderedStructureMatcher = DefaultDisorderedStructureMatcher(), + n_failed_jobs: int = 0, + ) -> Self: + """Instantiate MetricsEvaluator from a list of structures. This is useful for computing structure-based metrics.""" + + if reference is None: + print("No reference dataset provided. Using MP2020 correction dataset as reference.") + reference = ReferenceMP2020Correction() + + structure_summaries = [MetricsStructureSummary.from_structure(s) for s in structures] + structure_capability = StructureMetricsCapability( + structure_summaries=structure_summaries, + reference_dataset=reference, + structure_matcher=structure_matcher, + n_failed_jobs=n_failed_jobs, + ) + return cls(capabilities=[structure_capability]) + + @classmethod + def from_structures_and_energies( + cls, + structures: list[Structure], + energies: list[float], + reference: ReferenceDataset | None = None, + properties: dict[str, list[float]] | None = None, + property_constraints: dict[str, PropertyConstraint] | None = None, + original_structures: list[Structure] | None = None, + stability_threshold: float = DEFAULT_STABILITY_THRESHOLD, + structure_matcher: OrderedStructureMatcher + | DisorderedStructureMatcher = DefaultDisorderedStructureMatcher(), + energy_correction_scheme: Compatibility = MaterialsProject2020Compatibility(), + n_failed_jobs: int = 0, + ) -> Self: + + if reference is None: + print("No reference dataset provided. Using MP2020 correction as reference.") + reference = ReferenceMP2020Correction() + + structure_summaries = get_metrics_structure_summaries( + structures=structures, + energies=energies, + properties=properties, + original_structures=original_structures, + energy_correction_scheme=energy_correction_scheme, + ) + + return cls.from_structure_summaries( + structure_summaries=structure_summaries, + reference=reference, + stability_threshold=stability_threshold, + property_constraints=property_constraints, + structure_matcher=structure_matcher, + n_failed_jobs=n_failed_jobs, + ) + + @classmethod + def from_structure_summaries( + cls, + structure_summaries: list[MetricsStructureSummary], + reference: ReferenceDataset | None = None, + stability_threshold: float = DEFAULT_STABILITY_THRESHOLD, + property_constraints: dict[str, PropertyConstraint] | None = None, + structure_matcher: OrderedStructureMatcher + | DisorderedStructureMatcher = DefaultDisorderedStructureMatcher(), + n_failed_jobs: int = 0, + ) -> Self: + + if reference is None: + print("No reference dataset provided. Using MP2020 correction as reference.") + reference = ReferenceMP2020Correction() + + capabilities: list[BaseMetricsCapability] = [] + + if reference is not None: + structure_capability = StructureMetricsCapability( + structure_summaries=structure_summaries, + reference_dataset=reference, + structure_matcher=structure_matcher, + n_failed_jobs=n_failed_jobs, + ) + capabilities.append(structure_capability) + try: + energy_capability = EnergyMetricsCapability( + structure_summaries=structure_summaries, + reference_dataset=reference, + stability_threshold=stability_threshold, + n_failed_jobs=n_failed_jobs, + ) + capabilities.append(energy_capability) + except MissingTerminalsError: + # if there are missing terminal systems in the reference dataset, we simply don't + # add the energy capability as we can still compute structure metrics. + pass + + if any([c for c in structure_summaries if c.properties]): + property_capability = PropertyMetricsCapability( + structure_summaries=structure_summaries, + property_constraints=property_constraints, + n_failed_jobs=n_failed_jobs, + ) + capabilities.append(property_capability) + + return cls(capabilities=capabilities) + + @cached_property + def available_capability_types(self) -> frozenset[Type[BaseMetricsCapability]]: + return frozenset([type(cap) for cap in self.capabilities]) + + @cached_property + def available_metrics(self) -> list[Type[BaseMetric]]: + return [ + metric + for metric in get_all_metrics_classes() + if all(cap in self.available_capability_types for cap in metric.required_capabilities) + ] + + @property + def is_unique(self) -> numpy.typing.NDArray: + return self.structure_capability.is_unique + + @property + def is_novel(self) -> numpy.typing.NDArray: + return self.structure_capability.is_novel + + @property + def matches_in_reference(self) -> dict[int, list[str]]: + return self.structure_capability.matches_in_reference + + @property + def is_in_reference(self) -> tuple[numpy.typing.NDArray]: + return self.structure_capability.is_in_reference + + @property + def is_stable(self) -> numpy.typing.NDArray: + return self.energy_capability.is_stable + + @property + def is_self_consistent_stable(self) -> numpy.typing.NDArray: + return self.energy_capability.is_self_consistent_stable + + @cached_property + def structure_capability(self) -> StructureMetricsCapability: + return self._get_capability(StructureMetricsCapability) + + @cached_property + def energy_capability(self) -> EnergyMetricsCapability: + return self._get_capability(EnergyMetricsCapability) + + @cached_property + def property_capability(self) -> PropertyMetricsCapability: + return self._get_capability(PropertyMetricsCapability) + + CapabilityT = TypeVar("CapabilityT", bound=BaseMetricsCapability) + + def _get_capability(self, capability: Type[CapabilityT]) -> CapabilityT: + assert ( + capability in self.available_capability_types + ), f"Capability {capability} is not available. Must be one of {self.available_capability_types}." + return unique_item(cap for cap in self.capabilities if isinstance(cap, capability)) + + def _get_metric(self, metric: Type[BaseMetric]) -> BaseMetric: + assert ( + metric in self.available_metrics + ), f"Metric {metric} is not available. Must be one of {self.available_metrics}." + if metric not in self._metrics: + capabilities: dict[str, BaseMetricsCapability | None] = { + StructureMetricsCapability.name: None, + EnergyMetricsCapability.name: None, + PropertyMetricsCapability.name: None, + } + capabilities.update({capability.name: capability for capability in self.capabilities}) + self._metrics[metric] = metric(**capabilities) + + return self._metrics[metric] + + def compute_metric(self, metric: Type[BaseMetric]) -> float | int: + """Compute a single metric.""" + return self._get_metric(metric).value + + def compute_metrics( + self, + metrics: Sequence[Type[BaseMetric]] | Literal["all"], + save_as: str | os.PathLike | None = None, + pretty_print: bool = False, + ) -> dict[str, float | int]: + """Computes metrics and returns them as a dictionary. Optionally, saves the dictionary to a file. + + Args: + metrics: List of metrics to compute. If "all", all available metrics are computed. + save_as: Path to save the dictionary. If None, the dictionary is not saved. + pretty_print: If True, the dictionary is printed in a pretty format. + """ + + metrics_dict: dict[str, dict] = {} + metrics_classes = self.available_metrics if metrics == "all" else metrics + + for metric_cls in metrics_classes: + metric = self._get_metric(metric_cls) + logger.info(f"Computing metric {metric.name}") + metrics_dict[metric.name] = {"value": metric.value, "description": metric.description} + + if pretty_print: + logger.info( + json.dumps( + { + k: (round(v, 4) if isinstance(v, float) else v) + for (k, v) in metrics_dict.items() + }, + indent=4, + ) + ) + + if save_as is not None: + # Make sure that the directory exists + save_as = Path(save_as).resolve() + os.makedirs(save_as.parent, exist_ok=True) + with open(save_as, "w") as f: + json.dump(metrics_dict, f, indent=4) + logger.info(f"Saved metrics to {save_as}") + + return {k: v["value"] for k, v in metrics_dict.items()} + + def compute_all_metrics(self) -> dict[str, float | int]: + """Computes all available metrics.""" + return self.compute_metrics(self.available_metrics) + + def as_dataframe( + self, + metrics: Sequence[Type[BaseMetric]] | Literal["all"] | None = None, + save_as: str | os.PathLike | None = None, + ) -> DataFrame: + """Return aggregate metrics as a pandas DataFrame, along with additional information from each available capability.""" + + metrics = metrics or [] + metrics_classes = self.available_metrics if metrics == "all" else metrics + + data = { + "entry": list(self.capabilities[0].dataset), + **{ + metric.pre_aggregation_name: metric.pre_aggregation_values + for metric in [self._get_metric(m) for m in metrics_classes] + if isinstance(metric, BaseAggregateMetric) + }, + } + + df = DataFrame( + data=data, + index=[e.entry_id for e in self.capabilities[0].dataset], + ) + dfs = [df] + [cap.as_dataframe() for cap in self.capabilities] + assert all([len(df) == len(d) for d in dfs]), "DataFrames do not have the same length." + df = pd.concat(dfs, axis=1) + + if save_as is not None: + # convert the dataframe to a dict first to allow serialization/deserialization + # by monty.json. + dumpfn(df.to_dict("list"), save_as) + + return df + + T = TypeVar("T") + + @staticmethod + def filter(data: list[T], mask: numpy.typing.NDArray) -> list[T]: + """Filters a list of data points based on a boolean mask.""" + assert len(data) == len(mask), "Data and mask must have the same length." + return [x for x, m in zip(data, mask) if m] + + +def get_all_metrics_classes() -> list[Type[BaseMetric]]: + """Returns all metrics classes, except for base classes.""" + clsmembers: list[list[tuple[str, Type]]] = [ + getmembers(module, isclass) + for module in [energy_metrics, property_metrics, structure_metrics] + ] + metric_classes = [ + x[1] + for clsmembers_in_module in clsmembers + for x in clsmembers_in_module + if issubclass(x[1], BaseMetric) + ] + + return [m for m in metric_classes if not m.__name__.startswith("Base")] diff --git a/data/mattergen/evaluation/metrics/property.py b/data/mattergen/evaluation/metrics/property.py new file mode 100644 index 0000000000000000000000000000000000000000..d8283ab1d88a9eba413e11e16cd2a4aca90cb173 --- /dev/null +++ b/data/mattergen/evaluation/metrics/property.py @@ -0,0 +1,161 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from dataclasses import dataclass +from functools import cached_property + +import numpy as np +import numpy.typing +from pandas import DataFrame + +from mattergen.evaluation.metrics.core import BaseAggregateMetric, BaseMetric, BaseMetricsCapability +from mattergen.evaluation.metrics.energy import EnergyMetricsCapability +from mattergen.evaluation.metrics.structure import StructureMetricsCapability +from mattergen.evaluation.utils.metrics_structure_summary import MetricsStructureSummary +from mattergen.evaluation.utils.utils import PropertyConstraint + + +class PropertyMetricsCapability(BaseMetricsCapability): + name: str = "property_capability" + + """Capability for computing property metrics.""" + + def __init__( + self, + structure_summaries: list[MetricsStructureSummary], + property_constraints: dict[str, PropertyConstraint] | None = None, + n_failed_jobs: int = 0, + ) -> None: + super().__init__(structure_summaries=structure_summaries, n_failed_jobs=n_failed_jobs) + self.property_constraints = property_constraints + + @cached_property + def properties(self) -> dict[str, numpy.typing.NDArray]: + props = list(self._structure_summaries[0].properties) + assert all( + set(s.properties.keys()) == set(props) for s in self._structure_summaries + ), "Inconsistent property data." + return { + prop: np.array([s.properties[prop] for s in self._structure_summaries]) + for prop in props + } + + @property + def satisfies_property_constraints(self) -> numpy.typing.NDArray[np.bool_]: + """ + Returns a boolean mask of the same length as structure_summaries + indicating whether each entry satisfies the property constraints. + """ + + def _satisfies_property_constraint( + values: np.array, constraint: PropertyConstraint + ) -> numpy.typing.NDArray[np.bool_]: + # Check if values are within (min, max) constraints + mask = True if constraint[0] is None else values >= constraint[0] + mask &= True if constraint[1] is None else values <= constraint[1] + return mask + + assert self.property_constraints, "No property constraints specified." + + assert all( + key in self.properties for key in self.property_constraints + ), f"Property data and constraints do not match: {list(self.properties)} vs. {list(self.property_constraints)}." + + return np.all( + np.array( + [ + _satisfies_property_constraint(self.properties[key], constraint) + for key, constraint in self.property_constraints.items() + ], + dtype=bool, + ), + axis=0, + ) + + def as_dataframe(self) -> DataFrame: + data = {str(k): v for k, v in self.properties.items()} + if self.property_constraints: + data.update({"satisfies_property_constraints": self.satisfies_property_constraints}) + + return DataFrame( + data=data, + index=[e.entry_id for e in self.dataset], + ) + + +# -----------------------------# +# Metrics +# -----------------------------# + + +@dataclass(frozen=True) +class BasePropertyMetric(BaseMetric): + # Use for metrics that have access to structure, energy and property data. + # In principle, we could define metrics classes with fewer required capabilities, but this is not necessary for now. + required_capabilities = ( + StructureMetricsCapability, + EnergyMetricsCapability, + PropertyMetricsCapability, + ) + + @property + def name(self) -> str: + return "base_property_metric" + + def __init__( + self, + structure_capability: StructureMetricsCapability, + energy_capability: EnergyMetricsCapability, + property_capability: PropertyMetricsCapability, + **kwargs, # eat up unused kwargs (i.e., other capabilities) + ): + self.structure_capability = structure_capability + self.energy_capability = energy_capability + self.property_capability = property_capability + self.reference_dataset = self.energy_capability.reference_dataset + + +class FracStableStructuresWithProperties(BasePropertyMetric, BaseAggregateMetric): + name = "frac_stable_structures_with_properties" + pre_aggregation_name = "stable_with_properties" + + @property + def description(self) -> str: + return ( + f"Fraction of stable structures in sampled data within {self.energy_capability.stability_threshold} (eV/atom) " + + f"above convex hull of {self.reference_dataset.name} and that satisfy target property constraints." + ) + + @cached_property + def value(self) -> float: + return self.pre_aggregation_values.sum() / self.energy_capability.total_submitted_jobs + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return ( + self.energy_capability.is_stable + & self.property_capability.satisfies_property_constraints + ) + + +class FracNovelUniqueStableStructuresWithProperties(BasePropertyMetric, BaseAggregateMetric): + name = "frac_novel_unique_stable_structures_with_properties" + pre_aggregation_name = "novel_unique_stable_with_properties" + + @property + def description(self) -> str: + return ( + f"Fraction of novel unique stable structures in sampled data within {self.energy_capability.stability_threshold} (eV/atom) " + + f"above convex hull of {self.reference_dataset.name} and that satisfy target property constraints." + ) + + @cached_property + def value(self) -> float: + return self.pre_aggregation_values.sum() / self.property_capability.total_submitted_jobs + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return ( + self.structure_capability.is_novel + & self.structure_capability.is_unique + & self.energy_capability.is_stable + & self.property_capability.satisfies_property_constraints + ) diff --git a/data/mattergen/evaluation/metrics/structure.py b/data/mattergen/evaluation/metrics/structure.py new file mode 100644 index 0000000000000000000000000000000000000000..fa63be85cca750e3ae3a455a4039a839eaa2d6ee --- /dev/null +++ b/data/mattergen/evaluation/metrics/structure.py @@ -0,0 +1,526 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import itertools +from collections import Counter +from copy import deepcopy +from dataclasses import dataclass +from functools import cached_property +from typing import Literal, Sequence + +import cachetools +import numpy as np +import numpy.typing +import smact +from pandas import DataFrame +from pymatgen.core.composition import Element +from pymatgen.core.structure import Structure +from pymatgen.symmetry.analyzer import SpacegroupAnalyzer +from scipy.stats import wasserstein_distance +from smact.screening import pauling_test +from tqdm import tqdm + +from mattergen.evaluation.metrics.core import BaseAggregateMetric, BaseMetric, BaseMetricsCapability +from mattergen.evaluation.reference.reference_dataset import ReferenceDataset +from mattergen.evaluation.utils.dataset_matcher import ( + DisorderedDatasetUniquenessComputer, + OrderedDatasetUniquenessComputer, + get_dataset_matcher, + matches_to_mask, +) +from mattergen.evaluation.utils.logging import logger +from mattergen.evaluation.utils.metrics_structure_summary import MetricsStructureSummary +from mattergen.evaluation.utils.structure_matcher import ( + DisorderedStructureMatcher, + OrderedStructureMatcher, +) +from mattergen.evaluation.utils.symmetry_analysis import ( + DefaultSpaceGroupAnalyzer, + DisorderedSpaceGroupAnalyzer, +) + + +def get_space_group( + structure: Structure, + space_group_analyzer_cls: type[SpacegroupAnalyzer] = DefaultSpaceGroupAnalyzer, +) -> str: + try: + return space_group_analyzer_cls(structure=structure).get_space_group_symbol() + except TypeError: + # space group analysis failed, most likely due to overlapping atoms + return "P1" + + +def all_structures_are_ordered(structures: Sequence[Structure]) -> bool: + """Check if all structures are ordered.""" + return all([s.is_ordered for s in structures]) + + +class StructureMetricsCapability(BaseMetricsCapability): + name: str = "structure_capability" + + """Capability for computing structure metrics. + The `structure_matcher` class determines how uniqueness and novelty are computed. + atoms that could substitute for each other (via the Hume-Rothery rules) and then using the default pymatgen structure matching. + """ + + def __init__( + self, + structure_summaries: list[MetricsStructureSummary], + reference_dataset: ReferenceDataset, + structure_matcher: OrderedStructureMatcher + | DisorderedStructureMatcher, # how are uniqueness and novelty computed + n_failed_jobs: int = 0, + ) -> None: + super().__init__(structure_summaries=structure_summaries, n_failed_jobs=n_failed_jobs) + _structures = [s.structure for s in structure_summaries] + all_structures_ordered = ( + all_structures_are_ordered(_structures) and reference_dataset.is_ordered + ) + if not all_structures_ordered: + assert isinstance(structure_matcher, DisorderedStructureMatcher), ( + "If at least one structure is disordered, " + "structure_matcher must be a DisorderedStructureMatcher." + ) + logger.info( + "At least one structure is disordered. Using DisorderedDatasetUniquenessComputer." + ) + self.reference_dataset = reference_dataset # note: not all metrics use this, so it could be a separate capability + self.structure_matcher = structure_matcher + self.ensure_reference_dataset_has_material_ids() + self.uniqueness_computer: OrderedDatasetUniquenessComputer | DisorderedDatasetUniquenessComputer = ( + OrderedDatasetUniquenessComputer(structure_matcher) + if all_structures_ordered + else DisorderedDatasetUniquenessComputer(structure_matcher) + ) + self.dataset_matcher = get_dataset_matcher(all_structures_ordered, structure_matcher) + + def ensure_reference_dataset_has_material_ids(self) -> None: + """ + We're using material_ids to match structures between the reference dataset and the data. + If the reference dataset doesn't have material_ids, we add them here and set them + to the index of the entry in the reference dataset. + """ + if ( + len(self.reference_dataset) > 0 + and next(iter(self.reference_dataset)).data.get("material_id") is None + ): + logger.warning( + "Reference dataset does not have material_ids. Adding material_ids to reference dataset." + ) + for i, entry in enumerate(self.reference_dataset): + if "material_id" in entry.data: + raise ValueError( + "Found material_id in some entries of the reference dataset, but not all." + "Please ensure that either all entries have material_ids or none do." + ) + entry.data["material_id"] = i + + @property + def structures(self) -> list[Structure]: + return [s.structure for s in self._structure_summaries] + + @cached_property + def chemistry_agnostic_structures(self) -> list[Structure]: + chemistry_agnostic_structures = [deepcopy(s) for s in self.structures] + for s in chemistry_agnostic_structures: + s.replace_species({Element(k.name): Element("Cs") for k in list(set(s.species))}) + + return chemistry_agnostic_structures + + @cached_property + def is_unique(self) -> numpy.typing.NDArray[np.bool_]: + """ + Returns a boolean mask of the same length as `data_entries` in which each item is True + for the first structure from a set of duplicates and otherwise False. + """ + return self.uniqueness_computer(self.dataset) + + @cached_property + def is_novel(self) -> numpy.typing.NDArray[np.bool_]: + """ + Returns a boolean mask of the same length as `data_entries` in which each item is True + for structures that are not present in the reference dataset and otherwise False. + """ + novelty_mask = np.logical_not(self.is_in_reference) + return novelty_mask + + @cached_property + def is_in_reference(self) -> numpy.typing.NDArray[np.bool_]: + """ + Returns a boolean mask of the same length as `data_entries` in which each item is True + for structures that are present in the reference dataset and otherwise False. + """ + + return matches_to_mask(self.matches_in_reference.keys(), len(self.dataset)) + + @cached_property + def matches_in_reference(self) -> dict[int, list[str]]: + return self.dataset_matcher(self.dataset, self.reference_dataset) + + @cached_property + def is_explored(self) -> numpy.typing.NDArray[np.bool_]: + """Returns a mask of whether structures are in explored chemical systems (>1 entry in reference).""" + return np.array( + [ + structure.composition.chemical_system in self.reference_dataset.entries_by_chemsys + for structure in self.structures + ] + ) + + def as_dataframe(self) -> DataFrame: + return DataFrame( + data={ + # including is_unique and is_novel here might trigger an expensive computation + "is_unique": self.is_unique, + "is_novel": self.is_novel, + "is_explored": self.is_explored, + }, + index=[e.entry_id for e in self.dataset], + ) + + @cached_property + def num_atoms(self) -> numpy.typing.NDArray[np.int_]: + return np.array([len(structure) for structure in self.structures]) + + @cached_property + def space_group_symbols(self) -> list[str]: + return [get_space_group(structure) for structure in self.structures] + + @cached_property + def chemistry_agnostic_space_group_symbols(self) -> list[str]: + return [get_space_group(structure) for structure in self.chemistry_agnostic_structures] + + @cached_property + def substitution_aware_space_group_symbols(self) -> list[str]: + """ + Returns a list of space group symbols for each structure in the dataset, once the + structures have been modified to account for possible substitutions of atoms that + could substitute for each other (via the Hume-Rothery rules). + """ + return [ + get_space_group(structure, DisorderedSpaceGroupAnalyzer) + for structure in self.structures + ] + + # Ignore "desc" for the cache because it is irrelevant. + @cachetools.cached(cache={}, key=lambda self, *args, **kwargs: self) + def compute_num_matches( + self, + desc: str = "", + ) -> float: + """ + Returns the number of matches between the data and reference entries. + """ + num_matches = len(self.is_novel) - sum(self.is_novel) + return num_matches + + +# -----------------------------# +# Metrics +# -----------------------------# + + +@dataclass(frozen=True) +class BaseStructureMetric(BaseMetric): + # Use for metrics that have access to structure data. + required_capabilities = (StructureMetricsCapability,) + + @property + def name(self) -> str: + return "base_structure_metric" + + def __init__( + self, + structure_capability: StructureMetricsCapability, + **kwargs, # eat up unused kwargs (i.e., other capabilities) + ): + self.structure_capability = structure_capability + self.reference_dataset = self.structure_capability.reference_dataset + self.dataset = self.structure_capability.dataset + + +class FracUniqueSystems(BaseStructureMetric): + name = "frac_unique_systems" + + @property + def description(self) -> str: + return "Fraction of structures in sampled data that have a unique chemical system within this set." + + @cached_property + def value(self) -> float: + # number of distinct chemical systems + return len( + set( + structure.composition.chemical_system + for structure in self.structure_capability.structures + ) + ) / len(self.structure_capability.structures) + + +class Precision(BaseStructureMetric): + name = "precision" + + @property + def description(self) -> str: + return f"Precision of structures in sampled data compared with {self.reference_dataset.name}. This is the fraction of structures in sampled data that have a matching structure in {self.reference_dataset.name}." + + @cached_property + def value(self) -> float: + """ + Returns the fraction of structures in self.data.data_structures that are present in + self.reference_structures. + """ + return self.structure_capability.is_in_reference.mean() + + +class Recall(BaseStructureMetric): + name = "recall" + + @property + def description(self) -> str: + return f"Recall of structures in sampled data compared with structures in {self.reference_dataset.name}. This is the fraction of structures in sampled data that have a matching structure in {self.reference_dataset.name}." + + @cached_property + def value(self) -> float: + """ + Fraction of reference_structures that are in data_structures + """ + match_dict = self.structure_capability.matches_in_reference + ref_points_with_at_least_one_match = set([val for v in match_dict.values() for val in v]) + return len(ref_points_with_at_least_one_match) / len(self.reference_dataset) + + +class FracUniqueStructures(BaseStructureMetric, BaseAggregateMetric): + aggregation_method: Literal["mean"] = "mean" + name = "frac_unique_structures" + pre_aggregation_name = "unique" + + @property + def description(self) -> str: + return "Fraction of unique structures in sampled data." + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return self.structure_capability.is_unique + + +class FracNovelStructures(BaseStructureMetric, BaseAggregateMetric): + aggregation_method: Literal["mean"] = "mean" + name = "frac_novel_structures" + pre_aggregation_name = "novel" + + @property + def description(self) -> str: + return "Fraction of novel structures in sampled data." + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return self.structure_capability.is_novel + + +class FracNovelUniqueStructures(BaseStructureMetric, BaseAggregateMetric): + aggregation_method: Literal["mean"] = "mean" + name = "frac_novel_unique_structures" + pre_aggregation_name = "novel_unique" + + @property + def description(self) -> str: + return "Fraction of novel unique structures in sampled data." + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return self.structure_capability.is_novel & self.structure_capability.is_unique + + +class AvgStructureValidity(BaseStructureMetric, BaseAggregateMetric): + aggregation_method: Literal["mean"] = "mean" + name = "avg_structure_validity" + pre_aggregation_name = "structure_validity" + + @property + def description(self) -> str: + return "Average structural validity of structures in sampled data. Any atom-atom distances less than 0.5 Angstroms or a volume less than 0.1 Angstrom**3 are considered invalid ." + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return np.array( + [ + structure_validity(structure=structure) + for structure in tqdm( + self.structure_capability.structures, desc="Computing avg structure validity" + ) + ] + ) + + +class AvgCompValidity(BaseStructureMetric, BaseAggregateMetric): + aggregation_method: Literal["mean"] = "mean" + name = "avg_comp_validity" + pre_aggregation_name = "comp_validity" + + @property + def description(self) -> str: + return "Average composition validity (according to smact) of structures in sampled data." + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + return np.array( + [ + is_smact_valid(structure=structure) + for structure in tqdm( + self.structure_capability.structures, desc="Computing avg comp validity" + ) + ] + ) + + +class AvgStructureCompValidity(BaseStructureMetric, BaseAggregateMetric): + aggregation_method: Literal["mean"] = "mean" + name = "avg_structure_comp_validity" + pre_aggregation_name = "structure_comp_validity" + + @property + def description(self) -> str: + return "Average number of structures in sampled data that are both valid structures and have a valid smact compositions." + + def compute_pre_aggregation_values(self) -> numpy.typing.NDArray: + valid_comp = [ + structure_validity(structure=structure) + for structure in self.structure_capability.structures + ] + valid_struct = [ + is_smact_valid(structure=structure) + for structure in self.structure_capability.structures + ] + return np.array(valid_comp) & np.array(valid_struct) + + +class FracNovelSystems(BaseStructureMetric): + name = "frac_novel_systems" + + @property + def description(self) -> str: + return f"Fraction of distinct chemical systems in sampled data and not in {self.reference_dataset.name}." + + @cached_property + def value(self) -> float: + chemical_systems = set( + [ + structure.composition.chemical_system + for structure in self.structure_capability.structures + ] + ) + return len( + [ + chemsys + for chemsys in chemical_systems + if chemsys not in self.reference_dataset.entries_by_chemsys + ] + ) / len(self.structure_capability.structures) + + +# -----------------------------# +# Utility functions +# -----------------------------# + + +def is_smact_valid(structure: Structure) -> bool: + """ + Returns True if the structure is valid according to the + smact validity checker else False. + """ + elem_counter = Counter(structure.atomic_numbers) + composition = [(elem, elem_counter[elem]) for elem in sorted(elem_counter.keys())] + elems, counts = list(zip(*composition)) + counts = np.array(counts) + counts = counts / np.gcd.reduce(counts) + comps: tuple[int, ...] = tuple(np.array(counts).astype("int")) + try: + return smact_validity(comp=elems, count=comps, use_pauling_test=True, include_alloys=True) + except TypeError: + raise TypeError( + f"SMACT validity checker failed. Check that all elements {structure.composition} present in the structure are also present in smact.element_dictionary()." + ) + # HOTFIX: decode error sometimes occurrs the first time the smact_validity function is called, but not after that + except UnicodeDecodeError: + return smact_validity(comp=elems, count=comps, use_pauling_test=True, include_alloys=True) + + +def smact_validity( + comp: tuple[int, ...] | tuple[str, ...], + count: tuple[int, ...], + use_pauling_test: bool = True, + include_alloys: bool = True, + include_cutoff: bool = False, + use_element_symbol: bool = False, +) -> bool: + """Computes SMACT validity. + + Args: + comp: Tuple of atomic number or element names of elements in a crystal. + count: Tuple of counts of elements in a crystal. + use_pauling_test: Whether to use electronegativity test. That is, at least in one + combination of oxidation states, the more positive the oxidation state of a site, + the lower the electronegativity of the element for all pairs of sites. + include_alloys: if True, returns True without checking charge balance or electronegativity + if the crystal is an alloy (consisting only of metals) (default: True). + include_cutoff: assumes valid crystal if the combination of oxidation states is more + than 10^6 (default: False). + + Returns: + True if the crystal is valid, False otherwise. + """ + assert len(comp) == len(count) + if use_element_symbol: + elem_symbols = comp + else: + elem_symbols = tuple([str(Element.from_Z(Z=elem)) for elem in comp]) # type:ignore + space = smact.element_dictionary(elem_symbols) + smact_elems = [e[1] for e in space.items()] + electronegs = [e.pauling_eneg for e in smact_elems] + ox_combos = [e.oxidation_states for e in smact_elems] + if len(set(elem_symbols)) == 1: + return True + if include_alloys: + is_metal_list = [elem_s in smact.metals for elem_s in elem_symbols] + if all(is_metal_list): + return True + + threshold = np.max(count) + compositions = [] + n_comb = np.prod([len(ls) for ls in ox_combos]) + # If the number of possible combinations is big, it'd take too much time to run the smact checker + # In this case, we assume that at least one of the combinations is valid + if n_comb > 1e6 and include_cutoff: + return True + for ox_states in itertools.product(*ox_combos): + stoichs = [(c,) for c in count] + # Test for charge balance + cn_e, cn_r = smact.neutral_ratios(ox_states, stoichs=stoichs, threshold=threshold) + # Electronegativity test + if cn_e: + if use_pauling_test: + try: + electroneg_OK = pauling_test(ox_states, electronegs) + except TypeError: + # if no electronegativity data, assume it is okay + electroneg_OK = True + else: + electroneg_OK = True + if electroneg_OK: + for ratio in cn_r: + compositions.append(tuple([elem_symbols, ox_states, ratio])) + compositions = [(i[0], i[2]) for i in compositions] + compositions = list(set(compositions)) + if len(compositions) > 0: + return True + else: + return False + + +def structure_validity(structure: Structure, cutoff: float = 0.5) -> bool: + dist_mat = structure.distance_matrix + # Pad diagonal with a large number + dist_mat = dist_mat + np.diag(np.ones(dist_mat.shape[0]) * (cutoff + 10.0)) + # Note: the threshold 0.1 comes from the CDVAE code + # https://github.com/txie-93/cdvae/blob/f857f598d6f6cca5dc1ea0582d228f12dcc2c2ea/scripts/eval_utils.py#L170 + if dist_mat.min() < cutoff or structure.volume < 0.1: + return False + else: + return True diff --git a/data/mattergen/evaluation/reference/__init__.py b/data/mattergen/evaluation/reference/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/evaluation/reference/presets.py b/data/mattergen/evaluation/reference/presets.py new file mode 100644 index 0000000000000000000000000000000000000000..83229a741e71b746bcbcee751a45f1fdc8e868b1 --- /dev/null +++ b/data/mattergen/evaluation/reference/presets.py @@ -0,0 +1,31 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from pathlib import Path +from functools import cached_property + +from mattergen.evaluation.reference.reference_dataset import ReferenceDataset +from mattergen.evaluation.reference.reference_dataset_serializer import LMDBGZSerializer + + +class ReferenceMP2020Correction(ReferenceDataset): + """Reference dataset using the MP2020 Energy Correction scheme. + This dataset contains entries from the Materials Project [https://next-gen.materialsproject.org/] + and Alexandria [https://next-gen.materialsproject.org/]. + All 845,997 structures are relaxed using the GGA-PBE functional and have energy corrections applied using the MP2020 scheme. + """ + + def __init__(self): + super().__init__("MP2020correction", ReferenceMP2020Correction.from_preset()) + + @classmethod + def from_preset(cls) -> "ReferenceMP2020Correction": + current_dir = Path(__file__).parent + return LMDBGZSerializer().deserialize( + f"{current_dir}/../../../data-release/alex-mp/reference_MP2020correction.gz" + ) + + @cached_property + def is_ordered(self) -> bool: + """Returns True if all structures are ordered.""" + return True # Setting it manually to avoid computation at runtime. diff --git a/data/mattergen/evaluation/reference/reference_dataset.py b/data/mattergen/evaluation/reference/reference_dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..c3136eb8b7c84bdafe7b61a12191cb041625c5d4 --- /dev/null +++ b/data/mattergen/evaluation/reference/reference_dataset.py @@ -0,0 +1,95 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from functools import cached_property +from typing import Iterable, Iterator, Mapping + +import numpy as np +from pymatgen.entries.computed_entries import ComputedStructureEntry + +from mattergen.evaluation.utils.symmetry_analysis import ( + DefaultSpaceGroupAnalyzer, + DisorderedSpaceGroupAnalyzer, +) +from mattergen.evaluation.utils.utils import generate_chemsys_dict, generate_reduced_formula_dict + + +class ReferenceDataset(Iterable[ComputedStructureEntry]): + """Immutable collection of reference entries with the ability to cache + some computation (e.g., space groups). + """ + + def __init__( + self, + name: str, + impl: "ReferenceDatasetImpl", + ): + self.name = name + # The Bridge pattern. The actual implementation is defined in ReferenceDatasetImpl. + self.impl = impl + + @staticmethod + def from_entries(name: str, entries: Iterable[ComputedStructureEntry]) -> "ReferenceDataset": + return ReferenceDataset(name, ReferenceDatasetImpl(entries)) + + def __iter__(self) -> Iterator[ComputedStructureEntry]: + yield from self.impl + + def __len__(self) -> int: + return len(self.impl) + + @property + def entries_by_reduced_formula(self) -> Mapping[str, list[ComputedStructureEntry]]: + return self.impl.entries_by_reduced_formula + + @property + def entries_by_chemsys(self) -> Mapping[str, list[ComputedStructureEntry]]: + return self.impl.entries_by_chemsys + + @cached_property + def space_group_numbers(self) -> dict[str, float]: + return np.array([DefaultSpaceGroupAnalyzer(e.structure).get_space_group_number() for e in self]) + + @cached_property + def disordered_space_group_numbers(self) -> dict[str, float]: + return np.array([DisorderedSpaceGroupAnalyzer(e.structure).get_space_group_number() for e in self]) + + @cached_property + def lattice_angles(self) -> np.typing.NDArray[np.float64]: + """Returns a list containing all the lattice angles in the dataset (shape=(Ncrystals*3, )).""" + return np.concatenate([e.structure.lattice.angles for e in self]) + + @cached_property + def densities(self) -> np.typing.NDArray[np.float64]: + """Returns a list containing the density for each structure in the dataset.""" + return np.array([e.structure.density for e in self]) + + @cached_property + def is_ordered(self) -> bool: + """Returns True if all structures are ordered.""" + return all(e.structure.is_ordered for e in self) + + +class ReferenceDatasetImpl(Iterable[ComputedStructureEntry]): + """The implementation of ReferenceDataset. Direct access to entries is not allowed.""" + + def __init__(self, entries: Iterable[ComputedStructureEntry]): + self._entries = tuple(entries) + + def __iter__(self) -> Iterator[ComputedStructureEntry]: + return iter(self._entries) + + def __len__(self) -> int: + return len(self._entries) + + @cached_property + def entries_by_reduced_formula(self) -> Mapping[str, list[ComputedStructureEntry]]: + """This is a slow path. Subclasses may override entries_by_reduced_formula method + to avoid calling this method.""" + return generate_reduced_formula_dict(self._entries) + + @cached_property + def entries_by_chemsys(self) -> Mapping[str, list[ComputedStructureEntry]]: + """This is a slow path. Subclasses may override entries_by_chemsys method + to avoid calling this method.""" + return generate_chemsys_dict(self._entries) diff --git a/data/mattergen/evaluation/reference/reference_dataset_serializer.py b/data/mattergen/evaluation/reference/reference_dataset_serializer.py new file mode 100644 index 0000000000000000000000000000000000000000..bb33d57f32c13a408d638f7a51c87444be2dff32 --- /dev/null +++ b/data/mattergen/evaluation/reference/reference_dataset_serializer.py @@ -0,0 +1,372 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import gzip +import os +import pickle +import shutil +import weakref +from collections import defaultdict +from functools import cached_property +from pathlib import Path +from tempfile import mkdtemp +from typing import Any, DefaultDict, Iterator, Mapping + +import lmdb # type: ignore [import] +from monty.json import MontyDecoder +from pymatgen.core import Composition +from pymatgen.entries.computed_entries import ComputedStructureEntry +from tqdm.autonotebook import tqdm + +from mattergen.evaluation.reference.reference_dataset import ReferenceDataset, ReferenceDatasetImpl +from mattergen.evaluation.utils.lmdb_utils import lmdb_get, lmdb_open, lmdb_read_metadata + + +def gzip_compress(file_path: str | os.PathLike, output_dir: str | os.PathLike) -> Path: + """Compresses a file using gzip. Returns the compressed file path.""" + output_path = Path(output_dir) / (Path(file_path).name + ".gz") + with open(file_path, "rb") as fin: + with gzip.open(output_path, "wb") as fout: + fout.write(fin.read()) + return output_path + + +def gzip_decompress(gzip_file_path: str | os.PathLike, output_dir: str | os.PathLike) -> Path: + """Decompresses a gzipped file. Returns the decompressed file path.""" + output_path = Path(output_dir) / Path(gzip_file_path).name[:-3] # remove .gz + with gzip.open(gzip_file_path, "rb") as fin: + with open(output_path, "wb") as fout: + fout.write(fin.read()) + return output_path + + +class LmdbNotFoundError(Exception): + pass + + +def lmdb_open(db_path: str | os.PathLike, readonly: bool = False) -> lmdb.Environment: + if readonly: + return lmdb.open( + str(db_path), + subdir=False, + readonly=True, + lock=False, + readahead=False, + meminit=False, + max_readers=1, + ) + else: + return lmdb.open( + str(db_path), + map_size=1099511627776 * 2, + subdir=False, + meminit=False, + map_async=True, + ) + + +def lmdb_read_metadata(db_path: str | os.PathLike, key: str, default=None) -> Any: + with lmdb_open(db_path, readonly=True) as db: + with db.begin() as txn: + result = lmdb_get(txn, key, default=default) + return result + + +def lmdb_get( + txn: lmdb.Transaction, key: str, default: Any = None, raise_if_missing: bool = True +) -> Any: + """ + Fetches a record from a database. + + Args: + txn: LMDB transaction (use env.begin()) + key: key of the data to be fetched. + default: default value to be used if the record doesn't exist. + raise_if_missing: raise LmdbNotFoundError if the record doesn't exist + and no default value was given. + + Returns: + the value of the retrieved data. + """ + value = txn.get(key.encode("ascii")) + if value is None: + if default is None and raise_if_missing: + raise LmdbNotFoundError( + f"Key {key} not found in database but default was not provided." + ) + return default + return pickle.loads(value) + + +def lmdb_put(txn: lmdb.Transaction, key: str, value: Any) -> bool: + """ + Stores a record in a database. + + Args: + txn: LMDB transaction (use env.begin()) + key: key of the data to be stored. + value: value of the data to be stored (needs to be picklable). + + Returns: + True if it was written. + """ + return txn.put( + key.encode("ascii"), + pickle.dumps(value, protocol=pickle.HIGHEST_PROTOCOL), + ) + + +class LMDBGZSerializer(): + def __init__( + self, + ): + pass + + def serialize(self, ref_dataset: ReferenceDataset, dataset_path: str | os.PathLike) -> None: + """Writes a dataset to a file using the gzip-compressed LMDB format.""" + lmdb_file_path = str(dataset_path)[:-3] # remove .gz + with lmdb_open(lmdb_file_path, readonly=False) as env: + # Store the metadata + with env.begin(write=True) as txn: + lmdb_put(txn, "name", ref_dataset.name) + + # Entries are stored under the key "{chemsys}.{reduced_formula}.{n}" + # where n is the index of the entry within the reduced_formula. + # This enables us to retrieve entries for a given reduced_formula + # or chemical system. + counter: DefaultDict[str, DefaultDict[str, int]] = defaultdict(lambda: defaultdict(int)) + for entry in tqdm(ref_dataset, desc="Serializing dataset", total=len(ref_dataset)): + entry.structure.unset_charge() + structure_without_oxidation_states = entry.structure.remove_oxidation_states() + entry = ComputedStructureEntry.from_dict( + { + **entry.as_dict(), + "structure": structure_without_oxidation_states, + "composition": structure_without_oxidation_states.composition, + } + ) + chemsys = "-".join(sorted({el.symbol for el in entry.composition.elements})) + reduced_formula = entry.composition.reduced_formula + n = counter[chemsys][reduced_formula] + key = f"{chemsys}.{reduced_formula}.{n}" + with env.begin(write=True) as txn: + lmdb_put(txn, key, entry.as_dict()) + counter[chemsys][reduced_formula] += 1 + # Store the list of chemical systems + chemical_systems = list(counter.keys()) + with env.begin(write=True) as txn: + lmdb_put(txn, "chemical_systems", chemical_systems) + for chemsys, length_by_reduced_formula in tqdm( + counter.items(), desc="Saving indexes", total=len(counter) + ): + # Store the list of reduced formulas in this chemical system + reduced_formulas = list(length_by_reduced_formula.keys()) + with env.begin(write=True) as txn: + lmdb_put(txn, f"{chemsys}.reduced_formulas", reduced_formulas) + # Store the number of entries for each reduced formula + for reduced_formula, length in length_by_reduced_formula.items(): + with env.begin(write=True) as txn: + lmdb_put(txn, f"{chemsys}.{reduced_formula}.length", length) + gzip_compress(lmdb_file_path, Path(dataset_path).parent) + + def deserialize(self, dataset_path: str | os.PathLike) -> ReferenceDataset: + """Reads a dataset from a file using the gzip-compressed LMDB format.""" + tempdir = mkdtemp() + lmdb_path = gzip_decompress(dataset_path, tempdir) + name = lmdb_read_metadata(lmdb_path, "name") + return ReferenceDataset( + name=name, + impl=LMDBBackedReferenceDatasetImpl(lmdb_path, cleanup_dir=True), + ) + + +class LMDBBackedReferenceDatasetImpl(ReferenceDatasetImpl): + """Implementation of ReferenceDataset backed by LMDB. + + Expected LMDB structure: + { + "chemical_systems": ["Li-P", "Li-S", ...], + "Li-P.reduced_formulas": ["LiP", "LiP2", ...], + "Li-P.LiP.length": 4, + "Li-P.LiP.0": "<pickled dictionary representation of a ComputedStructureEntry>", + ... + "Li-P.LiP.3": "<pickled dictionary representation of a ComputedStructureEntry>", + "Li-P.LiP2.length": 1, + ... + "Li-S.Li2S.length": 2, + ... + } + """ + + def __init__(self, lmdb_path: Path, cleanup_dir: bool = False): + """Initializes the LMDB-backed reference dataset. + + Args: + lmdb_path: path to the LMDB database. + cleanup_dir: whether to delete the directory containing the database when this object + is garbage collected (default: False). + """ + self.env = lmdb_open(lmdb_path, readonly=True) + self.num_entries_by_chemsys_reduced_formulas = ( + self._build_num_entries_by_chemsys_reduced_formulas(lmdb_path) + ) + self.total_num_entries = sum( + sum(d.values()) for d in self.num_entries_by_chemsys_reduced_formulas.values() + ) + # close the LMDB environment when this object is garbage collected + weakref.finalize(self, self._cleanup, self.env, cleanup_dir) + + def _build_num_entries_by_chemsys_reduced_formulas( + self, lmdb_path: Path + ) -> dict[str, dict[str, int]]: + chemical_systems = lmdb_read_metadata(lmdb_path, "chemical_systems") + result: defaultdict[str, dict[str, int]] = defaultdict(dict) + with self.env.begin() as txn: + for chemsys in chemical_systems: + reduced_formulas = lmdb_read_metadata(lmdb_path, f"{chemsys}.reduced_formulas") + for reduced_formula in reduced_formulas: + result[chemsys][reduced_formula] = lmdb_get( + txn, f"{chemsys}.{reduced_formula}.length" + ) + # convert to an ordinary dictionary + return {key: val for key, val in result.items()} + + def __iter__(self) -> Iterator[ComputedStructureEntry]: + """Iterates over the entries in the dataset.""" + for ( + chemsys, + num_entries_by_reduced_formula, + ) in self.num_entries_by_chemsys_reduced_formulas.items(): + for reduced_formula in num_entries_by_reduced_formula: + yield from self.get_entries_by_chemsys_reduced_formula(chemsys, reduced_formula) + + def __len__(self) -> int: + return self.total_num_entries + + @property + def chemical_systems(self) -> tuple[str, ...]: + return tuple(self.num_entries_by_chemsys_reduced_formulas.keys()) + + @cached_property + def reduced_formulas(self) -> tuple[str, ...]: + return tuple( + [ + reduced_formula + for num_entries_by_reduced_formula in self.num_entries_by_chemsys_reduced_formulas.values() + for reduced_formula in num_entries_by_reduced_formula + ] + ) + + def get_entries_by_chemsys(self, chemsys: str) -> Iterator[ComputedStructureEntry]: + for reduced_formula in self.num_entries_by_chemsys_reduced_formulas[chemsys].keys(): + yield from self.get_entries_by_chemsys_reduced_formula(chemsys, reduced_formula) + + def get_entries_by_reduced_formula( + self, reduced_formula: str + ) -> Iterator[ComputedStructureEntry]: + chemsys = Composition(reduced_formula).chemical_system + yield from self.get_entries_by_chemsys_reduced_formula(chemsys, reduced_formula) + + def get_entries_by_chemsys_reduced_formula( + self, chemsys: str, reduced_formula: str + ) -> Iterator[ComputedStructureEntry]: + length = self.num_entries_by_chemsys_reduced_formulas[chemsys][reduced_formula] + for i in range(length): + with self.env.begin() as txn: + entry_dict = lmdb_get(txn, f"{chemsys}.{reduced_formula}.{i}") + yield MontyDecoder().process_decoded(entry_dict) + + @cached_property + def entries_by_reduced_formula(self) -> "LMDBBackedReducedFormulaLookup": + """Returns a mapping from reduced formula to entries.""" + return LMDBBackedReducedFormulaLookup(self) + + @cached_property + def entries_by_chemsys(self) -> "LMDBBackedChemicalSystemLookup": + """Returns a mapping from chemical system to entries.""" + return LMDBBackedChemicalSystemLookup(self) + + @classmethod + def _cleanup(cls, env: lmdb.Environment, cleanup_dir: bool) -> None: + """Closes the LMDB environment and deletes the directory containing the database. + + This needs to be a class method to prevent additional reference to the object. + """ + try: + database_dir = Path(env.path()).parent + except lmdb.Error: + # The environment has already been closed. + return + print(f"Closing LMDB environment {env.path()}") + env.close() + if cleanup_dir: + shutil.rmtree(database_dir) + + def cleanup(self, cleanup_dir: bool = False) -> None: + """Closes the LMDB environment and optionally cleanup the directory containing the database.""" + self._cleanup(self.env, cleanup_dir) + + +class WeakRefImplMixin: + """A mixin class that makes the reference to the underlying + LMDBBackedReferenceDatasetImpl object weak.""" + + def __init__(self, impl: LMDBBackedReferenceDatasetImpl): + # We need to use a weak reference to avoid cyclic reference that + # prevents LMDBBackedReferenceDatasetImpl from being garbage collected. + self._impl = weakref.ref(impl) + + @property + def impl(self) -> LMDBBackedReferenceDatasetImpl: + # Returns the LMDBBackedReferenceDatasetImpl object ensuring that + # the reference is still valid. + impl = self._impl() + assert impl is not None + return impl + + +class LMDBBackedChemicalSystemLookup(WeakRefImplMixin, Mapping[str, list[ComputedStructureEntry]]): + """A lazy immutable mapping from chemical system to entries. It is + lazy in the sense that the entries are read from the disk only when + the user requests them.""" + + def __init__(self, impl: LMDBBackedReferenceDatasetImpl): + super().__init__(impl) + self.chemical_systems = frozenset(self.impl.chemical_systems) + + def __len__(self) -> int: + return len(self.impl.chemical_systems) + + def __iter__(self) -> Iterator[str]: + # keep the original order + return iter(self.impl.chemical_systems) + + def __contains__(self, chemical_system: object) -> bool: + return chemical_system in self.chemical_systems + + def __getitem__(self, chemical_system: str) -> list[ComputedStructureEntry]: + return list(self.impl.get_entries_by_chemsys(chemical_system)) + + +class LMDBBackedReducedFormulaLookup(WeakRefImplMixin, Mapping[str, list[ComputedStructureEntry]]): + """A lazy immutable mapping from reduced formula to entries. It is + lazy in the sense that the entries are read from the disk only when + the user requests them.""" + + def __init__(self, impl: LMDBBackedReferenceDatasetImpl): + super().__init__(impl) + self.reduced_formulas = frozenset(self.impl.reduced_formulas) + + def __len__(self) -> int: + return len(self.reduced_formulas) + + def __iter__(self) -> Iterator[str]: + # keep the original order + return iter(self.impl.reduced_formulas) + + def __contains__(self, reduced_formula: object) -> bool: + return reduced_formula in self.reduced_formulas + + def __getitem__(self, reduced_formula: str) -> list[ComputedStructureEntry]: + """Returns a list of entries with the given reduced formula.""" + return list(self.impl.get_entries_by_reduced_formula(reduced_formula)) diff --git a/data/mattergen/evaluation/utils/__init__.py b/data/mattergen/evaluation/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/evaluation/utils/dataset_matcher.py b/data/mattergen/evaluation/utils/dataset_matcher.py new file mode 100644 index 0000000000000000000000000000000000000000..7e5915c3531284bc822408edd4c690af73c7a148 --- /dev/null +++ b/data/mattergen/evaluation/utils/dataset_matcher.py @@ -0,0 +1,256 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from collections import defaultdict +from typing import Iterable, List, Mapping + +import numpy as np +from pymatgen.analysis.structure_matcher import StructureMatcher +from pymatgen.core.structure import Structure +from pymatgen.entries.computed_entries import ComputedStructureEntry +from tqdm import tqdm + +from mattergen.evaluation.reference.reference_dataset import ReferenceDataset +from mattergen.evaluation.utils.logging import logger +from mattergen.evaluation.utils.structure_matcher import ( + DefaultDisorderedStructureMatcher, + DisorderedStructureMatcher, + OrderedStructureMatcher, +) + + +def get_matches( + structure_matcher: StructureMatcher, d1: List[Structure], d2: List[Structure] +) -> dict[int, list[int]]: + """ + Iterates d1 to find matches in d2. + + Args: + structure_matcher: StructureMatcher to use for comparison. + d1: List of structures to compare. + d2: List of structures to compare against. + + Returns: + matches: Dictionary of matches. Key is the index of the structure in d1 and value is the index of the structure in d2. + + """ + matches: dict[int, list[int]] = defaultdict(list) + + for i in range(len(d1)): + for j in range(len(d2)): + if structure_matcher.fit(d1[i], d2[j]): + matches[i].append(j) + return matches + + +def get_unique(structure_matcher: StructureMatcher, structures: List[Structure]) -> List[int]: + + if len(structures) == 1: + return [0] + + unique_structures: list[Structure] = [] + unique_idx: list[int] = [] + for idx, structure in enumerate(structures): + unique = True + for structure_2 in unique_structures: + if structure_matcher.fit(structure, structure_2): + unique = False + break + if unique: + unique_structures.append(structure) + unique_idx.append(idx) + + return unique_idx + + +def get_dataset_matcher( + all_structures_ordered: bool, structure_matcher: StructureMatcher +) -> "DatasetMatcher": + if all_structures_ordered: + return OrderedDatasetMatcher(structure_matcher) + return DisorderedDatasetMatcher(structure_matcher) + + +def get_global_index_from_local_index( + entries_mapping_by_key: Mapping[str, list[ComputedStructureEntry]], + local_index: Mapping[str, list[int]], +) -> list[int]: + """Turn local structure chemsys index into global structure mask.""" + global_indices = [ + entries_mapping_by_key[k][vv].entry_id for k, v in local_index.items() for vv in v + ] + return global_indices + + +def get_global_match_dict_from_local_dict( + data_entries_mapping_by_key: Mapping[str, list[ComputedStructureEntry]], + reference_entries_mapping_by_key: Mapping[str, list[ComputedStructureEntry]], + local_index: Mapping[str, dict[int, list[int]]], +) -> dict[int, list[str]]: + global_match_dict = {} + for k, match_dict in local_index.items(): + if len(match_dict) == 0 or max(len(v) for v in match_dict.values()) == 0: + continue + # Get the mapping of the data and reference entries only once, as it requires disk access + data_entries_mapping = data_entries_mapping_by_key[k] + reference_entries_mapping = reference_entries_mapping_by_key[k] + for d1_ix, ref_ix_list in match_dict.items(): + global_match_dict[data_entries_mapping[d1_ix].entry_id] = [ + reference_entries_mapping[match_ix].data["material_id"] for match_ix in ref_ix_list + ] + return global_match_dict + + +def get_mask_from_local_index( + entries_mapping_by_key: Mapping[str, list[ComputedStructureEntry]], + local_index: Mapping[str, List[int]], +) -> np.typing.NDArray[np.bool_]: + """Turn local structure chemsys index into global structure mask.""" + global_indices = get_global_index_from_local_index(entries_mapping_by_key, local_index) + total_num_entries = sum(len(v) for v in entries_mapping_by_key.values()) + mask = np.zeros(total_num_entries, dtype=bool) + mask[global_indices] = True + return mask + + +class OrderedDatasetUniquenessComputer: + def __init__(self, structure_matcher: StructureMatcher = DefaultDisorderedStructureMatcher()): + self.structure_matcher = structure_matcher + + def __call__(self, dataset: ReferenceDataset) -> np.typing.NDArray[bool]: + local_index: dict[str, List[int]] = {} + for reduced_formula, data_entries in tqdm( + dataset.entries_by_reduced_formula.items(), + desc="Finding unique structures by reduced formula", + ): + structures = [e.structure for e in data_entries] + assert all( + [s.is_ordered for s in structures] + ), "OrderedDatasetUniquenessComputer only works for ordered structures." + local_index[reduced_formula] = get_unique(self.structure_matcher, structures) + + return get_mask_from_local_index(dataset.entries_by_reduced_formula, local_index) + + +class DisorderedDatasetUniquenessComputer: + def __init__(self, structure_matcher: StructureMatcher = DefaultDisorderedStructureMatcher()): + self.structure_matcher = structure_matcher + + def __call__(self, dataset: "ReferenceDataset") -> np.typing.NDArray[bool]: + local_index: dict[str, List[int]] = {} + for chemsys, data_entries in tqdm( + dataset.entries_by_chemsys.items(), + desc="Finding unique structures by chemsys", + ): + structures = [e.structure for e in data_entries] + if not all([s.is_ordered for s in structures]): + logger.warning( + "Using DisorderedDatasetUniquenessComputer for ordered structures. " + "This is less efficient than using OrderedDatasetUniquenessComputer." + ) + local_index[chemsys] = get_unique(self.structure_matcher, structures) + + return get_mask_from_local_index(dataset.entries_by_chemsys, local_index) + + +def matches_to_mask(match_idx: Iterable[int], num_samples: int) -> np.typing.NDArray[bool]: + """ + Convert matches to a boolean mask. + + Args: + match_idx: List of indices of the structures from the input dataset which have a match + in the reference dataset. + num_samples: Number of structures in the input dataset. + + Returns: + mask: Boolean mask of length num_samples. True if the structure has a match, False if not. + """ + mask = np.zeros(num_samples, dtype=bool) + mask[list(match_idx)] = True + return mask + + +class DatasetMatcher: + """ + Class to match a dataset of structures to a reference dataset. + Can be used to compute novelty of the input dataset w.r.t. the reference dataset or + to compute the recall. + """ + + def __init__( + self, structure_matcher: OrderedStructureMatcher | DisorderedStructureMatcher + ) -> None: + self.structure_matcher = structure_matcher + + def grouped_dataset_entries( + self, dataset: ReferenceDataset + ) -> Mapping[str, list[ComputedStructureEntry]]: + """ + Returns a dictionary of entries grouped by a key, e.g., chemsys or reduced_formula. + To be implemented by the concrete dataset matcher. + """ + raise NotImplementedError + + def __call__( + self, dataset: ReferenceDataset, reference_dataset: ReferenceDataset + ) -> dict[int, list[str]]: + """ + For each entry in the dataset, check if there is a match in the reference dataset. + + Args: + dataset: Dataset to match. + reference_dataset: Reference dataset to match against. + + Returns: + global_match_idx: Dictionary of matches. Key is the index of the structure in the input dataset and + value is a list of the material_ids (str) of the matching structures in the reference dataset + """ + local_match_indices: dict[str, dict[int, list[int]]] = {} + grouped_dataset_entries = self.grouped_dataset_entries(dataset=dataset) + grouped_reference_entries = self.grouped_dataset_entries(dataset=reference_dataset) + for group_key, data_entries in tqdm( + grouped_dataset_entries.items(), + desc="Finding novel structures", + ): + data_structures = [e.structure for e in data_entries] + reference_structures = [ + e.structure for e in grouped_reference_entries.get(group_key, []) + ] + matches = get_matches( + self.structure_matcher, + data_structures, + reference_structures, + ) + local_match_indices[group_key] = matches + + global_match_dict = get_global_match_dict_from_local_dict( + grouped_dataset_entries, grouped_reference_entries, local_match_indices + ) + + return global_match_dict + + +class OrderedDatasetMatcher(DatasetMatcher): + def __init__(self, structure_matcher: OrderedStructureMatcher): + super().__init__(structure_matcher=structure_matcher) + + def grouped_dataset_entries( + self, dataset: ReferenceDataset + ) -> Mapping[str, list[ComputedStructureEntry]]: + """ + Ordered dataset matcher groups by reduced formula. + """ + return dataset.entries_by_reduced_formula + + +class DisorderedDatasetMatcher(DatasetMatcher): + def __init__(self, structure_matcher: DisorderedStructureMatcher): + super().__init__(structure_matcher=structure_matcher) + + def grouped_dataset_entries( + self, dataset: ReferenceDataset + ) -> Mapping[str, list[ComputedStructureEntry]]: + """ + Disordered dataset matcher groups by chemsys. + """ + return dataset.entries_by_chemsys diff --git a/data/mattergen/evaluation/utils/globals.py b/data/mattergen/evaluation/utils/globals.py new file mode 100644 index 0000000000000000000000000000000000000000..faf9a3eb78b30faa0f0d891f656f1d1e81a2b9ae --- /dev/null +++ b/data/mattergen/evaluation/utils/globals.py @@ -0,0 +1,8 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Default threshold (eV/atom above hull) we use to consider a structure stable +DEFAULT_STABILITY_THRESHOLD = 0.1 +# Increased RMSD threshold used for structure matching in the context of RMSD metrics +# This increased cutoff is needed to get an atom alignment even in case structures don't match +MAX_RMSD = 0.5 diff --git a/data/mattergen/evaluation/utils/lmdb_utils.py b/data/mattergen/evaluation/utils/lmdb_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..ae4980413e6d0e898b049a6020201cc9f2b483e7 --- /dev/null +++ b/data/mattergen/evaluation/utils/lmdb_utils.py @@ -0,0 +1,291 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import bisect +import os +import pickle +from abc import abstractmethod +from collections.abc import Iterable, Iterator, Sequence +from pathlib import Path +from typing import Any, Generic, TypeVar + +import lmdb # type: ignore [import] +from tqdm import tqdm # type: ignore [import] + +T = TypeVar("T") +DataPoint = TypeVar("DataPoint") + + +def lmdb_open(db_path: str | os.PathLike, readonly: bool = False) -> lmdb.Environment: + if readonly: + return lmdb.open( + str(db_path), + subdir=False, + readonly=True, + lock=False, + readahead=False, + meminit=False, + max_readers=1, + ) + else: + return lmdb.open( + str(db_path), + map_size=1099511627776 * 2, + subdir=False, + meminit=False, + map_async=True, + ) + + +def lmdb_read_metadata(db_path: str | os.PathLike, key: str, default=None) -> Any: + with lmdb_open(db_path, readonly=True) as db: + with db.begin() as txn: + result = lmdb_get(txn, key, default=default) + return result + + +def lmdb_put(txn: lmdb.Transaction, key: str, value: Any) -> bool: + """ + Stores a record in a database. + + Args: + txn: LMDB transaction (use env.begin()) + key: key of the data to be stored. + value: value of the data to be stored (needs to be picklable). + + Returns: + True if it was written. + """ + return txn.put( + key.encode("ascii"), + pickle.dumps(value, protocol=pickle.HIGHEST_PROTOCOL), + ) + + +class LmdbNotFoundError(Exception): + pass + + +def lmdb_get( + txn: lmdb.Transaction, key: str, default: Any = None, raise_if_missing: bool = True +) -> Any: + """ + Fetches a record from a database. + + Args: + txn: LMDB transaction (use env.begin()) + key: key of the data to be fetched. + default: default value to be used if the record doesn't exist. + raise_if_missing: raise LmdbNotFoundError if the record doesn't exist + and no default value was given. + + Returns: + the value of the retrieved data. + """ + value = txn.get(key.encode("ascii")) + if value is None: + if default is None and raise_if_missing: + raise LmdbNotFoundError( + f"Key {key} not found in database but default was not provided." + ) + return default + return pickle.loads(value) + + +def get_length(env: lmdb.Environment) -> int: + """ + Returns the value of the special record "length". + + Args: + env: LMDB environment (use lmdb.open()) + + Returns: + the value of the "length" record or zero if the record does not exist. + """ + with env.begin() as txn: + return lmdb_get(txn, "length", default=0) + + +def list_db_paths(data_dir: str | os.PathLike) -> list[Path]: + return sorted(Path(data_dir).glob("*.lmdb")) + + +def get_envs(data_dir: str | os.PathLike) -> Iterator[lmdb.Environment]: + """ + Creates LMDB environments stored in a directory. + + Args: + data_dir: directory where the .lmdb files are stored. + + Returns: + an iterator over LMDB environments. + """ + for lmdb_path in list_db_paths(data_dir): + yield lmdb_open(lmdb_path, readonly=True) + + +def get_indices(cum_lengths: Sequence[int], index: int) -> tuple[int, int]: + """ + Given a sequence of cumulative sequence lengths and a linear index over a sequence + of variable length databases, returns a pair of (db_index, el_index). + """ + db_index = bisect.bisect(cum_lengths, index) + el_index = index - cum_lengths[db_index - 1] if db_index > 0 else index + return (db_index, el_index) + + +class Metadata(Generic[DataPoint]): + @abstractmethod + def __init__(self, value=None): + """Initialize with an optional value""" + + @classmethod + def from_value(cls, value): + return cls(value) + + @property + @abstractmethod + def name(self): + """The name of the metadata""" + + @property + def is_frozen(self): + return False + + @property + def value(self): + """The value of the metadata""" + return self._value + + def check(self, num_points: int): + """Check consistency of the metadata""" + pass + + def update(self, index: int, sample: DataPoint): + """Update the metadata with the new datapoint""" + pass + + +# From https://github.com/Open-Catalyst-Project/ocp/blob/master/scripts/preprocess_ef.py +def write_data_points_to_lmdb( + db_path: str, + samples: Iterable[DataPoint], + pid: int | None = None, + metadata: list[Metadata] | None = None, +) -> int: + """ + Creates or appends to a database of data points keyed by the string representation of linear + index over the data points. + + Args: + start_index: start index for this group of samples. Should match the length of the existing database. + db_path: path to store the database. + samples: iterable over the data points to be stored. + metadata: (optional) list of metadata objects implementing + `check` and `update` methods. + + Returns: + the number of samples stored in the database. + """ + with lmdb_open(db_path) as db: + start_index = get_length(db) + + metadata = check_and_init_metadata(db, metadata, start_index) if metadata else [] + + idx = -1 + for idx, sample in enumerate(tqdm(samples, position=pid or 0)): + # index within the currently open file. Not to be confused with the index over a dataset + # which may consist of multiple files. + index = start_index + idx + with db.begin(write=True) as txn: + lmdb_put(txn, str(index), sample) + for meta in metadata: + meta.update(index, sample) + + if idx == -1: + return 0 + + # Save length and other info in lmdb + length = idx + 1 + original_length = get_length(db) + assert original_length == start_index + with db.begin(write=True) as txn: + lmdb_put(txn, "length", start_index + length) + check_and_put_metadata(db, metadata, start_index + length) + + db.sync() + + return length + + +def check_and_init_metadata( + db: lmdb.Environment, + metadata: list[Metadata], + length: int, + return_all: bool = True, + verbose: bool = False, +) -> list[Metadata]: + new_metadata = [] + for meta in metadata: + with db.begin() as txn: + stored_value = lmdb_get(txn, meta.name, raise_if_missing=False) + if stored_value is not None: + if meta.is_frozen: + if verbose: + print(f"stored value for {meta.name} is {stored_value}") + assert ( + meta.value == stored_value + ), f"Expected metadata {meta.name} to have value {meta.value}, but got {stored_value} in database {db}." + else: + if verbose: + print(f"checking {meta.name}") + # if the metadata is not frozen, reinitialize with the stored value. + meta = meta.from_value(value=stored_value) + # Check consistency. + meta.check(length) + if stored_value is None or return_all: + new_metadata.append(meta) + return new_metadata + + +def check_and_put_metadata(db: lmdb.Environment, metadata: list[Metadata], length: int): + for meta in metadata: + meta.check(length) + with db.begin(write=True) as txn: + lmdb_put(txn, meta.name, meta.value) + + +def ensure_metadata(db_path: str, metadata: list[Metadata]) -> int: + """Checks the metadata values stored in the database and compute missing ones to + ensure that all metadata are present. + + Args: + db_path: path to the database .lmdb file. + metadata: list of metadata. + + Returns: + the length of the database. + """ + with lmdb_open(db_path) as db: + + length = get_length(db) + + metadata = check_and_init_metadata(db, metadata, length, return_all=False) # only new ones + + if len(metadata) == 0: + # No metadata to add + return 0 + + print(f"Need to compute missing metadata {[m.name for m in metadata]}") + + for i in range(length): + with db.begin() as txn: + sample = lmdb_get(txn, str(i)) + for meta in metadata: + meta.update(i, sample) + + check_and_put_metadata(db, metadata, length) + + db.sync() + + return length diff --git a/data/mattergen/evaluation/utils/logging.py b/data/mattergen/evaluation/utils/logging.py new file mode 100644 index 0000000000000000000000000000000000000000..f006f1077cd016448cd03a4dc1a054027306bd93 --- /dev/null +++ b/data/mattergen/evaluation/utils/logging.py @@ -0,0 +1,45 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import logging +import sys + +import tqdm + + +class TqdmLoggingHandler(logging.StreamHandler): + def emit(self, record): + try: + msg = self.format(record) + tqdm.tqdm.write(msg) + self.flush() + except Exception: + self.handleError(record) + +# Idea borrowed from +# https://github.com/microsoft/DeepSpeed/blob/master/deepspeed/utils/logging.py +def get_logger(name=None, level=logging.INFO) -> logging.Logger: + """Returns a logger that is configured as: + - by default INFO level or higher messages are logged out in STDOUT. + - format includes file name, line number, etc. + """ + logger = logging.getLogger(name) + logger.setLevel(level) + logger.propagate = False + + log_formatter = logging.Formatter( + "[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)d:%(funcName)s] %(message)s" + ) + handler_out: logging.StreamHandler = TqdmLoggingHandler(sys.stdout) + handler_out.setFormatter(log_formatter) + logger.addHandler(handler_out) + + return logger + + +# Delay evaluation of "logger" attribute so that capsys can capture the +# output of this logger. +def __getattr__(name): + if name == "logger": + return get_logger(name="MatterGen", level=logging.INFO) + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") diff --git a/data/mattergen/evaluation/utils/metrics_structure_summary.py b/data/mattergen/evaluation/utils/metrics_structure_summary.py new file mode 100644 index 0000000000000000000000000000000000000000..0028d8033195705731aa6080a91952ef263136f0 --- /dev/null +++ b/data/mattergen/evaluation/utils/metrics_structure_summary.py @@ -0,0 +1,102 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import warnings +from dataclasses import dataclass, field +from functools import cached_property + +import numpy as np +from pymatgen.core import Structure +from pymatgen.entries.compatibility import Compatibility, MaterialsProject2020Compatibility +from pymatgen.entries.computed_entries import ComputedStructureEntry + +from mattergen.evaluation.utils.utils import compute_rmsd_angstrom, preprocess_structure +from mattergen.evaluation.utils.vasprunlike import VasprunLike + + +@dataclass +class MetricsStructureSummary: + entry: ComputedStructureEntry + properties: dict[str, float] = field(default_factory=dict) + original_structure: Structure | None = None # Used to compute RSMD from relaxation + + @staticmethod + def from_structure_and_energy( + structure: Structure, + energy: float, + properties: dict[str, float] | None = None, + original_structure: Structure | None = None, + energy_correction_scheme: Compatibility = MaterialsProject2020Compatibility(), + ) -> "MetricsStructureSummary": + """ + Instantiates a MetricsStructureSummary from a JobStoreTaskDoc. + Useful for computing DFT-based metrics (or any compatible MLFF). + """ + vasprun_like = VasprunLike(structure=structure, energy=energy) + entry = vasprun_like.get_computed_entry( + inc_structure=True, energy_correction_scheme=energy_correction_scheme + ) + if original_structure is None: + warnings.warn("No original structure found, cannot compute RMSD metric.") + + return MetricsStructureSummary( + entry=entry, + properties=properties or {}, + original_structure=original_structure, + ) + + @staticmethod + def from_structure( + structure: Structure, + properties: dict[str, float] | None = None, + ) -> "MetricsStructureSummary": + """ + Instantiates a MetricsStructureSummary from a Structure with an energy value of np.nan and initial_structure=None. + Useful for computing structure-based metrics. + """ + return MetricsStructureSummary( + entry=ComputedStructureEntry(structure=structure, energy=np.nan), + properties=properties or {}, + ) + + @cached_property + def rmsd_from_relaxation(self) -> float: + if self.original_structure is None: + return np.nan # Return nan since it cannot compute rmsd + else: + return compute_rmsd_angstrom( + self.entry.structure, + preprocess_structure(self.original_structure), + ) + + @property + def structure(self) -> Structure: + return self.entry.structure + + @property + def chemical_system(self) -> str: + return self.entry.composition.chemical_system + + +def get_metrics_structure_summaries( + structures: list[Structure], + energies: list[float], + properties: dict[str, list[float]] | None = None, + original_structures: list[Structure] | None = None, + energy_correction_scheme: Compatibility = MaterialsProject2020Compatibility(), +) -> list[MetricsStructureSummary]: + if properties is None: + properties = {} + for prop in properties: + assert len(properties[prop]) == len(structures) + + return [ + MetricsStructureSummary.from_structure_and_energy( + structure=structures[i], + energy=energies[i], + properties={k: v[i] for k, v in properties.items()} if properties else None, + original_structure=original_structures[i] if original_structures else None, + energy_correction_scheme=energy_correction_scheme, + ) + for i in range(len(structures)) + ] diff --git a/data/mattergen/evaluation/utils/relaxation.py b/data/mattergen/evaluation/utils/relaxation.py new file mode 100644 index 0000000000000000000000000000000000000000..c15c262004ccd05494c6805c6f102705dcb9bb60 --- /dev/null +++ b/data/mattergen/evaluation/utils/relaxation.py @@ -0,0 +1,42 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import numpy as np +from ase import Atoms +from mattersim.applications.batch_relax import BatchRelaxer +from mattersim.forcefield.potential import Potential +from mattersim.utils.logger_utils import get_logger +from pymatgen.core import Structure +from pymatgen.io.ase import AseAtomsAdaptor + +from mattergen.common.utils.globals import get_device + +logger = get_logger() +logger.level("ERROR") + + +def relax_atoms( + atoms: list[Atoms], device: str = str(get_device()), load_path: str = None, **kwargs +) -> tuple[list[Atoms], np.ndarray]: + potential = Potential.from_checkpoint( + device=device, load_path=load_path, load_training_state=False + ) + batch_relaxer = BatchRelaxer(potential=potential, filter="EXPCELLFILTER", **kwargs) + relaxation_trajectories = batch_relaxer.relax(atoms) + relaxed_atoms = [t[-1] for t in relaxation_trajectories.values()] + total_energies = np.array([a.info["total_energy"] for a in relaxed_atoms]) + return relaxed_atoms, total_energies + + +def relax_structures( + structures: Structure | list[Structure], + device: str = str(get_device()), + load_path: str = None, + **kwargs +) -> tuple[list[Structure], np.ndarray]: + if isinstance(structures, Structure): + structures = [structures] + atoms = [AseAtomsAdaptor.get_atoms(s) for s in structures] + relaxed_atoms, total_energies = relax_atoms(atoms, device=device, load_path=load_path, **kwargs) + relaxed_structures = [AseAtomsAdaptor.get_structure(a) for a in relaxed_atoms] + return relaxed_structures, total_energies diff --git a/data/mattergen/evaluation/utils/structure_matcher.py b/data/mattergen/evaluation/utils/structure_matcher.py new file mode 100644 index 0000000000000000000000000000000000000000..077b43b7d52536fe51db954161828d09eeeb0b90 --- /dev/null +++ b/data/mattergen/evaluation/utils/structure_matcher.py @@ -0,0 +1,316 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from itertools import combinations + +import numpy as np +from emmet.core.utils import get_sg +from pymatgen.analysis.structure_matcher import ( + AbstractComparator, + OrderDisorderElementComparator, + StructureMatcher, +) +from pymatgen.core.periodic_table import Element +from pymatgen.core.structure import Structure + +from mattergen.evaluation.utils.globals import MAX_RMSD + + +class RMSDStructureMatcher(StructureMatcher): + """ + Structure matcher used for computing RMSD distance between structures. Has looser + tolerances than the default pymatgen StructureMatcher to ensure that we can get an + atom alignment even in case structures don't match. + """ + + def __init__( + self, + ): + super().__init__( + ltol=0.5, + stol=MAX_RMSD, + angle_tol=10, + primitive_cell=True, + scale=False, + attempt_supercell=True, + allow_subset=False, + ) + + +class OrderedStructureMatcher(StructureMatcher): + def __init__( + self, + ltol: float = 0.2, + stol: float = 0.3, + angle_tol: float = 5, + primitive_cell: float = True, + scale: float = True, + attempt_supercell: float = False, + allow_subset: float = False, + *args, + **kwargs, + ): + super().__init__( + ltol=ltol, + stol=stol, + angle_tol=angle_tol, + primitive_cell=primitive_cell, + scale=scale, + attempt_supercell=attempt_supercell, + allow_subset=allow_subset, + *args, + **kwargs, + ) + + @property + def name(self) -> str: + return "OrderedStructureMatcher" + + +class DefaultOrderedStructureMatcher(OrderedStructureMatcher): + """ + Ordered structure matcher with default parameters. No args or kwargs are passed in order + to ensure consistent behavior across all instances. + """ + + def __init__(self): + super().__init__() + + +class DisorderedStructureMatcher(StructureMatcher): + def __init__( + self, + ltol: float = 0.2, + stol: float = 0.3, + angle_tol: float = 5.0, + primitive_cell: bool = True, + scale: bool = True, + comparator: AbstractComparator = OrderDisorderElementComparator(), + attempt_supercell: bool = True, + allow_subset: bool = True, + relative_radius_difference_threshold: float = 0.3, + electronegativity_difference_threshold: float = 1.0, + reduced_formula_atol: float = 1e-2, # 1e-8 is the default value in pymatgen composition.almost_equals() + reduced_formula_rtol: float = 1e-1, # 1e-1 is the default value in pymatgen composition.almost_equals() + *args, + **kwargs, + ): + super().__init__( + ltol=ltol, + stol=stol, + angle_tol=angle_tol, + primitive_cell=primitive_cell, + allow_subset=allow_subset, + attempt_supercell=attempt_supercell, + scale=scale, + comparator=comparator, + *args, + **kwargs, + ) + self.relative_radius_difference_threshold = relative_radius_difference_threshold + self.electronegativity_difference_threshold = electronegativity_difference_threshold + self.ordered_structurematcher = OrderedStructureMatcher( + ltol=ltol, + stol=stol, + angle_tol=angle_tol, + primitive_cell=primitive_cell, + scale=scale, + ) + self.reduced_formula_atol = reduced_formula_atol + self.reduced_formula_rtol = reduced_formula_rtol + + @property + def name(self) -> str: + return "DisorderedStructureMatcher" + + def fit(self, structure_1: Structure, structure_2: Structure) -> bool: + """ + Returns True if the structures are equivalent, False otherwise. + First checks whether the composition of the structures is similar. + Then checks whether the structures are ordered or disordered. + If both structures are ordered, they are first compared directly, + and if they do not match, one of the structures is disordered and compared again. + If one of the structures is disordered, the disordered comparer is used directly. + The structures are first copied and their oxidation states are removed. + """ + structure_1_nooxi = structure_1.copy().remove_oxidation_states() + structure_2_nooxi = structure_2.copy().remove_oxidation_states() + + if structure_1_nooxi == structure_2_nooxi: + return True + + if structure_1_nooxi.is_ordered and structure_2_nooxi.is_ordered: + # Strict comparison of reduced formulas if one of the structures is disordered + if ( + structure_2_nooxi.composition.reduced_formula + != structure_1_nooxi.composition.reduced_formula + ): + return False + # First do the simple comparison, and exit the loop only if a match is found + if get_sg(structure_1_nooxi) == get_sg(structure_2_nooxi): + if self.ordered_structurematcher.fit(structure_1_nooxi, structure_2_nooxi): + return True + + # Then disorder one of the structures and compare again using the disordered matcher + structure_1_nooxi, can_be_disordered_1 = try_make_structure_disordered( + structure=structure_1_nooxi, + relative_radius_difference_threshold=self.relative_radius_difference_threshold, + electronegativity_difference_threshold=self.electronegativity_difference_threshold, + ) + if can_be_disordered_1: + return super().fit(structure_1_nooxi, structure_2_nooxi) + return False + + # If at least one of the structures is already disordered, use the disordered matcher + # Loose comparison of reduced formulas if one of the structures is disordered + # We need to use fractional_composition here because otherwise the match fails for + # structures with different number of sites (e.g., supercells) + if not structure_1_nooxi.composition.fractional_composition.almost_equals( + structure_2_nooxi.composition.fractional_composition, + atol=self.reduced_formula_atol, + rtol=self.reduced_formula_rtol, + ): + return False + return super().fit(structure_1_nooxi, structure_2_nooxi) + + +class DefaultDisorderedStructureMatcher(DisorderedStructureMatcher): + """ + Disordered structure matcher with default parameters. No args or kwargs are passed in order + to ensure consistent behavior across all instances. + """ + + def __init__(self): + super().__init__() + + +def get_cliques_out_of_list_of_pairs(pairs: list[list[Element]]) -> list[list[Element]]: + # create cliques of elements that can substitute each other + cliques: list[list[Element]] = [[]] + for pair in pairs: # Loop over pairs of elements that can substitute each other + previously_appended_to_group = None + for i, group in enumerate(cliques): + # If any of the elements in the pair are already in the group, there are two options + if pair[0] in group or pair[1] in group: + if previously_appended_to_group is not None: + # Now, if this pair is matching this group but was already matched to another group, + # append the new group to the old group and empty the new group + cliques[previously_appended_to_group].extend(group) + cliques[i] = [] + else: + # If instead this is the first group that the pair is matched to, append the pair to the group + # and mark this group as the one that the pair was matched to + cliques[i].extend(pair) + previously_appended_to_group = i + # If by the end of the loop the pair was not matched to any group, create a new group + if previously_appended_to_group is None: + cliques.append(pair) + + # Remove empty groups and duplicates within groups + return [list(set(group)) for group in cliques if len(group) > 0] + + +def make_structure_disordered(structure: Structure, substitution: list[list[Element]]) -> Structure: + """ + Returns a copy of the structure where the cliques of elements that can substitute each other are replaced by partial occupancies. + The partial occupancies are calculated based on the atomic fractions of the elements in the clique. + """ + disordered_structure = structure.copy().remove_oxidation_states() + atomic_fractions = { + str(species): disordered_structure.composition.get_atomic_fraction(str(species)) + for species in list(disordered_structure.composition) + } + for substitution_clique in substitution: + these_atomic_fractions = { + species: atomic_fractions[str(species)] for species in substitution_clique + } + total_atomic_fraction = sum(these_atomic_fractions.values()) + these_atomic_fractions = { + species: atomic_fraction / total_atomic_fraction + for species, atomic_fraction in these_atomic_fractions.items() + } + disordered_structure.replace_species( + { + str(species): "".join( + [ + str(species) + str(these_atomic_fractions[species]) + for species in substitution_clique + ] + ) + for species in substitution_clique + } + ) + return disordered_structure + + +def do_elements_substitute( + element_1: Element, + element_2: Element, + relative_radius_difference_threshold: float = 0.3, + electronegativity_difference_threshold: float = 1.0, +) -> bool: + """ + Returns whether two elements could substitute based on their atomic radius and electronegativity. + This is a modified Hume-Rothery rule, where the relative atomic radius difference and the electronegativity difference + thresholds are obtained from an analysis carried out on ICSD data. + See the revised MatterGen paper for more details. + """ + relative_atomic_radius_difference = abs( + element_1.atomic_radius - element_2.atomic_radius + ) / np.mean([element_1.atomic_radius, element_2.atomic_radius]) + electronegativity_difference = abs(element_1.X - element_2.X) + return ( + relative_atomic_radius_difference <= relative_radius_difference_threshold + and electronegativity_difference <= electronegativity_difference_threshold + ) + + +def check_is_disordered( + structure: Structure, + relative_radius_difference_threshold: float = 0.3, + electronegativity_difference_threshold: float = 1.0, +) -> tuple[bool, list[list[Element]]]: + """ + Function to estimate whether a structure can be thought as an ordered approximation of an alloy. + Returns: + + is_disordered: can the structure be thought of as an alloy? + substitutional_groups: list of sets of elements that could substitute for each other + + """ + structure_copy = structure.copy().remove_oxidation_states() + + substitutional_pairs = [] + for element_1, element_2 in combinations(list(structure_copy.composition), 2): + # reduce to string of element + if do_elements_substitute( + element_1=element_1, + element_2=element_2, + relative_radius_difference_threshold=relative_radius_difference_threshold, + electronegativity_difference_threshold=electronegativity_difference_threshold, + ): + substitutional_pairs.append([element_1, element_2]) + + if len(substitutional_pairs) == 0: + return False, [[]] + + substitutional_groups = get_cliques_out_of_list_of_pairs(pairs=substitutional_pairs) + return True, substitutional_groups + + +def try_make_structure_disordered( + structure: Structure, + relative_radius_difference_threshold: float = 0.3, + electronegativity_difference_threshold: float = 1.0, +) -> tuple[Structure, bool]: + can_be_disordered, substitution_species = check_is_disordered( + structure=structure, + relative_radius_difference_threshold=relative_radius_difference_threshold, + electronegativity_difference_threshold=electronegativity_difference_threshold, + ) + return ( + make_structure_disordered(structure, substitution_species) + if can_be_disordered + else structure, + can_be_disordered, + ) diff --git a/data/mattergen/evaluation/utils/symmetry_analysis.py b/data/mattergen/evaluation/utils/symmetry_analysis.py new file mode 100644 index 0000000000000000000000000000000000000000..5391b28351fc62eca27b183d74bdbc12a158c7aa --- /dev/null +++ b/data/mattergen/evaluation/utils/symmetry_analysis.py @@ -0,0 +1,50 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from pymatgen.core.structure import Structure +from pymatgen.symmetry.analyzer import SpacegroupAnalyzer + +from mattergen.evaluation.utils.structure_matcher import try_make_structure_disordered + + +class DefaultSpaceGroupAnalyzer(SpacegroupAnalyzer): + def __init__( + self, + structure: Structure, + ): + super().__init__(structure, symprec=0.1, angle_tolerance=5.0) + + +class DisorderedSpaceGroupAnalyzer(SpacegroupAnalyzer): + def __init__( + self, + structure: Structure, + ): + structure, _ = try_make_structure_disordered( + structure=structure, + relative_radius_difference_threshold=0.3, + electronegativity_difference_threshold=1.0, + ) + super().__init__(structure, symprec=0.1, angle_tolerance=5.0) + + +class StrictSpaceGroupAnalyzer(SpacegroupAnalyzer): + def __init__( + self, + structure: Structure, + ): + super().__init__(structure, symprec=0.01, angle_tolerance=5.0) + + +class DisorderedStrictSpaceGroupAnalyzer(SpacegroupAnalyzer): + def __init__( + self, + structure: Structure, + ): + structure, _ = try_make_structure_disordered( + structure=structure, + relative_radius_difference_threshold=0.3, + electronegativity_difference_threshold=1.0, + ) + super().__init__(structure, symprec=0.01, angle_tolerance=5.0) + super().__init__(structure, symprec=0.01, angle_tolerance=5.0) diff --git a/data/mattergen/evaluation/utils/utils.py b/data/mattergen/evaluation/utils/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..cdbff607f572db85489079e6a83485be0c503f6a --- /dev/null +++ b/data/mattergen/evaluation/utils/utils.py @@ -0,0 +1,94 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from collections import defaultdict +from itertools import combinations +from typing import Any, Callable, Iterable, TypeVar + +import numpy as np +from pymatgen.core import Structure +from pymatgen.core.lattice import Lattice +from pymatgen.entries.computed_entries import ComputedStructureEntry +from pymatgen.symmetry.analyzer import SpacegroupAnalyzer + +from mattergen.evaluation.utils.globals import MAX_RMSD +from mattergen.evaluation.utils.structure_matcher import RMSDStructureMatcher + +OptionalNumber = int | float | None +PropertyConstraint = tuple[ + OptionalNumber, OptionalNumber +] # These encode the minimum and maximum values for a property + + +def generate_reduced_formula_dict( + entries: Iterable[ComputedStructureEntry], +) -> dict[str, list[ComputedStructureEntry]]: + """Generate a dictionary of entries with the same reduced formula.""" + + def keyfunc(entry: ComputedStructureEntry) -> str: + entry.structure.unset_charge() + return entry.structure.remove_oxidation_states().composition.reduced_formula + + return group_list_items_into_dict(entries, keyfunc=keyfunc) + + +def generate_chemsys_dict( + entries: Iterable[ComputedStructureEntry], +) -> dict[str, list[ComputedStructureEntry]]: + """Generate a dictionary of entries with the same chemical system.""" + + def keyfunc(entry: ComputedStructureEntry) -> str: + return "-".join(sorted({el.symbol for el in entry.composition.elements})) + + return group_list_items_into_dict(entries, keyfunc=keyfunc) + + +T = TypeVar("T") + + +def group_list_items_into_dict( + items: Iterable[T], keyfunc: Callable[[Any], str] +) -> dict[str, list[T]]: + """Group a list of items into a dictionary with the same key.""" + result = defaultdict(list) + # To reduce the number of calls to keyfunc, we use a defaultdict instead of itertools.groupby, + # which requires the list to be sorted. + for item in items: + result[keyfunc(item)].append(item) + return result + + +def compute_rmsd_angstrom(struc1: Structure, struc2: Structure) -> float: + """Compute RMSD during relaxation in units of angstrom""" + match = RMSDStructureMatcher().get_rms_dist(struc1, struc2) + + # copied from https://github.com/materialsproject/pymatgen/blob/5c174bfaf7a97eef9f6b3d1ba3499b0e8764d9e8/pymatgen/analysis/structure_matcher.py#L451-L453 + def av_lat(l1: Lattice, l2: Lattice): + params = (np.array(l1.parameters) + np.array(l2.parameters)) / 2 + return Lattice.from_parameters(*params) + + # In structure matcher, the unit for RMSD is normalized by (V/atom) ^ 1/3 + # We need to multiply by (V/atom) ^ 1/3 to get RMSD in Angstrom + avg_l = av_lat(struc1.lattice, struc2.lattice) + normalization = (len(struc1) / avg_l.volume) ** (1 / 3) + + if match is None: # Return MAX_RMSD since matching failed but could be computed + return MAX_RMSD / normalization + return match[0] / normalization + + +def expand_into_subsystems(chemical_system: str) -> list[tuple[str, ...]]: + elements = chemical_system.split("-") + list_combinations = [] + for n in range(1, len(elements) + 1): + list_combinations += list(combinations(elements, n)) + return list_combinations + + +def preprocess_structure(structure: Structure) -> Structure: + sga = SpacegroupAnalyzer(structure) + return ( + sga.get_refined_structure() + .get_primitive_structure() + .get_reduced_structure(reduction_algo="LLL") + ) diff --git a/data/mattergen/evaluation/utils/vasprunlike.py b/data/mattergen/evaluation/utils/vasprunlike.py new file mode 100644 index 0000000000000000000000000000000000000000..ff020ae29b6bde8868ba171d09c4e4ab63165649 --- /dev/null +++ b/data/mattergen/evaluation/utils/vasprunlike.py @@ -0,0 +1,132 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import re +from functools import cached_property + +from pymatgen.analysis.structure_analyzer import oxide_type +from pymatgen.core import Structure +from pymatgen.entries.compatibility import Compatibility +from pymatgen.entries.computed_entries import ( + ComputedEntry, + ComputedStructureEntry, + EnergyAdjustment, +) +from pymatgen.io.vasp.outputs import VaspParseError +from pymatgen.io.vasp.sets import MPRelaxSet + + +class IdentityCorrectionScheme(Compatibility): + """Perform no energy correction.""" + + def get_adjustments( + self, entry: ComputedEntry | ComputedStructureEntry + ) -> list[EnergyAdjustment]: + return [] + + +class VasprunLike: + """ + Mocks a VASP run using only the structure as well as INCAR and POTCAR information from MPRelaxSet. + Code adapted from https://github.com/materialsproject/pymatgen/blob/6c23d744efbd892ec48346297d61b4f3f86b1478/pymatgen/io/vasp/outputs.py#L153 + + Note that this object does not have the full functionality of a Vasprun. It is only used to obtain energy corrections if the full Vasprun information is not available. + """ + + def __init__( + self, structure: Structure, energy: float, user_potcar_functional: str = "PBE" + ) -> None: + self.structure = structure + self.energy = energy + self.user_potcar_functional = user_potcar_functional + + @cached_property + def mp_set(self) -> MPRelaxSet: + return MPRelaxSet( + self.structure, + # These settings prevent the MPRelaxSet from trying to + # automatically determine kpoints, which sometimes results + # in SpacegroupAnalyzer errors + user_incar_settings={"KSPACING": 0.5}, + user_kpoints_settings=None, + ) + + @property + def potcar_symbols(self) -> list[str]: + return [ + f"{self.user_potcar_functional.upper()} {sym}" for sym in self.mp_set.potcar_symbols + ] + + @property + def aspherical(self) -> bool: + return self.mp_set.incar.get("LASPH", False) + + @property + def hubbards(self) -> dict: + """ + Hubbard U values used if a vasprun is a GGA+U run. {} otherwise. + """ + symbols = [s.split()[1] for s in self.potcar_symbols] + symbols = [re.split(r"_", s)[0] for s in symbols] + if not self.mp_set.incar.get("LDAU", False): + return {} + us = self.mp_set.incar.get("LDAUU", []) + js = self.mp_set.incar.get("LDAUJ", []) + if len(js) != len(us): + js = [0] * len(us) + if len(us) == len(symbols): + return {symbols[i]: us[i] - js[i] for i in range(len(symbols))} + if sum(us) == 0 and sum(js) == 0: + return {} + raise VaspParseError("Length of U value parameters and atomic symbols are mismatched") + + @property + def run_type(self) -> str: + """ + Returns the run type. Simplified version of https://github.com/materialsproject/pymatgen/blob/6c23d744efbd892ec48346297d61b4f3f86b1478/pymatgen/io/vasp/outputs.py#L716. + """ + + rt = "GGA" + if self.is_hubbard: + rt += "+U" + + return rt + + @property + def is_hubbard(self) -> bool: + """ + True if run is a DFT+U run. + """ + if len(self.hubbards) == 0: + return False + return sum(self.hubbards.values()) > 1e-8 + + def get_computed_entry( + self, + inc_structure: bool = True, + energy_correction_scheme: Compatibility = IdentityCorrectionScheme(), + ) -> ComputedEntry: + entry_dict = { + "correction": 0.0, + "composition": self.structure.composition, + "energy": self.energy, + "parameters": { + "is_hubbard": self.is_hubbard, + "hubbards": self.hubbards, + "run_type": self.run_type, + "potcar_symbols": self.potcar_symbols, + }, + "data": {"oxide_type": oxide_type(self.structure), "aspherical": self.aspherical}, + "structure": self.structure, + } + + if not inc_structure: + entry = ComputedEntry.from_dict(entry_dict) + else: + entry = ComputedStructureEntry.from_dict(entry_dict) + + energy_correction_scheme.process_entry(entry) + + return entry + return entry + return entry diff --git a/data/mattergen/generator.py b/data/mattergen/generator.py new file mode 100644 index 0000000000000000000000000000000000000000..7c95081e62c546871d0ab51591ed3ba64a49ef06 --- /dev/null +++ b/data/mattergen/generator.py @@ -0,0 +1,379 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import io +import os +from dataclasses import dataclass +from pathlib import Path +from zipfile import ZipFile + +import ase.io +import hydra +import torch +from hydra.utils import instantiate +from omegaconf import DictConfig, OmegaConf +from pymatgen.core.structure import Structure +from pymatgen.io.ase import AseAtomsAdaptor +from tqdm import tqdm + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.data.collate import collate +from mattergen.common.data.condition_factory import ConditionLoader +from mattergen.common.data.num_atoms_distribution import NUM_ATOMS_DISTRIBUTIONS +from mattergen.common.data.types import TargetProperty +from mattergen.common.utils.data_utils import lattice_matrix_to_params_torch +from mattergen.common.utils.eval_utils import ( + MatterGenCheckpointInfo, + get_crystals_list, + load_model_diffusion, + make_structure, + save_structures, +) +from mattergen.common.utils.globals import DEFAULT_SAMPLING_CONFIG_PATH, get_device +from mattergen.diffusion.lightning_module import DiffusionLightningModule +from mattergen.diffusion.sampling.pc_sampler import PredictorCorrector + + +def draw_samples_from_sampler( + sampler: PredictorCorrector, + condition_loader: ConditionLoader, + properties_to_condition_on: TargetProperty | None = None, + output_path: Path | None = None, + cfg: DictConfig | None = None, + record_trajectories: bool = True, +) -> list[Structure]: + + # Dict + properties_to_condition_on = properties_to_condition_on or {} + + # we cannot conditional sample on something on which the model was not trained to condition on + assert all([key in sampler.diffusion_module.model.cond_fields_model_was_trained_on for key in properties_to_condition_on.keys()]) # type: ignore + + all_samples_list = [] + all_trajs_list = [] + for conditioning_data, mask in tqdm(condition_loader, desc="Generating samples"): + + # generate samples + if record_trajectories: + sample, mean, intermediate_samples = sampler.sample_with_record(conditioning_data, mask) + all_trajs_list.extend(list_of_time_steps_to_list_of_trajectories(intermediate_samples)) + else: + sample, mean = sampler.sample(conditioning_data, mask) + all_samples_list.extend(mean.to_data_list()) + all_samples = collate(all_samples_list) + assert isinstance(all_samples, ChemGraph) + lengths, angles = lattice_matrix_to_params_torch(all_samples.cell) + all_samples = all_samples.replace(lengths=lengths, angles=angles) + + generated_strucs = structure_from_model_output( + all_samples["pos"].reshape(-1, 3), + all_samples["atomic_numbers"].reshape(-1), + all_samples["lengths"].reshape(-1, 3), + all_samples["angles"].reshape(-1, 3), + all_samples["num_atoms"].reshape(-1), + ) + + if output_path is not None: + assert cfg is not None + # Save structures to disk in both a extxyz file and a compressed zip file. + # do this before uploading to mongo in case there is an authentication error + save_structures(output_path, generated_strucs) + + if record_trajectories: + dump_trajectories( + output_path=output_path, + all_trajs_list=all_trajs_list, + ) + + return generated_strucs + + +def list_of_time_steps_to_list_of_trajectories( + list_of_time_steps: list[ChemGraph], +) -> list[list[ChemGraph]]: + # Rearrange the shapes of the recorded intermediate samples and predictions + # We get a list of <num_timesteps> many ChemGraphBatches, each containing <batch_size> + # many ChemGraphs. Instead, we group all the ChemGraphs of the same trajectory together, + # i.e., we construct lists of <batch_size> many lists of + # <num_timesteps * (1 + num_corrector_steps)> many ChemGraphs. + + # <num_timesteps * (1 + num_corrector_steps)> many lists of <batch_size> many ChemGraphs + data_lists_per_timesteps = [x.to_data_list() for x in list_of_time_steps] + + # <batch_size> many lists of <num_timesteps * (1 + num_corrector_steps)> many ChemGraphs. + data_lists_per_sample = [ + [data_lists_per_timesteps[ix_t][ix_traj] for ix_t in range(len(data_lists_per_timesteps))] + for ix_traj in range(len(data_lists_per_timesteps[0])) + ] + return data_lists_per_sample + + +def dump_trajectories( + output_path: Path, + all_trajs_list: list[list[ChemGraph]], +) -> None: + try: + # We gather all trajectories in a single zip file as .extxyz files. + # This way we can view them easily after downloading. + with ZipFile(output_path / "generated_trajectories.zip", "w") as zip_obj: + for ix, traj in enumerate(all_trajs_list): + strucs = structures_from_trajectory(traj) + ase_atoms = [AseAtomsAdaptor.get_atoms(crystal) for crystal in strucs] + str_io = io.StringIO() + ase.io.write(str_io, ase_atoms, format="extxyz") + str_io.flush() + zip_obj.writestr(f"gen_{ix}.extxyz", str_io.getvalue()) + except IOError as e: + print(f"Got error {e} writing the trajectory to disk.") + except ValueError as e: + print(f"Got error ValueError '{e}' writing the trajectory to disk.") + + +def structure_from_model_output( + frac_coords, atom_types, lengths, angles, num_atoms +) -> list[Structure]: + structures = [ + make_structure( + lengths=d["lengths"], + angles=d["angles"], + atom_types=d["atom_types"], + frac_coords=d["frac_coords"], + ) + for d in get_crystals_list( + frac_coords.cpu(), + atom_types.cpu(), + lengths.cpu(), + angles.cpu(), + num_atoms.cpu(), + ) + ] + return structures + + +def structures_from_trajectory(traj: list[ChemGraph]) -> list[Structure]: + all_strucs = [] + for batch in traj: + cell = batch.cell + lengths, angles = lattice_matrix_to_params_torch(cell) + all_strucs.extend( + structure_from_model_output( + frac_coords=batch.pos, + atom_types=batch.atomic_numbers, + lengths=lengths, + angles=angles, + num_atoms=batch.num_atoms, + ) + ) + + return all_strucs + + +@dataclass +class CrystalGenerator: + checkpoint_info: MatterGenCheckpointInfo + + # These may be set at runtime + batch_size: int | None = None + num_batches: int | None = None + target_compositions_dict: list[dict[str, float]] | None = None + num_atoms_distribution: str = "ALEX_MP_20" + + # Conditional generation + diffusion_guidance_factor: float = 0.0 + properties_to_condition_on: TargetProperty | None = None + + # Additional overrides, only has an effect when using a diffusion-codebase model + sampling_config_overrides: list[str] | None = None + + # These only have an effect when using a legacy model + num_samples_per_batch: int = 1 + niggli_reduction: bool = False + + # Config path, if None will default to DEFAULT_SAMPLING_CONFIG_PATH + sampling_config_path: Path | None = None + sampling_config_name: str = "default" + + record_trajectories: bool = True # store all intermediate samples by default + + # These attributes are set when prepare() method is called. + _model: DiffusionLightningModule | None = None + _cfg: DictConfig | None = None + + def __post_init__(self) -> None: + assert self.num_atoms_distribution in NUM_ATOMS_DISTRIBUTIONS, ( + f"num_atoms_distribution must be one of {list(NUM_ATOMS_DISTRIBUTIONS.keys())}, " + f"but got {self.num_atoms_distribution}. To add your own distribution, " + "please add it to mattergen.common.data.num_atoms_distribution.NUM_ATOMS_DISTRIBUTIONS." + ) + if len(self.target_compositions_dict) > 0: + assert self.cfg.lightning_module.diffusion_module.loss_fn.weights.get( + "atomic_numbers", 0.0 + ) == 0.0 and "atomic_numbers" not in self.cfg.lightning_module.diffusion_module.corruption.get( + "discrete_corruptions", {} + ), "Input model appears to have been trained for crystal generation (i.e., with atom type denoising), not crystal structure prediction. Please use a model trained for crystal structure prediction instead." + sampling_cfg = self._load_sampling_config( + sampling_config_name=self.sampling_config_name, + sampling_config_overrides=self.sampling_config_overrides, + sampling_config_path=self.sampling_config_path, + ) + if ( + "atomic_numbers" in sampling_cfg.sampler_partial.predictor_partials + or "atomic_numbers" in sampling_cfg.sampler_partial.corrector_partials + ): + raise ValueError( + "Incompatible sampling config for crystal structure prediction: found atomic_numbers in predictor_partials or corrector_partials. Use the 'csp' sampling config instead, e.g., via --sampling-config-name=csp." + ) + + @property + def model(self) -> DiffusionLightningModule: + self.prepare() + assert self._model is not None + return self._model + + @property + def cfg(self) -> DictConfig: + self._cfg = self.checkpoint_info.config + assert self._cfg is not None + return self._cfg + + @property + def num_structures_to_generate(self) -> int: + """Returns the total number of structures to generate if `batch_size` and `num_batches` are specified at construction time; + otherwise, raises an AssertionError. + """ + assert self.batch_size is not None + assert self.num_batches is not None + return self.batch_size * self.num_batches + + @property + def sampling_config(self) -> DictConfig: + """Returns the sampling config if `batch_size` and `num_batches` are specified at construction time; + otherwise, raises an AssertionError. + """ + assert self.batch_size is not None + assert self.num_batches is not None + return self.load_sampling_config( + batch_size=self.batch_size, + num_batches=self.num_batches, + target_compositions_dict=self.target_compositions_dict, + ) + + def get_condition_loader( + self, + sampling_config: DictConfig, + target_compositions_dict: list[dict[str, float]] | None = None, + ) -> ConditionLoader: + condition_loader_partial = instantiate(sampling_config.condition_loader_partial) + if not target_compositions_dict: + return condition_loader_partial(properties=self.properties_to_condition_on) + + return condition_loader_partial(target_compositions_dict=target_compositions_dict) + + def load_sampling_config( + self, + batch_size: int, + num_batches: int, + target_compositions_dict: list[dict[str, float]] | None = None, + ) -> DictConfig: + """ + Create a sampling config from the given parameters. + We specify certain sampling hyperparameters via the sampling config that is loaded via hydra. + """ + if self.sampling_config_overrides is None: + sampling_config_overrides = [] + else: + # avoid modifying the original list + sampling_config_overrides = self.sampling_config_overrides.copy() + if not target_compositions_dict: + # Default `condition_loader_partial` is + # mattergen.common.data.condition_factory.get_number_of_atoms_condition_loader + sampling_config_overrides += [ + f"+condition_loader_partial.num_atoms_distribution={self.num_atoms_distribution}", + f"+condition_loader_partial.batch_size={batch_size}", + f"+condition_loader_partial.num_samples={num_batches * batch_size}", + f"sampler_partial.guidance_scale={self.diffusion_guidance_factor}", + ] + else: + # `condition_loader_partial` for fixed atom type (crystal structure prediction) + num_structures_to_generate_per_composition = ( + num_batches * batch_size // len(target_compositions_dict) + ) + sampling_config_overrides += [ + "condition_loader_partial._target_=mattergen.common.data.condition_factory.get_composition_data_loader", + f"+condition_loader_partial.num_structures_to_generate_per_composition={num_structures_to_generate_per_composition}", + f"+condition_loader_partial.batch_size={batch_size}", + ] + return self._load_sampling_config( + sampling_config_overrides=sampling_config_overrides, + sampling_config_path=self.sampling_config_path, + sampling_config_name=self.sampling_config_name, + ) + + def _load_sampling_config( + self, + sampling_config_path: Path | None = None, + sampling_config_name: str = "default", + sampling_config_overrides: list[str] | None = None, + ) -> DictConfig: + if sampling_config_path is None: + sampling_config_path = DEFAULT_SAMPLING_CONFIG_PATH + + if sampling_config_overrides is None: + sampling_config_overrides = [] + + with hydra.initialize_config_dir(os.path.abspath(str(sampling_config_path))): + sampling_config = hydra.compose( + config_name=sampling_config_name, overrides=sampling_config_overrides + ) + return sampling_config + + def prepare(self) -> None: + """Loads the model from checkpoint and prepares for generation.""" + if self._model is not None: + return + model = load_model_diffusion(self.checkpoint_info) + model = model.to(get_device()) + self._model = model + self._cfg = self.checkpoint_info.config + + def generate( + self, + batch_size: int | None = None, + num_batches: int | None = None, + target_compositions_dict: list[dict[str, float]] | None = None, + output_dir: str = "outputs", + ) -> list[Structure]: + # Prioritize the runtime provided batch_size, num_batches and target_compositions_dict + batch_size = batch_size or self.batch_size + num_batches = num_batches or self.num_batches + target_compositions_dict = target_compositions_dict or self.target_compositions_dict + assert batch_size is not None + assert num_batches is not None + + # print config for debugging and reproducibility + print("\nModel config:") + print(OmegaConf.to_yaml(self.cfg, resolve=True)) + + sampling_config = self.load_sampling_config( + batch_size=batch_size, + num_batches=num_batches, + target_compositions_dict=target_compositions_dict, + ) + + print("\nSampling config:") + print(OmegaConf.to_yaml(sampling_config, resolve=True)) + condition_loader = self.get_condition_loader(sampling_config, target_compositions_dict) + + sampler_partial = instantiate(sampling_config.sampler_partial) + sampler = sampler_partial(pl_module=self.model) + + generated_structures = draw_samples_from_sampler( + sampler=sampler, + condition_loader=condition_loader, + cfg=self.cfg, + output_path=Path(output_dir), + properties_to_condition_on=self.properties_to_condition_on, + record_trajectories=self.record_trajectories, + ) + + return generated_structures diff --git a/data/mattergen/property_embeddings.py b/data/mattergen/property_embeddings.py new file mode 100644 index 0000000000000000000000000000000000000000..ac9d328a6d5638807e078aa0a4162b33cfa0e4d8 --- /dev/null +++ b/data/mattergen/property_embeddings.py @@ -0,0 +1,563 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import Dict, Sequence, Union + +import torch + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.data.types import PropertySourceId, TargetProperty +from mattergen.common.utils.data_utils import get_atomic_number +from mattergen.common.utils.globals import MAX_ATOMIC_NUM, PROPERTY_SOURCE_IDS + +# attribute name in ChemGraph corresponding to a Dict[PropertyName, torch.BoolTensor] +# object that stores whether to use the unconditional embedding for each conditional field +_USE_UNCONDITIONAL_EMBEDDING = "_USE_UNCONDITIONAL_EMBEDDING" + + +def replace_use_unconditional_embedding( + batch: ChemGraph, use_unconditional_embedding: Dict[PropertySourceId, torch.BoolTensor] +) -> ChemGraph: + """ + Set the use of conditional or unconditional embeddings for each conditional field in the batch. + This utility will overwrite any batch._USE_CONDITIONAL_EMBEDDING keys included in use_unconditional_embedding + but will keep the value of any keys in batch._USE_CONDITIONAL_EMBEDDING that are not in + use_unconditional_embedding. + + Keyword arguments + ----------------- + batch: ChemGraph -- the batch of data to be modified. + use_unconditional_embedding: Dict[PropertyName, torch.BoolTensor] -- a dictionary whose values + are torch.BoolTensors of shape (n_structures_in_batch, 1) stating whether to use the unconditional embedding for + each conditional field. The keys are the names of the conditional fields in the batch. + + + Returns + ------- + ChemGraph -- the modified batch of data containing + ChemGraph._USE_CONDITIONAL_EMBEDDING: Dict[PropertyName, torch.BoolTensor]. When + ChemGraph[_USE_UNCONDITIONAL_EMBEDDING][cond_field][ii] is True, the iith data point will + use its unconditional embedding for cond_field. When False, the conditional embedding will be used. + """ + try: + existing_use_unconditional_embedding = batch[_USE_UNCONDITIONAL_EMBEDDING] + + for k, v in use_unconditional_embedding.items(): + existing_use_unconditional_embedding[k] = v + + return batch.replace(**{_USE_UNCONDITIONAL_EMBEDDING: existing_use_unconditional_embedding}) + except KeyError: + # no existing data + return batch.replace(**{_USE_UNCONDITIONAL_EMBEDDING: use_unconditional_embedding}) + + +def get_use_unconditional_embedding( + batch: ChemGraph, cond_field: PropertySourceId +) -> torch.BoolTensor: + """ + Returns + ------- + torch.BoolTensor, shape=(n_structures_in_batch, 1) -- whether to use the unconditional embedding for cond_field. + When True, we use unconditional embedding. + + NOTE: When _USE_UNCONDITIONAL_EMBEDDING is not in ChemGraph or cond_field is not + in ChemGraph[_USE_UNCONDITIONAL_EMBEDDING] we return a torch.BoolTensor with False + values. This allows a model trained conditional data to evaluate an unconditional score + without having to specify any conditional data in ChemGraph. + """ + try: + return batch[_USE_UNCONDITIONAL_EMBEDDING][cond_field] + except KeyError: + # when a PropertyEmbedding exists for a conditional field but it is + # not present in the ChemGraph, SetUnconditionalEmbeddingType and + # SetConditionalEmbeddingType will fail to set the torch.BoolTensor that + # get_use_conditional_embedding looks for. This results in a KeyError + # which we interpret as the user wanting to use the unconditional + # embedding for this property. + return torch.ones_like(batch["num_atoms"], dtype=torch.bool).reshape(-1, 1) + + +def tensor_is_not_nan(x: torch.Tensor) -> torch.BoolTensor: + """ + Keyword arguments + ----------------- + x: torch.Tensor, shape = (n_structures_in_batch, Ndim) -- labels for a single conditional field. + We assume that when a label is not present, the corresponding value is specified + as torch.nan. + + Returns + ------- + torch.BoolTensor, shape = (n_structures_in_batch,) -- index i is True if x[i] contains no NaNs + """ + return torch.all( + torch.reshape(torch.logical_not(torch.isnan(x)), (x.shape[0], -1)), + dim=1, + ) + + +def data_is_not_nan( + x: Union[torch.Tensor, list[str | None], list[list[str] | None]] +) -> torch.BoolTensor: + """ + Returns (n_structures_in_batch,) torch.BoolTensor of whether the conditional values + for a given property are not nan. + + NOTE: Currently we enforce no restriction on the data type that properties can have in + ChemGraph. The intent is that ChemGraph always contains property values in their + representation and type seen by the user. This means however that we have to distribute + handling of different types throughout the code, this function is one such place. + + """ + if isinstance(x, torch.Tensor): + return tensor_is_not_nan(x=x) + else: + return torch.tensor([_x is not None for _x in x]) + + +def get_cond_field_names_in_batch(x: ChemGraph) -> list[str]: + """ + Returns a list of field names that are known to be conditional properties in + PROPERTY_SOURCE_IDS, which are present in x. + """ + return [str(k) for k in x.keys() if k in PROPERTY_SOURCE_IDS] + + +class SetEmbeddingType: + def __init__( + self, + p_unconditional: float, + dropout_fields_iid: bool = False, + ): + """ + In PropertyEmbedding.forward we choose to concatenate either an unconditional embedding + (ignores the value of a property) or a conditional embedding (depends on the value of a property) + to the tensor that is input to the first node layer of each atom. This utility sets the internal state + of ChemGraph to randomly select either the conditional or unconditional embedding for each structure + in the batch. + + ChemGraph.[_USE_UNCONDITIONAL_EMBEDDING]: boolTensor, shape=(n_structures_in_batch, 1) stores a True + value for structures where we intend to use the unconditional embedding for all atoms contained in + that corresponding structure. + + This utility operates in 2 modes: + 1) dropout_fields_iid = True -- We randomly assign which conditional fields are unconditional and which + are conditional for fields that are not nan independently of whether all conditional fields are not + nan for that structure. This means that for a structure conditioned on (y1,y2) we can generate embeddings + corresponding to p(x), p(x|y1), p(x|y2), p(x|y1,y2). + 2) dropout_fields_iid = False - We assign conditional or unconditional embeddings to all conditional fields + of a single structure simultaneously. This means that for a structure conditioned on (y1,y2) we can + only generate embeddings corresponding to p(x) and p(|y1,y2). + + Keyword args: + ------------- + p_unconditional: float -- the probability of using the unconditional embedding in the score model. + dropout_fields_iid: bool -- whether to mask the conditional embedding of fields independently and + identically distributed according to p_unconditional. If False, the score model is only exposed + to two scenarios: 1) all conditional fields have their unconditional embedding. 2) all conditional + fields have their conditional embedding. If True, the score model is exposed to all possible + combinations of conditional fields having their unconditional or conditional embeddings, ie the score + model will learn p(x), p(x|y1), p(x_y2), p(x|y1,y2),... + + Note: when dropout_fields_iid=False, the conditional embedding will only be used when all + conditional fields have data present. If no single data point has data present for all conditional + fields, then the score model will only be exposed to the unconditional embedding state p(x) and the + joint p(x|y1,y2,...) will not be learned. + """ + self.p_unconditional = p_unconditional + self.dropout_fields_iid = dropout_fields_iid + + def __call__(self, x: ChemGraph) -> ChemGraph: + # list of conditional fields present in the batch + cond_fields: list[str] = get_cond_field_names_in_batch(x=x) + + if len(cond_fields) == 0: + return x + else: + # assume all conditional fields have same batch size + batch_size = len(x[cond_fields[0]]) + + # not all cond_fields are torch tensor objects, eg chemical_system + device = x["num_atoms"].device + + # get dictionary of which conditional fields are present (not nan) + # values are torch.BoolTensors of shape (batch_size, ) - when element 'i' is True, a label exists for this data point for this field + data_is_not_nan_dict: Dict[PropertySourceId, torch.BoolTensor] = { + cond_field: data_is_not_nan(x=x[cond_field]).to(device=device) # type: ignore + for cond_field in cond_fields + } + + # element `i` is True when all conditional fields have data present for this data point + # this is useful for when we want to use the (un)conditional embedding for all conditional + # fields per data point simultaneously + alldata_is_not_nan: torch.BoolTensor = torch.all( + torch.cat( + [ + cond_data_not_nan.reshape(-1, 1) + for cond_data_not_nan in data_is_not_nan_dict.values() + ], + dim=1, + ), + dim=1, + ) + + # when True, use the unconditional embedding for this conditional field and data point + use_unconditional_embedding: Dict[PropertySourceId, torch.BoolTensor] = {} + + for cond_field in cond_fields: + # by default use the unconditional embedding (embedding_type=True) + embedding_type = torch.ones((batch_size, 1), device=device, dtype=torch.bool) + + if self.dropout_fields_iid: + # torch.BoolTensor, shape = (n_structures_in_batch, 1) -- True when conditional field is not nan + cond_data_is_not_nan = data_is_not_nan_dict[cond_field] # type: ignore + else: + # torch.BoolTensor, shape = (n_structures_in_batch, 1) -- True when all conditional fields are not nan + cond_data_is_not_nan = alldata_is_not_nan + + # assign conditional embedding to (1-self.p_unconditional) of values where cond_data_is_not_nan=True + embedding_type[cond_data_is_not_nan] = ( # type: ignore + torch.rand((cond_data_is_not_nan.sum(), 1), device=device) # type: ignore + <= self.p_unconditional + ) + + # torch.BoolTensor, shape=(n_structures_in_batch,1) -- when True use the unconditional embedding + use_unconditional_embedding[cond_field] = embedding_type # type: ignore + + return replace_use_unconditional_embedding( + batch=x, use_unconditional_embedding=use_unconditional_embedding + ) + + +class SetUnconditionalEmbeddingType: + """ + In PropertyEmbedding.forward we choose to concatenate either an unconditional embedding + (ignores the value of a property) or a conditional embedding (depends on the value of a property) + to the tensor that is input to the first node layer of each atom. This utility sets the internal state + of ChemGraph to use the unconditional embedding for all structures for all conditional fields present + in the batch. Note that conditional fields in the batch are automatically determined by the presence + of any PropertyName in ChemGraph. + + ChemGraph.[_USE_UNCONDITIONAL_EMBEDDING]: boolTensor, shape=(n_structures_in_batch, 1) stores True + for all structures for all conditional properties present in ChemGraph. + + NOTE: If a conditional property was trained on by the model but is not + specified in the batch, then it will be attributed an unconditional embedding + in mattergen.property_embeddings.PropertyEmbedding.forward. + This behaviour allows unconditional samples to be drawn from a model that was trained + on certain conditions, without having to set any conditional values in ChemGraph. + """ + + def __call__(self, x: ChemGraph) -> ChemGraph: + # list of conditional fields present in the batch + cond_fields = get_cond_field_names_in_batch(x=x) + + device = x["num_atoms"].device + + return replace_use_unconditional_embedding( + batch=x, + use_unconditional_embedding={ + cond_field: torch.ones((len(x[cond_field]), 1), dtype=torch.bool, device=device) # type: ignore + for cond_field in cond_fields + }, + ) + + +class SetConditionalEmbeddingType: + """ + In PropertyEmbedding.forward we choose to concatenate either an unconditional embedding + (ignores the value of a property) or a conditional embedding (depends on the value of a property) + to the tensor that is input to the first node layer of each atom. This utility sets the internal state + of ChemGraph to use the unconditional embedding for all structures for all conditional fields present + in the batch. Note that conditional fields in the batch are automatically determined by the presence + of any PropertyName on in ChemGraph. + + ChemGraph.[_USE_UNCONDITIONAL_EMBEDDING]: boolTensor, shape=(n_structures_in_batch, 1) stores False + for all structures for all conditional properties present in ChemGraph. + + NOTE: If a conditional property was trained on by the model but is not + specified in the batch, then it will be attributed an unconditional embedding + in mattergen.property_embeddings.PropertyEmbedding.forward. + This behaviour allows unconditional samples to be drawn from a model that was trained + on certain conditions, without having to set any conditional values in ChemGraph. + """ + + def __call__(self, x: ChemGraph) -> ChemGraph: + # a list of all conditional properties present in the batch + cond_fields = get_cond_field_names_in_batch(x=x) + + device = x["num_atoms"].device + + use_unconditional_embedding = {} + for cond_field in cond_fields: + # use the conditional embedding for all conditional + # properties present in the batch. If we want to sample + # marginalise out any conditional properties that the model + # was trained on, them exclude them from ChemGraph + use_unconditional_embedding[cond_field] = torch.zeros( + (len(x[cond_field]), 1), dtype=torch.bool, device=device + ) + + return replace_use_unconditional_embedding( + batch=x, use_unconditional_embedding=use_unconditional_embedding # type: ignore + ) + + +class BaseUnconditionalEmbeddingModule(torch.nn.Module): + # If True, we don't need conditional values to evaluate an unconditional score + # This allows evaluationg of an unconditional score without needing to specify + # any conditional values in the batch + only_depends_on_shape_of_input: bool + + # This is the embedding dimension, the embedding module will output a + # torch.tensor of shape (n_structures_in_batch, hidden_dim) + hidden_dim: int + + +class EmbeddingVector(BaseUnconditionalEmbeddingModule): + # If True, we don't need conditional values to evaluate an unconditional score + only_depends_on_shape_of_input: bool = True + + def __init__(self, hidden_dim: int): + super().__init__() + # a vector of learnable parameters of shape (hidden_dim,) + self.embedding = torch.nn.Embedding(1, hidden_dim) + self.hidden_dim = hidden_dim + + def forward(self, x: torch.Tensor) -> torch.Tensor: + """ + This forward depends only on the shape of x and returns a tensor of zeros. + """ + return self.embedding( + torch.zeros(len(x), dtype=torch.long, device=self.embedding.weight.device) + ) + + +class SpaceGroupEmbeddingVector(BaseUnconditionalEmbeddingModule): + # If True, we don't need conditional values to evaluate an unconditional score + only_depends_on_shape_of_input: bool = True + + def __init__(self, hidden_dim: int): + super().__init__() + # a vector of learnable parameters of shape (hidden_dim,) + self.embedding = torch.nn.Embedding(230, hidden_dim) + self.hidden_dim = hidden_dim + + def forward(self, x: torch.Tensor) -> torch.Tensor: + """ + Return embedding of the space group, 1 is subtracted from the space group number to + make it zero-indexed. + """ + return self.embedding(x.long() - 1) + + +class ZerosEmbedding(BaseUnconditionalEmbeddingModule): + """ + Return a [n_crystals_in_batch, self.hidden_dim] tensor of zeros. This is helpfuln as the unconditional embedding + for a property included in the adapter module if we do not want to change the unconditional score + of the base model when properties are added in the adapter module. + """ + + # If True, we don't need conditional values to evaluate an unconditional score + only_depends_on_shape_of_input: bool = True + + def __init__(self, hidden_dim: int): + super().__init__() + + self.hidden_dim = hidden_dim + + def forward(self, x: torch.Tensor | list[str]) -> torch.Tensor: + """ + This forward depends only on the shape of x. + """ + return torch.zeros(len(x), self.hidden_dim) + + +class ChemicalSystemMultiHotEmbedding(torch.nn.Module): + def __init__(self, hidden_dim: int): + super().__init__() + self.hidden_dim = hidden_dim + self.embedding = torch.nn.Linear(in_features=MAX_ATOMIC_NUM + 1, out_features=hidden_dim) + + @property + def device(self): + return next(self.parameters()).device + + @staticmethod + def _sequence_to_multi_hot(x: Sequence[str], device: torch.device) -> torch.Tensor: + """ + Converts a sequence of unique elements present in a single structure to a multi-hot + vectors of 1s (present) and 0s (not present) for each unique element. + + Returns + ------- + torch.Tensor, shape = (1, MAX_ATOMIC_NUM + 1) + """ + # torch.LongTensor of indices of each element in the sequence + chemical_system_numbers: torch.LongTensor = torch.tensor( + [get_atomic_number(symbol=_element) for _element in x], dtype=int, device=device + ) + # 1-d vectors of 1s and 0s for each unique element + chemical_system_condition = torch.zeros(MAX_ATOMIC_NUM + 1, device=device) + # set 1s for elements that are present + chemical_system_condition[chemical_system_numbers] = 1.0 + return chemical_system_condition.reshape(1, -1) + + @staticmethod + def sequences_to_multi_hot(x: list[list[str]], device: torch.device) -> torch.Tensor: + """ + Convert a list of sequences of unique elements present in a list of structures to a multi-hot + tensor of 1s (present) and 0s (not present) for each unique element. + + Returns + ------- + torch.Tensor, shape = (n_structures_in_batch, MAX_ATOMIC_NUM + 1) + """ + return torch.cat( + [ChemicalSystemMultiHotEmbedding._sequence_to_multi_hot(_x, device=device) for _x in x], + dim=0, + ) + + @staticmethod + def convert_to_list_of_str(x: list[str] | list[list[str]]) -> list[list[str]]: + """ + Returns + ------- + list[list[str]] -- a list of length n_structures_in_batch of chemical systems for each structure + where the chemical system is specified as a list of unique elements in the structure. + """ + if isinstance(x[0], str): + # list[Sequence[str]] + x = [_x.split("-") for _x in x if isinstance(_x, str)] + + return x # type: ignore + + def forward(self, x: list[str] | list[list[str]]) -> torch.Tensor: + """ + Keyword arguments + ----------------- + x: Union[list[str], list[Sequence[str]]] -- if elements are a string, they are assumed to be + a '-' delimited list of unique elements. If a sequence of strings, it is assumed to be a list of + unique elements in the structure. + """ + # make sure each chemical system is specified as a list of unique elements in the structure + # list[list[str]] + x = self.convert_to_list_of_str(x=x) + + # shape=(n_structures_in_batch, MAX_ATOMIC_NUM + 1) + multi_hot_representation: torch.Tensor = self.sequences_to_multi_hot(x=x, device=self.device) # type: ignore + + return self.embedding(multi_hot_representation) + + +class PropertyEmbedding(torch.nn.Module): + def __init__( + self, + name: PropertySourceId, + conditional_embedding_module: torch.nn.Module, + unconditional_embedding_module: BaseUnconditionalEmbeddingModule, + scaler: torch.nn.Module = torch.nn.Identity(), + ): + super().__init__() + self.name = name + self.conditional_embedding_module = conditional_embedding_module + self.unconditional_embedding_module = unconditional_embedding_module + self.scaler = scaler + assert self.name in PROPERTY_SOURCE_IDS, ( + f"PropertyEmbedding.name {self.name} not found in the database. " + f"Available property_source_ids: {PROPERTY_SOURCE_IDS}" + ) + + def forward(self, batch: ChemGraph) -> torch.Tensor: + """ + ChemGraph[_USE_UNCONDITIONAL_EMBEDDING]: Dict[str, torch.BoolTensor] + has values torch.BoolTensor, shape=(n_structures_in_batch, 1) that when True, denote that + we should use the unconditional embedding (instead of the conditional embedding) as input + for that property to the input nodes of each atom in the structure. + + In this forward, we return a torch.Tensor, shape=(n_structures_in_batch, hidden_dim) of + embedding values for this property for each structure in the batch. Based on the state of + ChemGraph[_USE_UNCONDITIONAL_EMBEDDING] we return either the unconditional or conditional + embedding for each element i in torch.Tensor[i]. + + NOTE: when self.name is not in ChemGraph[_USE_UNCONDITIONAL_EMBEDDING] we apply the + unconditional embedding. This is to adopt the behaviour that when no conditional value is + specified in ChemGraph, a model that was trained on said property will generate an + unconditional score. + """ + # shape=(n_structures_in_batch, 1) -- True when use the unconditional embedding + # NOTE: when ChemGraph[_USE_UNCONDITIONAL_EMBEDDING][self.name] is absent, as + # happens when self.name is missing from ChemGraph, we return a torch.BoolTensor + # that is all True - ie. we use the unconditional embedding for all structures + # in the batch. This is so that we can draw unconditional samples from a model + # trained on conditions without having to specify conditional values in ChemGraph. + use_unconditional_embedding: torch.BoolTensor = get_use_unconditional_embedding( + batch=batch, cond_field=self.name + ) + + if ( + torch.all(use_unconditional_embedding) + and self.unconditional_embedding_module.only_depends_on_shape_of_input + ): + # this allows evaluation of the unconditional score without having to supply conditional values for this property + return self.unconditional_embedding_module(x=batch["num_atoms"]).to(batch.pos.device) + else: + # raw values for the conditional data as seen by the user, eg dft_bulk_modulus=torch.tensor([300]*n_structures_in_batch) + data = batch[self.name] + if isinstance(data, torch.Tensor) and data.dim() == 2: + # [B, 1] => [B,] + data = data.squeeze(-1) + + # optionally apply normalization, eg unit standard deviation and zero mean + data = self.scaler(data) + conditional_embedding: torch.Tensor = self.conditional_embedding_module(data) + unconditional_embedding: torch.Tensor = self.unconditional_embedding_module(x=data).to( + batch.pos.device + ) + + return torch.where( + use_unconditional_embedding, unconditional_embedding, conditional_embedding + ) + + def fit_scaler(self, all_data): + if isinstance(self.scaler, torch.nn.Identity): + return + self.scaler.fit(all_data) + + +def get_property_embeddings( + batch: ChemGraph, property_embeddings: torch.nn.ModuleDict +) -> torch.Tensor: + """ + Keyword arguments + ----------------- + property_embeddings: torch.nn.ModuleDict[PropertyToConditonOn, PropertyEmbedding] -- a dictionary + of property embeddings. The keys are the names of the conditional fields in the batch. + """ + # we need a consistent order for the embeddings that does not depend on the order + # specified by the user + ordered_keys = sorted(property_embeddings.keys()) + + if len(ordered_keys) > 0: + # shape = (n_structures_in_batch, sum(embedding_dims)) for embedding_dims: list[int] a list of the output dimension for each embedding + return torch.cat( + [property_embeddings[k].forward(batch=batch) for k in ordered_keys], dim=-1 + ) + else: + # torch.cat doesn't accept an empty list + return torch.tensor([], device=batch["num_atoms"].device) + + +def set_conditional_property_values(batch: ChemGraph, properties: TargetProperty) -> ChemGraph: + # list of conditional field names that are not torch tensor objects in ChemGraph + not_numeric = [k for k, v in properties.items() if not isinstance(v, (int, float))] + + cond_values = { + k: ( + [properties[k]] * len(batch["num_atoms"]) + if k in not_numeric + else torch.full_like(batch["num_atoms"], v).reshape(-1, 1) + ) + for k, v in properties.items() + } + + return batch.replace(**cond_values) # type: ignore diff --git a/data/mattergen/tests/__init__.py b/data/mattergen/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/mattergen/tests/test_diffusion_instantiation.py b/data/mattergen/tests/test_diffusion_instantiation.py new file mode 100644 index 0000000000000000000000000000000000000000..ccbd0386d1d64e77f3bed9e46fbfdfbb090e2482 --- /dev/null +++ b/data/mattergen/tests/test_diffusion_instantiation.py @@ -0,0 +1,43 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import os +import sys + +sys.path.append(os.path.join(os.path.dirname(__file__), "../../scripts")) + +import hydra +import pytest + +from mattergen.common.utils.globals import MODELS_PROJECT_ROOT +from scripts.run import mattergen_main + +CONFIG_DIR = os.path.join(MODELS_PROJECT_ROOT, "conf") + + +@pytest.mark.parametrize("config_name", ["default"]) +def test_train_on_one_batch(config_name: str) -> None: + # Tests that the model can be instantiated and trained on one batch. + + # override some config options to make the run short. + overrides = [ + "trainer.max_epochs=1", + "+trainer.overfit_batches=1", + "trainer.check_val_every_n_epoch=1", + "lightning_module.diffusion_module.model.gemnet.num_blocks=1", + "lightning_module.diffusion_module.model.gemnet.max_neighbors=5", + "lightning_module.diffusion_module.model.hidden_dim=16", + "data_module.batch_size.train=8", + "data_module.batch_size.val=8", + "data_module.batch_size.test=8", + "+trainer.limit_val_batches=1", + "+trainer.limit_test_batches=1", + "trainer.accelerator=cpu", + "~trainer.logger", # wandb does not work in CI + ] + with hydra.initialize_config_dir(config_dir=CONFIG_DIR): + config = hydra.compose(config_name=config_name, overrides=overrides) + + _ = mattergen_main(config) + # if we reach this, the test passed. + assert True diff --git a/data/mattergen/tests/test_generator.py b/data/mattergen/tests/test_generator.py new file mode 100644 index 0000000000000000000000000000000000000000..1cf361843f464335a5dd592e7370195b38d3b73a --- /dev/null +++ b/data/mattergen/tests/test_generator.py @@ -0,0 +1,24 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from typing import List + +import pytest + +from mattergen.common.utils.globals import MAX_ATOMIC_NUM +from mattergen.property_embeddings import ChemicalSystemMultiHotEmbedding + + +@pytest.mark.parametrize("chemical_system", [["Li", "O"], ["Li", "O", "F"], ["C", "O", "H"]]) +def test_chemical_system_to_multi_hot(chemical_system: List[str]) -> None: + # test that multi-hot encoding executes without error and is correct shape and has correct number of 1s in columns + + multi_hot_encoding = ChemicalSystemMultiHotEmbedding._sequence_to_multi_hot( + x=chemical_system, device="cpu" + ) + + assert multi_hot_encoding.shape == ( + 1, + MAX_ATOMIC_NUM + 1, + ) + assert multi_hot_encoding.sum() == len(chemical_system) diff --git a/data/mattergen/tests/test_mattergen_denoiser.py b/data/mattergen/tests/test_mattergen_denoiser.py new file mode 100644 index 0000000000000000000000000000000000000000..2d5e42b92480a1d3c43b9d2cb5e7c50134f035d1 --- /dev/null +++ b/data/mattergen/tests/test_mattergen_denoiser.py @@ -0,0 +1,253 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import pytest +import torch +from torch_scatter import scatter_add + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.data.collate import collate +from mattergen.common.data.transform import set_chemical_system_string +from mattergen.common.utils.globals import MAX_ATOMIC_NUM +from mattergen.denoiser import mask_disallowed_elements +from mattergen.property_embeddings import ( + ChemicalSystemMultiHotEmbedding, + SetConditionalEmbeddingType, + SetEmbeddingType, + SetUnconditionalEmbeddingType, + get_use_unconditional_embedding, + replace_use_unconditional_embedding, +) + + +@pytest.mark.parametrize("p_unconditional", [0.0, 1.0]) +def test_pre_corruption_fn(p_unconditional: float): + pre_corruption_fn = SetEmbeddingType( + p_unconditional=p_unconditional, dropout_fields_iid=False # type: ignore + ) + + # dummy data with nan (missing data) values in batch elements 0, 2, 3 + pos = torch.rand((10, 2, 3)) + + # if any element of a data point is nan, whole data point + # will be treated as having missing label + pos[0, 0, 0] = torch.nan + pos[2, 1, 2] = torch.nan + pos[3] = torch.nan + + x_with_mask = pre_corruption_fn( + x=ChemGraph(pos=pos, num_atoms=torch.ones((10, 1), dtype=int), dft_bulk_modulus=pos) + ) + + mask = get_use_unconditional_embedding(batch=x_with_mask, cond_field="dft_bulk_modulus") # type: ignore + + # there are 7 available labels in total, corresponding to 3 masked conditions + num_masked = {0.0: 3, 1.0: 10}[p_unconditional] + + assert mask.sum() == num_masked + + +@pytest.mark.parametrize( + "p_unconditional, dropout_fields_iid", [(0.0, True), (0.0, False), (1.0, True), (1.0, False)] +) +def test_pre_corruption_fn_multi(p_unconditional: float, dropout_fields_iid: bool): + pre_corruption_fn = SetEmbeddingType( + p_unconditional=p_unconditional, + dropout_fields_iid=dropout_fields_iid, + ) + + # dummy data with nan (missing data) values in batch elements 0, 2, 3 + pos = torch.rand((10, 2, 3)) + + # if any element of a data point is nan, whole data point + # will be treated as having missing label + pos[0, 0, 0] = torch.nan + pos[2, 1, 2] = torch.nan + pos[3] = torch.nan + + # dummy data with nan (missing data) values in batch elements 1, 2, 4, 5 + cell = torch.rand((10, 3, 3)) + + cell[1, 0, 0] = torch.nan + cell[2, 1, 0] = torch.nan + cell[4, 0, 2] = torch.nan + cell[5, 1, 1] = torch.nan + + x_with_mask = pre_corruption_fn( + x=ChemGraph( + pos=pos, + num_atoms=torch.ones((10, 1), dtype=int), + cell=cell, + dft_bulk_modulus=pos, + dft_shear_modulus=cell, + ) + ) + + for cond_field in ["dft_bulk_modulus", "dft_shear_modulus"]: + # True when we want to use unconditional embedding + mask = get_use_unconditional_embedding(batch=x_with_mask, cond_field=cond_field) # type: ignore + + number_masked = mask.sum() + + if p_unconditional == 0.0: + # all conditional embeddings are used for non-nan data + + if dropout_fields_iid: + # conditional fields are masked independently + expected_number_masked = {"dft_bulk_modulus": 3, "dft_shear_modulus": 4}[cond_field] + else: + # all conditional fields must be non nan + expected_number_masked = 6 + elif p_unconditional == 1.0: + # no conditional embeddings are used + expected_number_masked = 10 + else: + raise Exception("p_unconditional must be 0.0 or 1.0") + + assert number_masked == expected_number_masked + + # test SetEmbeddingType runs successfully when no conditioning fields are specified + pre_corruption_fn = SetEmbeddingType( + p_unconditional=p_unconditional, + dropout_fields_iid=dropout_fields_iid, + ) + + _ = pre_corruption_fn( + x=ChemGraph( + pos=pos, + cell=cell, + dft_bulk_modulus=pos, + dft_shear_modulus=cell, + num_atoms=torch.ones((10, 1)), + ) + ) + + +def test_remove_conditioning_fn(): + # check all relevant fields are masked + + x = ChemGraph( + pos=torch.rand(10, 3), + forces=torch.rand(10, 3), + atomic_numbers=torch.ones((10,), dtype=torch.int), + num_atoms=torch.ones((10, 1), dtype=int), + dft_bulk_modulus=torch.randn(10, 3), + dft_shear_modulus=torch.randn(10, 3), + ) + + # fields to condition on + cond_fields = ["dft_bulk_modulus", "dft_shear_modulus"] + + # introduce masking attribute that is always True for conditioned on fields + mask_all = SetUnconditionalEmbeddingType() + + x_with_mask = mask_all(x=x) + + for cond_field in cond_fields: + torch.testing.assert_close( + get_use_unconditional_embedding(batch=x_with_mask, cond_field=cond_field), # type: ignore + torch.ones((10, 1), dtype=torch.bool), + ) + + +def test_keep_conditioning_fn(): + x = ChemGraph( + pos=torch.rand(10, 3), + forces=torch.rand(10, 3), + atomic_numbers=torch.ones((10,), dtype=torch.int), + num_atoms=torch.ones((10, 1), dtype=int), + dft_bulk_modulus=torch.rand(10, 3), + dft_shear_modulus=torch.randn(10, 3), + ) + + # fields to condition on + + # mask atomic_numbers as we don't want to condition on this + x_with_mask = SetConditionalEmbeddingType()(x=x) + + # we do not want to condition on atomic_numbers, so they are masked + torch.testing.assert_close( + get_use_unconditional_embedding(batch=x_with_mask, cond_field="dft_bulk_modulus"), + torch.zeros((10, 1), dtype=torch.bool), + ) + + # we do want to condition on pos, so it is not masked + torch.testing.assert_close( + get_use_unconditional_embedding(batch=x_with_mask, cond_field="dft_shear_modulus"), + torch.zeros((10, 1), dtype=torch.bool), + ) + + +@pytest.mark.parametrize("zero_based_predictions", [True, False]) +def test_mask_disallowed_elements(zero_based_predictions: bool): + torch.manual_seed(23232) + samples = [ + ChemGraph( + pos=torch.rand(10, 3), + num_atoms=torch.tensor([10]), + atomic_numbers=6 * torch.ones((10,), dtype=torch.int), + cell=torch.eye(3), + ), + ChemGraph( + pos=torch.rand(5, 3), + num_atoms=torch.tensor([5]), + # La, Na, O, Sb, Sc + atomic_numbers=torch.tensor([57, 11, 8, 51, 21]), + cell=torch.eye(3), + ), + ChemGraph( + pos=torch.rand(15, 3), + num_atoms=torch.tensor([15]), + # La, Na, O, Sb, Sc + atomic_numbers=torch.tensor([57, 11, 8, 51, 21, 57, 11, 8, 51, 21, 57, 11, 8, 51, 21]), + cell=torch.eye(3), + ), + ] + + transform = set_chemical_system_string + batch = collate([transform(sample) for sample in samples]) + assert hasattr(batch, "chemical_system") # mypy + assert hasattr(batch, "pos") # mypy + assert hasattr(batch, "batch") # mypy + assert hasattr(batch, "cell") # mypy + assert hasattr(batch, "atomic_numbers") # mypy + assert hasattr(batch, "num_atoms") # mypy + mask = torch.tensor([0, 0, 1], dtype=torch.bool)[:, None] + + batch_chemgraph = ChemGraph( + pos=batch.pos, + cell=batch.cell, + atomic_numbers=batch.atomic_numbers, + num_atoms=batch.num_atoms, + chemical_system=batch.chemical_system, + ) + batch_chemgraph = replace_use_unconditional_embedding(batch=batch_chemgraph, use_unconditional_embedding={"chemical_system": mask}) # type: ignore + + example_logits = torch.randn(batch.pos.shape[0], MAX_ATOMIC_NUM + 1) + masked_logits = mask_disallowed_elements( + logits=example_logits, + x=batch_chemgraph, + batch_idx=batch.batch, + predictions_are_zero_based=zero_based_predictions, + ) + sampled = torch.distributions.Categorical(logits=masked_logits).sample() + int( + zero_based_predictions + ) + sampled_onehot = torch.eye(MAX_ATOMIC_NUM + 1)[sampled] + sampled_chemical_systems = scatter_add(sampled_onehot, batch.batch, dim=0) + + # shape=(Nbatch, MAX_NUM_ATOMS+1) + chemsys_multi_hot: torch.LongTensor = ChemicalSystemMultiHotEmbedding.sequences_to_multi_hot( + x=ChemicalSystemMultiHotEmbedding.convert_to_list_of_str(x=batch.chemical_system), + device=mask.device, + ) + + for ix, system in enumerate(sampled_chemical_systems): + sampled_types = system.nonzero()[:, 0].tolist() + + chemsys = chemsys_multi_hot[ix].nonzero()[:, 0].tolist() + + if mask[ix] == 0: + assert set(sampled_types).difference(set(chemsys)) == set() + else: + assert set(sampled_types).difference(set(chemsys)) != set() diff --git a/data/mattergen/tests/test_sde_lib.py b/data/mattergen/tests/test_sde_lib.py new file mode 100644 index 0000000000000000000000000000000000000000..ddd0979f39e891ed34b998cd8b800fada3340227 --- /dev/null +++ b/data/mattergen/tests/test_sde_lib.py @@ -0,0 +1,200 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +from abc import ABC, abstractmethod +from math import pi +from typing import Optional, Tuple + +import pytest +import torch + +from mattergen.common.data.chemgraph import ChemGraph +from mattergen.common.diffusion.corruption import ( + LatticeVPSDE, + expand, + make_noise_symmetric_preserve_variance, +) +from mattergen.diffusion.corruption.sde_lib import VPSDE + + +class TestVPSDE(VPSDE, ABC): + @classmethod + @abstractmethod + def get_random_data(cls, N: int) -> torch.Tensor: + pass + + @abstractmethod + def get_limit_mean( + self, x: torch.Tensor, limit_info: Optional[torch.Tensor] = None + ) -> torch.Tensor: + pass + + @abstractmethod + def get_limit_var( + self, x: torch.Tensor, limit_info: Optional[torch.Tensor] = None + ) -> torch.Tensor: + pass + + @abstractmethod + def assert_discretize_ok(self, x: torch.Tensor) -> None: + pass + + +def test_LatticeVPSDE_get_limit_mean(): + density = 15.0 # (atoms/Angstrom**3) - this is a very large magnitude to ensure signal>>noise in this unit test + + sde = LatticeVPSDE(limit_density=density, limit_mean="scaled") + + # number atoms per crystal + n_atoms = torch.tensor([1, 2]) + batch = ChemGraph(num_atoms=n_atoms) + + # crystal lattices are not used in LatticeVPSDE.get_limit_mean, shape=[2, 3, 3] + lattices = torch.eye(3).expand(2, 3, 3) + + # shape=[2, 3, 3] + lattice_mean = sde.get_limit_mean(x=lattices, batch=batch) + + # expected value on diagonals is (n_atoms/density)**(1/3) + expected_val = torch.pow(n_atoms / density, 1 / 3) + + assert torch.allclose(lattice_mean[0], expected_val[0] * torch.eye(3)) + assert torch.allclose(lattice_mean[1], expected_val[1] * torch.eye(3)) + + +def test_LatticeVPSDE_get_var_mean(): + density = 20.0 # (atoms/Angstrom**3) + + sde = LatticeVPSDE(limit_density=density) + + # number atoms per crystal + n_atoms = torch.tensor([1, 2]) + batch = ChemGraph(num_atoms=n_atoms) + # crystal lattices are not used in LatticeVPSDE.get_limit_var, shape=[2, 3, 3] + lattices = torch.eye(3).expand(2, 3, 3) + + # shape=[2, 3, 3] + lattice_var = sde.get_limit_var(x=lattices, batch=batch) + + # expected variance is n_atoms**(2/3), shape=(2, 3, 3) + expected_val = ( + expand(torch.pow(n_atoms, 2 / 3), (2, 3, 3)).tile(1, 3, 3) * sde.limit_var_scaling_constant + ) + + assert torch.allclose(lattice_var, expected_val) + + +def test_LatticeVPSDE_prior_sampling(): + # limit density (atoms/Angstrom**3) + density = 20.0 + # number crystals + Nbatch = 1000 + # 10 atoms per crystal + n_atoms = torch.ones((Nbatch,)) * 10 + batch = ChemGraph(num_atoms=n_atoms) + + sde = LatticeVPSDE(limit_density=density) + + # sample from noisy limit prior, all elements are ~N(0, 1) + x = sde.prior_sampling(shape=(Nbatch, 3, 3), conditioning_data=batch) + + expected_mean = sde.get_limit_mean(x=x, batch=batch).mean(0) + expected_var = sde.get_limit_var(x=x, batch=batch).mean(0)[0, 0] + + assert x.shape == (Nbatch, 3, 3) + # all elements in noisy state should be IID as N(0,1) + assert torch.allclose(x.mean(0), expected_mean, atol=1e-1) + assert torch.allclose(x.var(0).mean(), expected_var, atol=1e-1) + + +def test_LatticeVPSDE_prior_logp(): + # evaluate the log likelihood of sample x~p_T the noisy limit distribution + + # limit density (atoms/Angstrom**3) + density = 20.0 + # number crystals + Nbatch = 100 + # 10 atoms per crystal + n_atoms = torch.ones((Nbatch,)) * 10 + batch = ChemGraph(num_atoms=n_atoms) + + sde = LatticeVPSDE(limit_density=density, limit_var_scaling_constant=1.0) + + # sample from noisy limit prior, all elements are ~N(0, 1) + x = sde.prior_sampling(shape=(Nbatch, 3, 3), conditioning_data=batch) + + # pdf for standard normal = exp(-x**2/2)/sqrt(2 pi ), shape=(Nbatch, 3, 3) + expected_log_likelihood = -0.5 * torch.pow(x, 2) - 0.5 * torch.log(torch.tensor([2.0 * pi])) + + # sum over IID contributions from data dimensions + expected_log_likelihood = torch.sum(expected_log_likelihood, dim=(-2, -1)) + + assert torch.allclose(sde.prior_logp(z=x, batch=batch), expected_log_likelihood) + + +def test_LatticeVPSDE_marginal_prob(): + # check mean and standard deviation of the distribution p(x_t|x_0) + + # limit density (atoms/Angstrom**3) + density = 20.0 + # number crystals + Nbatch = 100 + # 10 atoms per crystal + n_atoms = torch.ones((Nbatch,)) * 10 + batch = ChemGraph(num_atoms=n_atoms) + + sde = LatticeVPSDE(limit_density=density, limit_var_scaling_constant=1.0) + + t = torch.ones((1,)) * 0.5 + x = torch.ones(Nbatch, 3, 3) + + # get moments for p(x_t | x_0) + mean, std = sde.marginal_prob(x=x, t=t, batch=batch) + + # p(x_t|x_0) = N(x_t | mean, var) as per Eq. 33 in https://arxiv.org/pdf/2011.13456v2.pdf + coeff = torch.exp(-0.25 * (t**2) * (sde.beta_1 - sde.beta_0) - 0.5 * t * sde.beta_0) + expected_mean = coeff * x + (1 - coeff)[:, None, None] * ( + torch.eye(3)[None] * batch.num_atoms[:, None, None] / density + ).pow(1.0 / 3) + + # vanilla term for unit variance noisy limit distribution + expected_var = 1 - torch.exp(-0.5 * (t**2) * (sde.beta_1 - sde.beta_0) - t * sde.beta_0) + + # account for fact we have non unit variance limit distribution in general + expected_var = expected_var * sde.get_limit_var(x=x, batch=batch) + + assert mean.shape == (Nbatch, 3, 3) + assert std.shape == (Nbatch, 3, 3) + assert torch.allclose(expected_mean, mean) + assert torch.allclose(expected_var.sqrt(), std) + + +def test_make_noise_symmetric_preserve_variance(): + noise = torch.randn(100_000, 3, 3) + symmetric_noise = make_noise_symmetric_preserve_variance(noise) + assert torch.allclose(noise.var(), symmetric_noise.var(), atol=1e-2) + assert torch.allclose(noise.mean(), symmetric_noise.mean(), atol=1e-2) + + # should raise an assertion error if noise is not a (batched) square matrix + with pytest.raises(AssertionError): + make_noise_symmetric_preserve_variance(torch.randn(100_000, 3, 4)) + with pytest.raises(AssertionError): + make_noise_symmetric_preserve_variance( + torch.randn( + 100_000, + 3, + ) + ) + with pytest.raises(AssertionError): + make_noise_symmetric_preserve_variance(torch.randn(100_000, 3, 1)) + + +@pytest.mark.parametrize("output_shape", [(10, 3, 3), (10, 3, 1), (10, 3), (10, 2), (10, 3, 9, 1)]) +def test_expand(output_shape: Tuple): + unexpanded_data = torch.randn((10,)) + expanded_data = expand(unexpanded_data, output_shape) + + assert len(expanded_data.shape) == len(output_shape) + + # we only match the len, not number of elements + assert expanded_data.shape != output_shape diff --git a/data/pyproject.toml b/data/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..434d779c6b3c5d47d8ee4a92e4f2707c86a6fcb5 --- /dev/null +++ b/data/pyproject.toml @@ -0,0 +1,81 @@ +[tool.black] +line-length = 100 +include = '\.pyi?$' +exclude = ''' +/( + \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist +)/ +''' + +[tool.isort] +profile = "black" +line_length = 100 +known_first_party = [ + "mattergen", +] + +[project] +name = "mattergen" +version = "1.0" +requires-python = ">= 3.10" + +dependencies = [ +"ase>=3.22.1", +"autopep8", +"cachetools", +"contextlib2", +"emmet-core>=0.84.2", # keep up-to-date together with pymatgen, atomate2 +"fire", # see https://github.com/google/python-fire +"hydra-core==1.3.1", +"hydra-joblib-launcher==1.1.5", +"jupyterlab>=4.2.5", +"lmdb", +"matplotlib==3.8.4", +"matscipy>=0.7.0", +"mattersim>=1.1", +"monty==2024.7.30 ", # keep up-to-date together with pymatgen, atomate2 +"notebook>=7.2.2", +"numpy<2.0", # pin numpy before breaking changes in 2.0 +"omegaconf==2.3.0", +"pymatgen>=2024.6.4", +"pylint", +"pytest", +"pytorch-lightning==2.0.6", +"setuptools", +"SMACT", +"sympy>=1.11.1", +"torch==2.2.1+cu118", +"torchvision==0.17.1+cu118", +"torchaudio==2.2.1+cu118", +"torch_cluster", +"torch_geometric>=2.5", +"torch_scatter", +"torch_sparse", +"tqdm", +"wandb>=0.10.33", +] + +[tool.setuptools.packages.find] +include = ["mattergen*"] + +[tool.uv.sources] +torch = { index = "pytorch" } +torchvision = { index = "pytorch" } +torchaudio = { index = "pytorch" } +pyg-lib = { url = "https://data.pyg.org/whl/torch-2.2.0%2Bcu118/pyg_lib-0.4.0%2Bpt22cu118-cp310-cp310-linux_x86_64.whl" } +torch_cluster = { url = "https://data.pyg.org/whl/torch-2.2.0%2Bcu118/torch_cluster-1.6.3%2Bpt22cu118-cp310-cp310-linux_x86_64.whl" } +torch_scatter = { url = "https://data.pyg.org/whl/torch-2.2.0%2Bcu118/torch_scatter-2.1.2%2Bpt22cu118-cp310-cp310-linux_x86_64.whl" } +torch_sparse = { url = "https://data.pyg.org/whl/torch-2.2.0%2Bcu118/torch_sparse-0.6.18%2Bpt22cu118-cp310-cp310-linux_x86_64.whl" } + +[[tool.uv.index]] +name = "pytorch" +url = "https://download.pytorch.org/whl/cu118" +explicit = true diff --git a/data/pyproject_apple_silicon.toml b/data/pyproject_apple_silicon.toml new file mode 100644 index 0000000000000000000000000000000000000000..8f4478562e67b81840549339b462f06aab657bec --- /dev/null +++ b/data/pyproject_apple_silicon.toml @@ -0,0 +1,73 @@ +[tool.black] +line-length = 100 +include = '\.pyi?$' +exclude = ''' +/( + \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist +)/ +''' + +[tool.isort] +profile = "black" +line_length = 100 +known_first_party = [ + "mattergen", +] + +[project] +name = "mattergen" +version = "1.0" +requires-python = ">= 3.10" + +dependencies = [ +"ase>=3.22.1", +"autopep8", +"cachetools", +"contextlib2", +"emmet-core>=0.84.2", # keep up-to-date together with pymatgen, atomate2 +"fire", # see https://github.com/google/python-fire +"hydra-core==1.3.1", +"hydra-joblib-launcher==1.1.5", +"jupyterlab>=4.2.5", +"lmdb", +"matplotlib==3.8.4", +"matscipy>=0.7.0", +"mattersim>=1.1", +"monty==2024.7.30 ", # keep up-to-date together with pymatgen, atomate2 +"notebook>=7.2.2", +"numpy<2.0", # pin numpy before breaking changes in 2.0 +"omegaconf==2.3.0", +"pymatgen>=2024.6.4", +"pylint", +"pytest", +"pytorch-lightning==2.0.6", +"setuptools", +"SMACT", +"sympy>=1.11.1", +"torch==2.4.1", +"torchvision==0.19.1", +"torchaudio==2.4.1", +"torch_cluster", +"torch_geometric>=2.5", +"torch_scatter", +"torch_sparse", +"tqdm", +"wandb>=0.10.33", +] + +[tool.setuptools.packages.find] +include = ["mattergen*"] + +[tool.uv.sources] +pyg-lib = { url = "https://data.pyg.org/whl/torch-2.4.0%2Bcpu/pyg_lib-0.4.0%2Bpt24-cp310-cp310-macosx_14_0_universal2.whl" } +torch_cluster = { url = "https://data.pyg.org/whl/torch-2.4.0%2Bcpu/torch_cluster-1.6.3-cp310-cp310-macosx_10_9_universal2.whl" } +torch_sparse = { url = "https://data.pyg.org/whl/torch-2.4.0%2Bcpu/torch_sparse-0.6.18-cp310-cp310-macosx_11_0_universal2.whl" } +torch_scatter = { url = "https://data.pyg.org/whl/torch-2.4.0%2Bcpu/torch_scatter-2.1.2-cp310-cp310-macosx_10_9_universal2.whl" } \ No newline at end of file diff --git a/data/sampling_conf/csp.yaml b/data/sampling_conf/csp.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b81a15ab0c00ccdcdd774cc0e72b09a3f7ac0061 --- /dev/null +++ b/data/sampling_conf/csp.yaml @@ -0,0 +1,36 @@ +sampler_partial: + _target_: mattergen.diffusion.sampling.classifier_free_guidance.GuidedPredictorCorrector.from_pl_module + N: 1000 + eps_t: ${eval:'1/${.N}'} + + _partial_: true + guidance_scale: 0.0 + remove_conditioning_fn: + _target_: mattergen.property_embeddings.SetUnconditionalEmbeddingType + keep_conditioning_fn: + _target_: mattergen.property_embeddings.SetConditionalEmbeddingType + predictor_partials: + pos: + _target_: mattergen.diffusion.wrapped.wrapped_predictors_correctors.WrappedAncestralSamplingPredictor + _partial_: true + cell: + _target_: mattergen.common.diffusion.predictors_correctors.LatticeAncestralSamplingPredictor + _partial_: true + + corrector_partials: + pos: + _target_: mattergen.diffusion.wrapped.wrapped_predictors_correctors.WrappedLangevinCorrector + _partial_: true + max_step_size: 1e6 + snr: 0.4 + cell: + _target_: mattergen.common.diffusion.predictors_correctors.LatticeLangevinDiffCorrector + _partial_: true + max_step_size: 1e6 + snr: 0.2 + + n_steps_corrector: 1 + +condition_loader_partial: + _partial_: true + _target_: mattergen.common.data.condition_factory.get_composition_data_loader diff --git a/data/sampling_conf/default.yaml b/data/sampling_conf/default.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c19b5bfcfa27cc769c0279fc196331f18cf48efa --- /dev/null +++ b/data/sampling_conf/default.yaml @@ -0,0 +1,40 @@ +sampler_partial: + _target_: mattergen.diffusion.sampling.classifier_free_guidance.GuidedPredictorCorrector.from_pl_module + N: 1000 + eps_t: ${eval:'1/${.N}'} + + _partial_: true + guidance_scale: 0.0 + remove_conditioning_fn: + _target_: mattergen.property_embeddings.SetUnconditionalEmbeddingType + keep_conditioning_fn: + _target_: mattergen.property_embeddings.SetConditionalEmbeddingType + predictor_partials: + pos: + _target_: mattergen.diffusion.wrapped.wrapped_predictors_correctors.WrappedAncestralSamplingPredictor + _partial_: true + cell: + _target_: mattergen.common.diffusion.predictors_correctors.LatticeAncestralSamplingPredictor + _partial_: true + atomic_numbers: + _target_: mattergen.diffusion.d3pm.d3pm_predictors_correctors.D3PMAncestralSamplingPredictor + predict_x0: True + _partial_: true + + corrector_partials: + pos: + _target_: mattergen.diffusion.wrapped.wrapped_predictors_correctors.WrappedLangevinCorrector + _partial_: true + max_step_size: 1e6 + snr: 0.4 + cell: + _target_: mattergen.common.diffusion.predictors_correctors.LatticeLangevinDiffCorrector + _partial_: true + max_step_size: 1e6 + snr: 0.2 + + n_steps_corrector: 1 + +condition_loader_partial: + _partial_: true + _target_: mattergen.common.data.condition_factory.get_number_of_atoms_condition_loader diff --git a/data/scripts/__init__.py b/data/scripts/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/scripts/csv_to_dataset.py b/data/scripts/csv_to_dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..f793c97d201d7c7f50b847f44fb13d83063af805 --- /dev/null +++ b/data/scripts/csv_to_dataset.py @@ -0,0 +1,38 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import argparse +import os + +from mattergen.common.data.dataset import CrystalDataset +from mattergen.common.globals import PROJECT_ROOT + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument( + "--csv-folder", + type=str, + required=True, + help="Path to the folder containing the csv files. All csv files in the folder will be processed (e.g., 'train.csv', 'val.csv', 'test.csv') and the resulting datasets will be placed under {cache_path/dataset_name/filename_without_extension}, e.g, /path/to/project/dataset/mp_20/train.", + ) + parser.add_argument( + "--dataset-name", + type=str, + required=True, + help="Name of the dataset (e.g. mp_20. Will be used to create a folder in the cache folder)", + ) + parser.add_argument( + "--cache-folder", + type=str, + required=True, + default=f"{PROJECT_ROOT}/datasets", + help="Path to the cache folder. Defaults to datasets folder in the project root.", + ) + args = parser.parse_args() + for file in os.listdir(f"{args.csv_folder}"): + if file.endswith(".csv"): + print(f"Processing {args.csv_folder}/{file}") + CrystalDataset.from_csv( + csv_path=f"{args.csv_folder}/{file}", + cache_path=f"{args.cache_folder}/{args.dataset_name}/{file.split('.')[0]}", + ) diff --git a/data/scripts/evaluate.py b/data/scripts/evaluate.py new file mode 100644 index 0000000000000000000000000000000000000000..f0c0e171e69b7d582f77428003f3983b5a742274 --- /dev/null +++ b/data/scripts/evaluate.py @@ -0,0 +1,51 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import json +from pathlib import Path +from typing import Literal + +import fire +import numpy as np + +from mattergen.common.utils.eval_utils import load_structures +from mattergen.common.utils.globals import get_device +from mattergen.evaluation.evaluate import evaluate +from mattergen.evaluation.utils.structure_matcher import ( + DefaultDisorderedStructureMatcher, + DefaultOrderedStructureMatcher, +) + + +def main( + structures_path: str, + relax: bool = True, + energies_path: str | None = None, + structure_matcher: Literal["ordered", "disordered"] = "disordered", + save_as: str | None = None, + potential_load_path: ( + Literal["MatterSim-v1.0.0-1M.pth", "MatterSim-v1.0.0-5M.pth"] | None + ) = None, + device: str = str(get_device()), +): + structures = load_structures(Path(structures_path)) + energies = np.load(energies_path) if energies_path else None + structure_matcher = ( + DefaultDisorderedStructureMatcher() + if structure_matcher == "disordered" + else DefaultOrderedStructureMatcher() + ) + metrics = evaluate( + structures=structures, + relax=relax, + energies=energies, + structure_matcher=structure_matcher, + save_as=save_as, + potential_load_path=potential_load_path, + device=device, + ) + print(json.dumps(metrics, indent=2)) + + +if __name__ == "__main__": + fire.Fire(main) diff --git a/data/scripts/finetune.py b/data/scripts/finetune.py new file mode 100644 index 0000000000000000000000000000000000000000..f428124d260933b2ea87fa8b2c2a05f305a14dc4 --- /dev/null +++ b/data/scripts/finetune.py @@ -0,0 +1,140 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import json +import logging +from collections import OrderedDict +from copy import deepcopy +from pathlib import Path +from typing import Tuple + +import hydra +import omegaconf +import pytorch_lightning as pl +import torch +from omegaconf import DictConfig, OmegaConf, open_dict +from pytorch_lightning.cli import SaveConfigCallback + +from mattergen.common.utils.data_classes import MatterGenCheckpointInfo +from mattergen.common.utils.globals import MODELS_PROJECT_ROOT, get_device +from mattergen.diffusion.run import AddConfigCallback, SimpleParser, maybe_instantiate + +logger = logging.getLogger(__name__) + + +def init_adapter_lightningmodule_from_pretrained( + adapter_cfg: DictConfig, lightning_module_cfg: DictConfig +) -> Tuple[pl.LightningModule, DictConfig]: + assert adapter_cfg.model_path is not None, "model_path must be provided." + + model_path = Path(hydra.utils.to_absolute_path(adapter_cfg.model_path)) + ckpt_info = MatterGenCheckpointInfo(model_path, adapter_cfg.load_epoch) + + ckpt_path = ckpt_info.checkpoint_path + + version_root_path = Path(ckpt_path).relative_to(model_path).parents[1] + config_path = model_path / version_root_path + + # load pretrained model config. + if (config_path / "config.yaml").exists(): + pretrained_cfg_path = config_path + else: + pretrained_cfg_path = config_path.parent.parent + + # global hydra already initialized with @hydra.main + hydra.core.global_hydra.GlobalHydra.instance().clear() + + with hydra.initialize_config_dir(str(pretrained_cfg_path.absolute()), version_base="1.1"): + pretrained_cfg = hydra.compose(config_name="config") + + # compose adapter lightning_module config. + + ## copy denoiser config from pretrained model to adapter config. + diffusion_module_cfg = deepcopy(pretrained_cfg.lightning_module.diffusion_module) + denoiser_cfg = diffusion_module_cfg.model + + with open_dict(adapter_cfg.adapter): + for k, v in denoiser_cfg.items(): + # only legacy denoiser configs should contain property_embeddings_adapt + if k != "_target_" and k != "property_embeddings_adapt": + adapter_cfg.adapter[k] = v + + # do not adapt an existing <property_embeddings> field. + if k == "property_embeddings": + for field in v: + if field in adapter_cfg.adapter.property_embeddings_adapt: + adapter_cfg.adapter.property_embeddings_adapt.remove(field) + + # replace original GemNetT model with GemNetTCtrl model. + adapter_cfg.adapter.gemnet["_target_"] = "mattergen.common.gemnet.gemnet_ctrl.GemNetTCtrl" + + # GemNetTCtrl model has additional input parameter condition_on_adapt, which needs to be set via property_embeddings_adapt. + adapter_cfg.adapter.gemnet.condition_on_adapt = list( + adapter_cfg.adapter.property_embeddings_adapt + ) + + # copy adapter config back into diffusion module config + with open_dict(diffusion_module_cfg): + diffusion_module_cfg.model = adapter_cfg.adapter + with open_dict(lightning_module_cfg): + lightning_module_cfg.diffusion_module = diffusion_module_cfg + + lightning_module = hydra.utils.instantiate(lightning_module_cfg) + + ckpt: dict = torch.load(ckpt_path, map_location=get_device()) + pretrained_dict: OrderedDict = ckpt["state_dict"] + scratch_dict: OrderedDict = lightning_module.state_dict() + scratch_dict.update( + (k, pretrained_dict[k]) for k in scratch_dict.keys() & pretrained_dict.keys() + ) + lightning_module.load_state_dict(scratch_dict, strict=True) + + # freeze pretrained weights if not full finetuning. + if not adapter_cfg.full_finetuning: + for name, param in lightning_module.named_parameters(): + if name in set(pretrained_dict.keys()): + param.requires_grad_(False) + + return lightning_module, lightning_module_cfg + + +@hydra.main( + config_path=str(MODELS_PROJECT_ROOT / "conf"), config_name="finetune", version_base="1.1" +) +def mattergen_finetune(cfg: omegaconf.DictConfig): + # Tensor Core acceleration (leads to ~2x speed-up during training) + torch.set_float32_matmul_precision("high") + trainer: pl.Trainer = maybe_instantiate(cfg.trainer, pl.Trainer) + datamodule: pl.LightningDataModule = maybe_instantiate(cfg.data_module, pl.LightningDataModule) + + # establish an adapter model + pl_module, lightning_module_cfg = init_adapter_lightningmodule_from_pretrained( + cfg.adapter, cfg.lightning_module + ) + + # replace denoiser config with adapter config. + with open_dict(cfg): + cfg.lightning_module = lightning_module_cfg + + config_as_dict = OmegaConf.to_container(cfg, resolve=True) + print(json.dumps(config_as_dict, indent=4)) + # This callback will save a config.yaml file. + trainer.callbacks.append( + SaveConfigCallback( + parser=SimpleParser(), + config=config_as_dict, + overwrite=True, + ) + ) + # This callback will add a copy of the config to each checkpoint. + trainer.callbacks.append(AddConfigCallback(config_as_dict)) + + trainer.fit( + model=pl_module, + datamodule=datamodule, + ckpt_path=None, + ) + + +if __name__ == "__main__": + mattergen_finetune() diff --git a/data/scripts/generate.py b/data/scripts/generate.py new file mode 100644 index 0000000000000000000000000000000000000000..0c42e7b2ffd2108800781d3b0a8c9aa7aa31a23f --- /dev/null +++ b/data/scripts/generate.py @@ -0,0 +1,84 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import os +from pathlib import Path +from typing import Literal + +import fire + +from mattergen.common.data.types import TargetProperty +from mattergen.common.utils.eval_utils import MatterGenCheckpointInfo +from mattergen.generator import CrystalGenerator + + +def main( + output_path: str, + model_path: str, + batch_size: int = 64, + num_batches: int = 1, + config_overrides: list[str] | None = None, + checkpoint_epoch: Literal["best", "last"] | int = "last", + properties_to_condition_on: TargetProperty | None = None, + sampling_config_path: str | None = None, + sampling_config_name: str = "default", + sampling_config_overrides: list[str] | None = None, + record_trajectories: bool = True, + diffusion_guidance_factor: float | None = None, + strict_checkpoint_loading: bool = True, + target_compositions: list[dict[str, int]] | None = None, +): + """ + Evaluate diffusion model against molecular metrics. + + Args: + model_path: Path to DiffusionLightningModule checkpoint directory. + output_path: Path to output directory. + config_overrides: Overrides for the model config, e.g., `model.num_layers=3 model.hidden_dim=128`. + properties_to_condition_on: Property value to draw conditional sampling with respect to. When this value is an empty dictionary (default), unconditional samples are drawn. + sampling_config_path: Path to the sampling config file. (default: None, in which case we use `DEFAULT_SAMPLING_CONFIG_PATH` from explorers.common.utils.utils.py) + sampling_config_name: Name of the sampling config (corresponds to `{sampling_config_path}/{sampling_config_name}.yaml` on disk). (default: default) + sampling_config_overrides: Overrides for the sampling config, e.g., `condition_loader_partial.batch_size=32`. + load_epoch: Epoch to load from the checkpoint. If None, the best epoch is loaded. (default: None) + record: Whether to record the trajectories of the generated structures. (default: True) + strict_checkpoint_loading: Whether to raise an exception when not all parameters from the checkpoint can be matched to the model. + target_compositions: List of dictionaries with target compositions to condition on. Each dictionary should have the form `{element: number_of_atoms}`. If None, the target compositions are not conditioned on. + Only supported for models trained for crystal structure prediction (CSP) (default: None) + + NOTE: When specifying dictionary values via the CLI, make sure there is no whitespace between the key and value, e.g., `--properties_to_condition_on={key1:value1}`. + """ + if not os.path.exists(output_path): + os.makedirs(output_path) + + sampling_config_overrides = sampling_config_overrides or [] + config_overrides = config_overrides or [] + properties_to_condition_on = properties_to_condition_on or {} + target_compositions = target_compositions or [] + + checkpoint_info = MatterGenCheckpointInfo( + model_path=Path(model_path).resolve(), + load_epoch=checkpoint_epoch, + config_overrides=config_overrides, + strict_checkpoint_loading=strict_checkpoint_loading, + ) + _sampling_config_path = Path(sampling_config_path) if sampling_config_path is not None else None + generator = CrystalGenerator( + checkpoint_info=checkpoint_info, + properties_to_condition_on=properties_to_condition_on, + batch_size=batch_size, + num_batches=num_batches, + sampling_config_name=sampling_config_name, + sampling_config_path=_sampling_config_path, + sampling_config_overrides=sampling_config_overrides, + record_trajectories=record_trajectories, + diffusion_guidance_factor=( + diffusion_guidance_factor if diffusion_guidance_factor is not None else 0.0 + ), + target_compositions_dict=target_compositions, + ) + generator.generate(output_dir=Path(output_path)) + + +if __name__ == "__main__": + # use fire instead of argparse to allow for the specification of dictionary values via the CLI + fire.Fire(main) diff --git a/data/scripts/run.py b/data/scripts/run.py new file mode 100644 index 0000000000000000000000000000000000000000..882b9b350bc4d50d7552fe93a6793bdc7a613908 --- /dev/null +++ b/data/scripts/run.py @@ -0,0 +1,36 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +import json +import logging + +import hydra +import omegaconf +import torch +from omegaconf import OmegaConf + +from mattergen.common.utils.globals import MODELS_PROJECT_ROOT +from mattergen.diffusion.config import Config +from mattergen.diffusion.run import main + +logger = logging.getLogger(__name__) + + +@hydra.main( + config_path=str(MODELS_PROJECT_ROOT / "conf"), config_name="default", version_base="1.1" +) +def mattergen_main(cfg: omegaconf.DictConfig): + # Tensor Core acceleration (leads to ~2x speed-up during training) + torch.set_float32_matmul_precision("high") + # Make merged config options + # CLI options take priority over YAML file options + schema = OmegaConf.structured(Config) + config = OmegaConf.merge(schema, cfg) + OmegaConf.set_readonly(config, True) # should not be written to + print(OmegaConf.to_yaml(cfg, resolve=True)) + + main(config) + + +if __name__ == "__main__": + mattergen_main()