|
47 | 47 | "source": [ |
48 | 48 | "# import locale\n", |
49 | 49 | "# locale.getpreferredencoding = lambda: \"UTF-8\"\n", |
50 | | - "# !python3 -m pip install janus-core[all] data-tutorials" |
| 50 | + "\n", |
| 51 | + "# ! pip uninstall torch torchaudio torchvision numpy -y\n", |
| 52 | + "# ! uv pip install janus-core[all] data-tutorials torch==2.5.1 --system\n", |
| 53 | + "# get_ipython().kernel.do_shutdown(restart=True)" |
51 | 54 | ] |
52 | 55 | }, |
53 | 56 | { |
|
214 | 217 | "metadata": {}, |
215 | 218 | "outputs": [], |
216 | 219 | "source": [ |
217 | | - "print(f\"Energy: {results.info[\"mace_mp_energy\"]}\")\n", |
| 220 | + "print(f\"Energy: {results.info['mace_mp_energy']}\")\n", |
218 | 221 | "print()\n", |
219 | | - "print(f\"Stress: {results.info[\"mace_mp_stress\"]}\")\n", |
| 222 | + "print(f\"Stress: {results.info['mace_mp_stress']}\")\n", |
220 | 223 | "print()\n", |
221 | | - "print(f\"Forces: {results.arrays[\"mace_mp_forces\"]}\")" |
| 224 | + "print(f\"Forces: {results.arrays['mace_mp_forces']}\")" |
222 | 225 | ] |
223 | 226 | }, |
224 | 227 | { |
|
284 | 287 | "tracker: False" |
285 | 288 | ] |
286 | 289 | }, |
| 290 | + { |
| 291 | + "cell_type": "code", |
| 292 | + "execution_count": null, |
| 293 | + "metadata": {}, |
| 294 | + "outputs": [], |
| 295 | + "source": [ |
| 296 | + "! cat singlepoint_config_1.yml" |
| 297 | + ] |
| 298 | + }, |
287 | 299 | { |
288 | 300 | "cell_type": "markdown", |
289 | 301 | "metadata": {}, |
|
341 | 353 | "metadata": {}, |
342 | 354 | "source": [ |
343 | 355 | "<div class=\"alert alert-block alert-info\">\n", |
344 | | - "<b>Note:</b> In the CLI, arguments are separated by \"-\", while in configuration files, they are specified by \"_\"\n", |
| 356 | + "<b>Note:</b> In the CLI, multi-word arguments must be separated by \"-\".\n", |
| 357 | + "In configuration files, they are preferably separated by \"_\", although \"-\" should be converted automatically.\n", |
345 | 358 | "</div>" |
346 | 359 | ] |
347 | 360 | }, |
|
619 | 632 | "metadata": {}, |
620 | 633 | "outputs": [], |
621 | 634 | "source": [ |
622 | | - "! janus singlepoint --config singlepoint_config_1.yml --calc-kwargs \"{'dispersion': True}\"" |
| 635 | + "! janus singlepoint --config singlepoint_config_1.yml --calc-kwargs \"{'dispersion': True}\" --out janus_results/NaCl-dispersion-results.extxyz" |
623 | 636 | ] |
624 | 637 | }, |
625 | 638 | { |
|
640 | 653 | "struct: data/NaCl.xyz\n", |
641 | 654 | "tracker: False\n", |
642 | 655 | "calc_kwargs:\n", |
643 | | - " dispersion: True" |
| 656 | + " dispersion: True\n", |
| 657 | + "out: janus_results/NaCl-dispersion-results.extxyz" |
| 658 | + ] |
| 659 | + }, |
| 660 | + { |
| 661 | + "cell_type": "code", |
| 662 | + "execution_count": null, |
| 663 | + "metadata": {}, |
| 664 | + "outputs": [], |
| 665 | + "source": [ |
| 666 | + "! janus singlepoint --config singlepoint_config_4.yml" |
| 667 | + ] |
| 668 | + }, |
| 669 | + { |
| 670 | + "cell_type": "markdown", |
| 671 | + "metadata": {}, |
| 672 | + "source": [ |
| 673 | + "Comparing the results before and after the correction:" |
644 | 674 | ] |
645 | 675 | }, |
646 | 676 | { |
|
649 | 679 | "metadata": {}, |
650 | 680 | "outputs": [], |
651 | 681 | "source": [ |
652 | | - "! janus singlepoint --config singlepoint_config_4.yml --calc-kwargs \"{'dispersion': True}\"" |
| 682 | + "dispersion_results = read(\"janus_results/NaCl-dispersion-results.extxyz\")\n", |
| 683 | + "\n", |
| 684 | + "print(f\"Original results: {results.info['mace_mp_energy']}\")\n", |
| 685 | + "print(f\"Results with dispersion correction: {dispersion_results.info['mace_mp_energy']}\")" |
653 | 686 | ] |
654 | 687 | } |
655 | 688 | ], |
|
0 commit comments