From 3b23d5dc02d453650183cb220a5c966d3ad44670 Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" Date: Fri, 11 Oct 2024 10:27:10 +0100 Subject: [PATCH 1/4] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 4a98092a65053f1cc7f6d19ca155d87e454a7a68 Merge: fd2283d28 561b6fa6e Author: Yuji Ikeda Date: Fri Oct 11 06:13:07 2024 +0000 Merge branch 'appveyor-python39' into 'master' Bump to python3.9 in appveyor.yml See merge request ase/ase!3484 commit 561b6fa6e69b665e591f56349922c9772feeadb3 Author: yuzie007 Date: Fri Oct 11 07:57:57 2024 +0200 Bump to python3.9 in appveyor.yml commit fd2283d28c90c52e09f0ed1e0da2d2418393e418 Merge: 46bfbe015 5791d21d1 Author: Ask Hjorth Larsen Date: Fri Oct 4 10:21:46 2024 +0000 Merge branch 'remove-common-implemented_properties-requirement-in-mixer' into 'master' Remove requirement of common implemented_properties in Mixer See merge request ase/ase!3480 commit 5791d21d1f864d5f2778e9380aee74deedf38c21 Author: Axel Forslund Date: Fri Oct 4 11:27:10 2024 +0200 Revert to formatting with line length 80 commit 2e7e3381951ec8bf418e9100f609e2627afa44f4 Author: Axel Forslund Date: Fri Oct 4 09:53:25 2024 +0200 Remove also unused import commit a70a99546d923725ebf2942d2b658056a2d9efd6 Author: Axel Forslund Date: Fri Oct 4 07:36:19 2024 +0000 Remove requirement in `Mixer.__init__()` in mixing.py that `implemented_properties` cannot be empty, to enable e.g. to "mix" `SinglePointCalculator`s. commit 46bfbe015d9837e1e704f268c5f032796f5535b3 Merge: a893fd9fa ae930ad17 Author: Ask Hjorth Larsen Date: Sat Sep 28 15:19:16 2024 +0000 Merge branch 'require-python-3.9' into 'master' Bump python requirements to python3.9 See merge request ase/ase!3473 commit a893fd9fa09d5cb0ec76b25254b3ec82c42c0ce4 Merge: 84b88193a e8da1b31f Author: Ask Hjorth Larsen Date: Sat Sep 28 15:04:37 2024 +0000 Merge branch 'faster-supercell' into 'master' Faster supercell implementation, tests Closes #1543 See merge request ase/ase!3474 commit ae930ad178e541d4400010a3b1625024b6c9d96c Merge: 77ca1a355 84b88193a Author: Ask Hjorth Larsen Date: Fri Sep 27 13:35:07 2024 +0200 Merge branch 'master' into require-python-3.9 commit 84b88193a7414cc67929c1c8ceb6619670363693 Merge: f7001e1b9 b4a1738bc Author: Ask Hjorth Larsen Date: Fri Sep 27 11:33:25 2024 +0000 Merge branch 'psycopg2-numpy-2-fix' into 'master' Convert np.float64 to float before writing to Postgres database See merge request ase/ase!3475 commit b4a1738bc5569ccc832bb6210ffe1bac1829ba29 Author: Jens Jørgen Mortensen Date: Fri Sep 27 12:58:02 2024 +0200 Convert np.float64 to float before writing to Postgres database commit e8da1b31f341bde96687ea76b0158010f8c135b2 Author: Ask Hjorth Larsen Date: Fri Sep 27 12:25:08 2024 +0200 loop from -1 to 1 instead of from -2 to 2; all tests still pass commit b62c69d80d2a7a31a56a074ca2c09a3d35d50113 Author: Ask Hjorth Larsen Date: Fri Sep 27 12:23:57 2024 +0200 write supercell tests as a single parametrized test commit 1ca7cd0c1d7aabc4844a05488e0029f8b7187935 Author: Ask Hjorth Larsen Date: Fri Sep 27 12:23:33 2024 +0200 clean up and improve naming. Avoid having more than one "big" array allocated. commit 5f56ee2c276be6500693fd7b513f818685082585 Author: Ask Hjorth Larsen Date: Thu Sep 26 23:38:40 2024 +0200 vectorize also the determinant call a factor 3; we now have 80% time reduction commit 16ec2bc9febd7ef74b0fb2fe70d57176f584f118 Author: Ask Hjorth Larsen Date: Thu Sep 26 23:32:46 2024 +0200 vectorize some of the loop operations to cut another 15% or so from runtime commit b67ddbbe284346e5062f53ba42fc15f7abfb9c62 Author: Ask Hjorth Larsen Date: Thu Sep 26 23:23:49 2024 +0200 eliminate unnecessary conversion to cut 30% off supercell runtime commit 77ca1a3556486b681c7a032b737dd91eb884de36 Author: Ask Hjorth Larsen Date: Thu Sep 26 19:27:55 2024 +0200 try another, newer python in hope that psycopg2 trouble goes away commit 8c12bff1a56ce9a6cd4039db20bbec7a630a757e Author: Ask Hjorth Larsen Date: Thu Sep 26 19:24:57 2024 +0200 remove ancient python2 warning commit ce99420b7198ac610fbcb55e55a6b96233e3b690 Author: Ask Hjorth Larsen Date: Thu Sep 26 18:44:47 2024 +0200 move more commands to pre_script commit 66c85f2e0dda2ea354025b26c0a75f5b633c6910 Author: Ask Hjorth Larsen Date: Thu Sep 26 18:22:26 2024 +0200 try to weed out all mentions of 3.8 and update them commit d3a25e0a129a29e9f1381b659e6a3df12d3a68ee Author: Ask Hjorth Larsen Date: Thu Sep 26 18:20:18 2024 +0200 arbitrarily bump version numbers in ci a bit to get rid of 3.8 commit a504beb97d079f202a002a4aa40db12f950392f2 Author: Ask Hjorth Larsen Date: Thu Sep 26 18:17:18 2024 +0200 bump required numpy to 1.19.5, which unlike 1.18.5 has wheels for python3.9. commit e203b295c015f649d5393f448cd5f9ca407103d9 Author: Ask Hjorth Larsen Date: Thu Sep 26 18:06:21 2024 +0200 bump python requirements to python3.9 commit f7001e1b9bb8a5b6cd1377490d3826fb50e41ade Merge: 2f871c61f 63d62f268 Author: Ask Hjorth Larsen Date: Tue Sep 17 11:54:06 2024 +0000 Merge branch 'bandstructure_color' into 'master' Merge BandstructurePlot.plot_with_colors() into BandstructurePlot.plot() See merge request ase/ase!3463 commit 2f871c61f944637f109d5cc393e51ed89d790109 Merge: c0777d1ee e9209264d Author: Ask Hjorth Larsen Date: Tue Sep 17 11:52:19 2024 +0000 Merge branch 'new-url-for-gpaw' into 'master' GPAW web-page moved to ReadTheDocs See merge request ase/ase!3468 commit e9209264dd5e62bb4f58eb4d29e546ae93ca2df5 Merge: 340222981 c0777d1ee Author: Jens Jørgen Mortensen Date: Tue Sep 17 09:34:12 2024 +0200 Merge branch 'master' into new-url-for-gpaw commit c0777d1ee1927423774d7c7e4fd7f5bf15d7b4e1 Merge: 3c8e1feae f98adb64b Author: Yuji Ikeda Date: Tue Sep 17 03:37:32 2024 +0000 Merge branch 'fix-lint-espresso' into 'master' Fix `lint` pipeline error See merge request ase/ase!3469 commit f98adb64b0a7200e9175459466bbb653a8c1929c Author: yuzie007 Date: Tue Sep 17 05:22:36 2024 +0200 Fix `lint` pipeline error in !3464 commit 340222981e44b13d7cf54107a17d15f235ea01b5 Author: Jens Jørgen Mortensen Date: Mon Sep 16 12:12:30 2024 +0200 Fix some more broken links commit 00dee295fe8172116db41f3fbc23d6a9af52e971 Author: Jens Jørgen Mortensen Date: Mon Sep 16 11:49:06 2024 +0200 Fix/remove broken links commit 17d9103cf6766c4843cdc4cbfadaf36e1a064acd Author: Jens Jørgen Mortensen Date: Mon Sep 16 11:26:36 2024 +0200 GPAW web-page moved to ReadTheDocs commit 3c8e1feaea79032e19791b11be449a584b54d787 Merge: 01012d742 894c1d52a Author: Ask Hjorth Larsen Date: Mon Sep 16 08:18:42 2024 +0000 Merge branch 'master-simune' into 'master' Fixes for SIESTA 5.0 and QE Closes #14, #13, #12, #11, #10, #9, and gpaw/gpaw#1042 See merge request ase/ase!3464 commit 01012d742d34dd4611394bc68aa71c1f8aa06c7e Merge: b974e1826 aecbbe78d Author: Ask Hjorth Larsen Date: Fri Sep 13 00:18:23 2024 +0000 Merge branch 'add-octopus-io-tests' into 'master' MAINT: Add tests for the Octopus output format (`static/info`) See merge request ase/ase!3465 commit aecbbe78df16cfd71ef27cb3166f583987875dc0 Author: yuzie007 Date: Thu Sep 12 20:46:02 2024 +0200 Remove fallback `ibz_kpoints` / `kpoint_weights` commit f521ac71c91e2415d4f7b0f0e2530429672c8b81 Author: yuzie007 Date: Thu Sep 12 20:45:31 2024 +0200 Remove `try ... except ...` for magnetic moments commit b86bdaa60b872b0a7605dd846bd27fc14a5b679e Author: yuzie007 Date: Thu Sep 12 20:41:37 2024 +0200 Make fixture for common file commit 63d62f268c3bb4d0d1d6fce75c2fa6e4feec44ff Author: Jakob Schiotz Date: Thu Sep 12 16:19:55 2024 +0200 Argument missing in docstring. Make sort order more flexible. commit b974e1826d461ab5ebf50f627cc49c31912fd1ff Merge: e3f5f1c61 1e8eb64ab Author: Ask Hjorth Larsen Date: Thu Sep 12 13:55:40 2024 +0000 Merge branch 'fix-1467-last' into 'master' Remove remaining `if 0:` and `if False:` hack Closes #1467 See merge request ase/ase!3466 commit 1e8eb64ab84907ac4a4c8596e0bd346969544897 Author: yuzie007 Date: Wed Sep 11 02:04:30 2024 +0200 Remove some `if 0:` commit 3d5084228e27a00776cb0351b653224ef7aa5d3b Author: Jakob Schiotz Date: Thu Sep 12 14:12:05 2024 +0200 Add a colorbar axis argument for better control of plots commit 5ac7dc528a763ba7b34e1d03b4d62ea16e2bdc16 Author: yuzie007 Date: Thu Sep 12 13:30:33 2024 +0200 Add Octopus IO tests for eigenvalues commit 1dfa237bf51dcca7ce3dd222e5f0b0eef9ff21e5 Author: yuzie007 Date: Thu Sep 12 12:49:10 2024 +0200 Add Octopus IO tests for kpoints commit a2fbf3ca2d7e33aa3e0fb4814ffe35bf5362994d Author: Jakob Schiotz Date: Thu Sep 12 13:11:10 2024 +0200 Simplify label handling as suggested by @askhl commit 572d9746872a12871d8fe3ce508805f1df5de683 Author: Jakob Schiotz Date: Thu Sep 12 13:02:46 2024 +0200 Make colors and point_colors two separate arguments. commit 9f6df71a06725556011bfa1c3fb86d8f94fd6100 Author: yuzie007 Date: Thu Sep 12 12:28:25 2024 +0200 Add Octopus IO tests for stress tensors commit b47075179ece2302d662ef6e4123d36e03c291e9 Author: yuzie007 Date: Thu Sep 12 12:11:39 2024 +0200 Remove unused test for mixed periodicity commit a6b5ddcf9e0740e0f73781aaee6d116745912b33 Author: yuzie007 Date: Thu Sep 12 12:04:22 2024 +0200 Add Octopus IO tests for Fermi levels commit 07ab7bb37caa2bc379c2ae87d6aa4ba8af424102 Author: yuzie007 Date: Thu Sep 12 10:43:28 2024 +0200 Add Octopus IO tests for magnetic moments commit 0e24c89ebc382bcef26d775a5aaeff8effd6a8a4 Author: yuzie007 Date: Thu Sep 12 10:18:52 2024 +0200 Add Octopus IO tests for dipole moments commit f67cfa1f66e1dddacca56300ee9d63c0060bda23 Author: Jakob Schiotz Date: Thu Sep 12 11:23:01 2024 +0200 Merge BandStructurePlot.plot_with_colors() into BandStructurePlot.plot(). commit 18138167d7e9c0b0c3edf3e270cdefdb011a9640 Author: Jakob Schiotz Date: Thu Sep 12 10:35:02 2024 +0200 Clean up legend-handling in BandstructurePlot.plot(). Update docstring. commit 2d9e03320437fe1ade80794b9ef496045885df1c Author: yuzie007 Date: Thu Sep 12 08:40:45 2024 +0200 Move `test_octopus.py` to `octopus/test_input.py` commit e3f5f1c6194d2b7eeed9381c0aa0348488ddcb69 Merge: b9dd48876 a9443fd99 Author: Ask Hjorth Larsen Date: Wed Sep 11 14:30:51 2024 +0000 Merge branch 'remove-subprocess-print' into 'master' ENH: Remove stray print statement in subprocess calculator See merge request ase/ase!3462 commit a112a14a726883c997e07d18d98bd185b18a48c3 Author: Jakob Schiotz Date: Wed Sep 11 15:34:47 2024 +0200 Fix BandStructurePlot.plot_with_colors() so it actually work. commit a9443fd99f3894409fe9178cb1fdebfe4a78692c Author: Luuk Kempen Date: Wed Sep 11 15:24:43 2024 +0200 Remove args print statement in subprocess calculator's client commit b9dd48876cc4917a1e1355759ddbac8b5966b15d Merge: 94aa63265 d63bf6093 Author: Ask Hjorth Larsen Date: Wed Sep 11 12:34:36 2024 +0000 Merge branch 'phonon_verbose' into 'master' Add verbose argument to Phonons.get_dos() See merge request ase/ase!3461 commit 281ee607d06d126d5e4b50b7740773c7f0df62b2 Author: yuzie007 Date: Tue Sep 10 23:11:53 2024 +0200 Remove `if False:` commit d63bf6093dc574cd1390bba8f06d52845e4cf289 Author: Jakob Schiotz Date: Tue Sep 10 15:46:03 2024 +0200 Fix overly long line. commit 7bed51e91ac49f09b00e2d75cb386a5fb1b695ad Author: Jakob Schiotz Date: Tue Sep 10 14:48:12 2024 +0200 Add verbose argument to Phonons.get_dos() commit 94aa632656d28e3fa868d32273491989c61d66f1 Merge: a396f37f5 8a060f67c Author: Ask Hjorth Larsen Date: Mon Sep 9 15:09:42 2024 +0000 Merge branch 'gui-fix-nonblack-lines' into 'master' GUI: Explicitly make lines black Closes #1536 See merge request ase/ase!3459 commit a396f37f5a4d024a82a569cb908c86bd42c50979 Merge: 133082e25 085bd9a64 Author: Ask Hjorth Larsen Date: Mon Sep 9 15:06:33 2024 +0000 Merge branch 'partialdos2' into 'master' Atom-projected partial density of states for phonons Closes #1518 See merge request ase/ase!3460 commit 085bd9a643c0197d8dd27c85c97a2d393112652c Author: Jakob Schiotz Date: Fri Sep 6 13:46:31 2024 +0200 Fix bug in test suite (with Asap installed) due to deprecation of Phonons.dos() commit 7b4053bca3ec75bd377a0a73060cd41e6e0d812d Author: Jakob Schiotz Date: Fri Sep 6 13:14:22 2024 +0200 Deprecate Phonons.dos() in favor of Phonons.get_dos(). commit fe0fe1a82ec738eed4884b7fa8040084dafcf2d9 Author: Jakob Schiotz Date: Fri Sep 6 13:06:00 2024 +0200 Add test for partial phonon DOS. commit 0d8a10183d0d9f91e54846473d70ac65015df441 Author: Jakob Schiotz Date: Fri Aug 9 15:15:08 2024 +0200 Draft: Partial phonon DOS. commit 8a060f67c21c09ff0cdf730a492085cb18322818 Author: Ask Hjorth Larsen Date: Wed Sep 4 23:18:59 2024 +0200 set fill color to ensure lines are black commit 133082e25bf7e300b980c8ec9a0ccc17548f0c9e Merge: c47208c6f 59fa5d117 Author: Ask Hjorth Larsen Date: Tue Sep 3 18:08:00 2024 +0000 Merge branch 'spglib-fix-warnings' into 'master' spglib 2.5.0 compatibility See merge request ase/ase!3452 commit c47208c6f4e8e221deac110dac1bd1acda87a0bb Merge: c87cbc5d5 68fffd38f Author: Ask Hjorth Larsen Date: Mon Sep 2 23:09:49 2024 +0000 Merge branch 'fix-1286' into 'master' Add docstring for `velocities` in `Atoms.__init__` Closes #1286 See merge request ase/ase!3458 commit c87cbc5d53e6a21c1d48d404a73b5e4e31db294a Merge: b708f6ea7 5936e2cda Author: Ask Hjorth Larsen Date: Mon Sep 2 22:59:01 2024 +0000 Merge branch 'remove-get-spacegroup' into 'master' Remove `get_spacegroup` due to its misleading outputs and in favor of `check_symmetry` or direct call on `spglib` Closes #1534 See merge request ase/ase!3455 commit 68fffd38ffae17835fd3acb03be29515c7ba9278 Author: yuzie007 Date: Tue Sep 3 00:24:27 2024 +0200 Refactor `Atoms.__init__` without triple if blocks commit 4b15586af5b4804c73ee9a577fc355e7d69df4ac Author: yuzie007 Date: Tue Sep 3 00:22:42 2024 +0200 Fix error message commit 5109b8143d5e9efa9ea914656204610a8662dfb0 Author: yuzie007 Date: Tue Sep 3 00:27:38 2024 +0200 Add documentation for `velocities` commit a3668459c5ab26c08eb671843552d468f9b82f9d Author: yuzie007 Date: Mon Sep 2 23:36:55 2024 +0200 Numpydoc-fy `Atoms` commit b708f6ea727af66882671d6a73f62d5c6908da1b Merge: 288c7e327 f82abce10 Author: Ask Hjorth Larsen Date: Mon Sep 2 21:34:04 2024 +0000 Merge branch 'fix-1467-first' into 'master' Remove some `if 0:`, `if 1:`, `if False:` hack See merge request ase/ase!3457 commit f82abce109311a63f8aa8a74286947d405df997a Author: yuzie007 Date: Mon Sep 2 20:41:31 2024 +0200 Remove `if 0:` for `view` in tests commit 6fef146bd101e61be042cedf8e555dacd6bb5553 Author: yuzie007 Date: Mon Sep 2 20:24:31 2024 +0200 Remove some `if False:` These were to help `mypy` for `matplotlib`, which was before optional. Since `matplotlib` is mandatory now, this hack is not necessary anymore. commit 9d77cc9a8f9c0c9fac36e9d2dbe7bdc75879218e Author: yuzie007 Date: Mon Sep 2 20:13:06 2024 +0200 Remove `if 1:` from `view.py` commit 0259703a4260e16b5f6eb9cb7cc2133ec2fbeb0e Author: yuzie007 Date: Mon Sep 2 20:07:08 2024 +0200 Remove `if 0:` and `if 1:` from `logo.py` commit 5936e2cdaeede7822f53517bf6377f9555251762 Author: yuzie007 Date: Sun Sep 1 12:45:51 2024 +0200 Remove `get_spacegroup` commit 288c7e3274acb4028786def26c25754b0f2835b1 Merge: eef750406 8e2b89b4a Author: Ask Hjorth Larsen Date: Mon Sep 2 14:34:38 2024 +0000 Merge branch 'fix-md-rng' into 'master' BUGFIX: Make `Andersen` work with both the legacy and the modern NumPy PRNGs Closes #1533 See merge request ase/ase!3454 commit eef7504066a6fed2736f416e99126820481a86d0 Merge: 6baf477fc 73bc79081 Author: Ask Hjorth Larsen Date: Mon Sep 2 14:32:25 2024 +0000 Merge branch 'sockets-return' into 'master' Fix FileIOSocketClientLauncher missing return value if no profile Closes #1532 See merge request ase/ase!3453 commit 8e2b89b4a7b09d10b8ce89086c226abecec4d57f Author: yuzie007 Date: Sat Aug 31 23:00:08 2024 +0200 Fix for modern NumPy commit 65fc590a979e630411559e0dd3131d77731fad8f Author: yuzie007 Date: Sat Aug 31 23:42:09 2024 +0200 Add test for legacy and modern NumPy PRNGs commit 6baf477fc3d461fe33a8998cad71e64dce1623e0 Merge: 6a9b53a66 ebf82a008 Author: Yuji Ikeda Date: Sat Aug 31 10:23:17 2024 +0000 Merge branch 'accelerate-equivalent-sites' into 'master' Accelerate `Spacegroup.equivalent_sites` See merge request ase/ase!3448 commit ebf82a008bb1bbeca03ffbf1b49d41c8ecde998e Author: yuzie007 Date: Tue Aug 6 18:29:46 2024 +0200 Accelerate `equivalent_sites` commit 73bc790813c3645077380ecb57087148fe663441 Author: Adam J. Jackson Date: Fri Aug 30 09:31:50 2024 +0100 Fix FileIOSocketClientLauncher missing return value if no profile Fixes issue #1532 commit 59fa5d1179869a84bc1eaed7759118cb790c4332 Author: Ask Hjorth Larsen Date: Wed Aug 28 19:58:34 2024 +0200 remove the wrapper class after all and adapt surrounding code. Implement MutableMapping to be maximally compatible with dicts commit 26b65430ae667ce719f89b390bbd979c90cf4100 Author: Ask Hjorth Larsen Date: Wed Aug 28 18:36:03 2024 +0200 lint commit cf45863296320720c4fc3dfbb7a5c9d5dd549195 Author: Ask Hjorth Larsen Date: Wed Aug 28 18:07:01 2024 +0200 update another spglib call commit 0f8a6f9d81782ce6c2d2cde89a9fb4240f1b8c94 Author: Ask Hjorth Larsen Date: Wed Aug 28 17:48:20 2024 +0200 more spglib wrapping commit 65b6cdc19d3a8ddc82aca2026de3b31f6a7b09b1 Author: Ask Hjorth Larsen Date: Wed Aug 28 17:39:55 2024 +0200 update another spglib call commit 5a9ac9f76af7d8bce36f2715398501a90b738dc9 Author: Ask Hjorth Larsen Date: Wed Aug 28 17:38:09 2024 +0200 write spglib-like module which always return modern spglib dataset or a wrapper that provides attribute-based access. commit d8c5630c0c67145b6671e71d8ff552799f5dc804 Author: Ask Hjorth Larsen Date: Wed Aug 28 17:13:11 2024 +0200 update to new spglib interface commit 6a9b53a666bc4deca421b7720f311b6eabf5d41f Merge: 6131f870d e15b889a4 Author: Ask Hjorth Larsen Date: Wed Aug 28 12:28:36 2024 +0000 Merge branch 'typo-in-bandgap-description' into 'master' Fix typo in description of bandgap See merge request ase/ase!3451 commit e15b889a42d1383557fef780ac3a8cd162cd30d4 Author: Jens Jørgen Mortensen Date: Wed Aug 28 08:59:12 2024 +0200 Fix typo in description of bandgap commit 894c1d52a0b7f0b4d226cac5952dd554e7fd1981 Merge: a4f3f3c49 45ff260c5 Author: Yavar T. Azar Date: Fri Aug 23 18:17:52 2024 +0000 Merge branch '14-avoid-using-path-variable-in-quantum-espresso-calculator-for-remote-calculations' into 'master-simune' Resolve "Avoid using Path variable in Quantum Espresso calculator for remote calculations " Closes #14 See merge request simune-oss/forks/ase!22 commit 45ff260c5525a6d2822307766ffbd907f0169124 Author: Irina Lebedeva Date: Fri Aug 23 18:24:37 2024 +0200 Comment commit 1b9ac9082a2f05890aa7468c77d6717f262efa5a Author: Irina Lebedeva Date: Fri Aug 23 17:23:59 2024 +0200 Remove Path commit 06bffd181bf6b37923476d18201ba5644cd20204 Author: Irina Lebedeva Date: Fri Aug 23 17:10:53 2024 +0200 Changes commit 6131f870d8033a61dc647dfc7239f5a55f806a8a Merge: 9c8b4dab0 8642080f2 Author: Ask Hjorth Larsen Date: Wed Aug 21 16:59:49 2024 +0000 Merge branch 'fix-1520' into 'master' Fix `VaspChargeDensity` so that it can run again Closes #1520 See merge request ase/ase!3447 commit 8642080f22beca9425bdabd94cf1a91b81f29de5 Author: yuzie007 Date: Sun Aug 18 11:52:53 2024 +0200 Add test for `VaspChargeDensity` commit 9c8b4dab08d44a91df97ff5629658a54c07df49a Merge: 3bf76b897 f32861093 Author: Ask Hjorth Larsen Date: Wed Aug 21 07:44:45 2024 +0000 Merge branch 'fix-supercell-shape' into 'master' Fix `supercells.py::find_optimal_cell_shape` to return expected supercell matrices Closes #1522 See merge request ase/ase!3441 commit fe533de5ee1a229d55ab6c2caa39a1225e4d8f85 Author: yuzie007 Date: Sun Aug 18 11:17:00 2024 +0200 Modify catched errors commit 3bf76b8979311ae178f67db9ea95a4d296da886f Merge: fe53425c4 4325af014 Author: Yuji Ikeda Date: Sun Aug 18 08:39:56 2024 +0000 Merge branch 'address-1523' into 'master' Fix example in docstring See merge request ase/ase!3446 commit 4325af01452e60051b869fee80dbec48764124f7 Author: yuzie007 Date: Sun Aug 18 10:27:09 2024 +0200 Fix example in docstring commit fe53425c4377e3cbe32e6fe8b41a254ed9cd9969 Merge: e31b54e99 183eb06a0 Author: Yuji Ikeda Date: Sun Aug 18 07:59:57 2024 +0000 Merge branch 'fix-1524' into 'master' BUGFIX: Initialize `constraints` in `read_castep_castep` Closes #1524 See merge request ase/ase!3445 commit 183eb06a0389bf05d2cc799cd85005b68ed5da67 Author: yuzie007 Date: Sun Aug 18 09:18:11 2024 +0200 Initialize `constraints` commit f32861093334ea374021e8a7f14a94f7a4619776 Author: yuzie007 Date: Thu Aug 8 13:02:01 2024 +0200 Deprecate `norm` commit e31b54e99c2b9a17b8c2dcaad2f8c4689cafc8c9 Merge: a1b7784f3 b917dc30e Author: Ask Hjorth Larsen Date: Sat Aug 10 12:59:11 2024 +0000 Merge branch 'amber-separate-io' into 'master' Move amber io code to ase.io.amber See merge request ase/ase!3443 commit b917dc30e547cd9a0da093bd127baae7bd2b4836 Author: Ask Hjorth Larsen Date: Fri Aug 9 16:05:05 2024 +0200 flake commit 15a6fb60c6473a01299d1617b16c71732b87f0cc Author: Ask Hjorth Larsen Date: Fri Aug 9 15:48:44 2024 +0200 test both with and without velocities commit 55d08916dc2274a07e23ce273e8c795679561c5d Author: Ask Hjorth Larsen Date: Fri Aug 9 15:40:51 2024 +0200 attempt to remove unnecessary fluff (hopefully not breaking netcdf variable usage) commit 996c31c80e0469d60749e54fe6941c241f02e820 Author: Ask Hjorth Larsen Date: Fri Aug 9 15:19:35 2024 +0200 atoms.get_velocities() always returns at least an array of zeros, so checking versus None is unneccessary commit 2de8231f6e774af43bf134f10c4a498d384e532e Author: Ask Hjorth Larsen Date: Fri Aug 9 14:29:17 2024 +0200 fix import path commit 6313510df80ce1061394fea4b4801eb4ad8c823c Author: Ask Hjorth Larsen Date: Fri Aug 9 14:14:09 2024 +0200 lint commit 17521706fb06d92db4db7626babb1e43082d6806 Author: Ask Hjorth Larsen Date: Fri Aug 9 14:10:44 2024 +0200 minor cleanup commit afd658237a785c6f4dd167a7b6dc8db1cce7ce04 Author: Ask Hjorth Larsen Date: Fri Aug 9 13:59:30 2024 +0200 add io roundtrip test commit ee333ce7d02a8b74a4612e44c39f1d0d92fde036 Author: Ask Hjorth Larsen Date: Fri Aug 9 13:58:42 2024 +0200 move more amber io code to ase.io.amber. Importantly, raise ValueError on non-orthorhombic cells instead of silently writing wrong information commit a1b7784f34a2e0c851f2aee41f7b4d2a6f5838e1 Merge: df82f26c1 be0eade2a Author: Ask Hjorth Larsen Date: Fri Aug 9 11:26:48 2024 +0000 Merge branch 'phononamplitudes' into 'master' Fix phonon amplitudes (Fixes issue #1519) Closes #1519 See merge request ase/ase!3438 commit be0eade2ae3965e71eaa054d2ab96567db53ea16 Author: Jakob Schiotz Date: Fri Aug 9 13:12:22 2024 +0200 Remove extra backtick. commit 12a5acacb2bda1fe68df356edc9311937d702029 Author: Jakob Schiotz Date: Fri Aug 9 11:06:42 2024 +0200 Make linter happy. commit 4f29fd9731bc45598b3ab4a07006e5b02937f408 Author: Jakob Schiotz Date: Fri Aug 9 10:34:05 2024 +0200 Fix badly worded docstring. commit f91b247b111accfd4c219ee0821736e975694fa2 Author: Jakob Schiotz Date: Fri Aug 9 10:27:56 2024 +0200 Fix factor sqrt(2) in amplitudes, fix comments. commit c3c48d83c81e890da58600795dc594c73bee0ad8 Author: Ask Hjorth Larsen Date: Thu Aug 8 21:20:11 2024 +0200 include netcdf_file() opener commit b400e59ee866cb0dd4969c6a85a7fab8f35d9476 Author: Ask Hjorth Larsen Date: Thu Aug 8 21:15:19 2024 +0200 move writer to ase.io.amber commit e95b0850be222ce764ef2ec61d724a58fcb56611 Author: Ask Hjorth Larsen Date: Thu Aug 8 21:10:43 2024 +0200 extract method body to standalone function commit d1d9a519386cbe3d5d5d81fa4bfdbb6dec9bfcd0 Author: Jakob Schiotz Date: Thu Aug 8 17:11:42 2024 +0200 Add test that checks phonon frequencies and amplitudes commit df82f26c160021913bb0a13d655f7b69bd790af7 Merge: bf83c62d9 587630f39 Author: Adam Jackson Date: Thu Aug 8 15:02:21 2024 +0000 Merge branch 'add-espresso-epw' into 'master' ENH: add epw keys to ase.io.espresso_namelist.keys See merge request ase/ase!3421 commit bf83c62d9284245cbab627d67c3e7b64ad27d5d0 Merge: 0bb06d3dd 6386bf6cf Author: Ask Hjorth Larsen Date: Thu Aug 8 14:38:30 2024 +0000 Merge branch 'master' into 'master' ENH: made get_bonds a method of View See merge request ase/ase!3419 commit 0bb06d3ddec50083fbf275013948ae1d7fb94081 Merge: 2c0ea1252 90b3582cd Author: Ask Hjorth Larsen Date: Thu Aug 8 14:36:19 2024 +0000 Merge branch 'new_amber_velocities_fix' into 'master' BUG: New amber velocities fix See merge request ase/ase!3427 commit 90b3582cd46f90fa76a2348a12586e0776df6c48 Author: Nicholas Hine Date: Thu Aug 8 14:36:19 2024 +0000 BUG: New amber velocities fix commit 8c141cf40a3db5b0c58cb1eee629b7d782d17665 Author: yuzie007 Date: Thu Aug 8 09:34:00 2024 +0200 Fix `get_deviation_from_optimal_cell_shape` commit 470dd013b0011c07ad4e7cca5ef7a0db38cc727c Author: yuzie007 Date: Thu Aug 8 12:28:58 2024 +0200 Add tests for conversions from/to `fcc` commit 72c72e44a7f8fae6eb48aa2800ec4765e18b877d Author: yuzie007 Date: Thu Aug 8 11:09:21 2024 +0200 Convert `cell` to `np.ndarray` commit 3b177f7c381bb9b2539a2c5e175590df6ee6c2a7 Author: yuzie007 Date: Thu Aug 8 10:52:56 2024 +0200 Remove unrobust tests The removed tests are unrobust against permutations of lattice vectors and may pass or not depending on implementation details of `find_optimal_cell_shape`. commit 214345dcb0be47cd102fd400b7f0d96078b0c3c2 Author: yuzie007 Date: Thu Aug 8 10:52:09 2024 +0200 Refactor commit b99ea1f7fd198353efd8c149415da317646257e0 Author: yuzie007 Date: Thu Aug 8 10:03:29 2024 +0200 Split tests into small chunks commit 8516ced82ffe05fa3ffafb179bcbd0b26da7ea80 Author: Jakob Schiotz Date: Tue Aug 6 12:27:24 2024 +0200 Undo accidental indentation error. commit f7b97aebd1c0a091607a21cd05773017c5b5cb9a Author: Jakob Schiotz Date: Tue Aug 6 11:59:48 2024 +0200 Mark math as math for sphinx commit 9da8c0b1c1a489500dd6e80c5533a4cb5134f9ed Author: Jakob Schiotz Date: Tue Aug 6 11:51:37 2024 +0200 Second attempt to make test suite accept docstring (no pseudo-latex).. commit b2a7d461be48c4f8ec774c813b2c3aab977e0727 Author: Jakob Schiotz Date: Tue Aug 6 11:22:12 2024 +0200 Wrong end parenthesis in docstring. commit 4f74c2fa5612ff974f4a3557190e551d77bfd4b7 Author: Jakob Schiotz Date: Tue Aug 6 09:41:11 2024 +0200 Fix phonon amplitudes (Fixes issue #1519) commit 6386bf6cff76bc2e7b1a2a94c45b9344d0e5f78f Author: alexhroom Date: Mon Aug 5 13:56:36 2024 +0100 ENH: routed get_bonds through a method for overriding commit a4f3f3c496d9be1cee3a9d907901d6c6742b7db9 Merge: 3d853b2b1 303a166c3 Author: Yann Pouillon Date: Tue Jul 23 10:57:32 2024 +0000 Merge branch '13-bug-in-species-numbers-for-species-with-tags' into 'master-simune' Resolve "Bug in species numbers for species with tags" Closes #13 See merge request simune-oss/forks/ase!21 commit 303a166c3cdabaa2bcf53bac11ab40e388bc9707 Author: Irina Lebedeva Date: Tue Jul 23 11:54:54 2024 +0200 Bug fix + test commit 587630f394848767f617892f48faae9e1a57b49d Author: nerdwarrior Date: Mon Jul 15 12:49:30 2024 -0400 ENH: add epw keys to ase.io.espresso_namelist.keys commit 3d853b2b168eb6181d74ac1d776bbd6560fca3d0 Merge: 826db6a4b 986cc6075 Author: Yann Pouillon Date: Tue Jul 2 13:09:00 2024 +0000 Merge branch '12-update-parse_siesta_version' into 'master-simune' Resolve "Update parse_siesta_version" Closes #12 See merge request simune-oss/forks/ase!20 commit 986cc60759acf3a65abefe50048d531a2b5bc403 Author: Irina Lebedeva Date: Tue Jul 2 12:15:06 2024 +0200 Test fix commit ed41c9d92638c7520087f310dd2c39335eb69bc8 Merge: 66befbfe1 826db6a4b Author: Irina Lebedeva Date: Tue Jul 2 12:04:33 2024 +0200 Merge branch 'master-simune' of https://gitlab.com/simune-oss/forks/ase into 12-update-parse_siesta_version commit 66befbfe181364becd086255b12881c5a4f4377f Author: Irina Lebedeva Date: Tue Jul 2 12:02:39 2024 +0200 Changes commit 826db6a4b98c2efef3e91676ebff4f42cfc10004 Merge: 9fdd8d666 67a973d8b Author: Yann Pouillon Date: Tue Jul 2 10:42:40 2024 +0200 Merge remote-tracking branch 'upstream/master' into master-simune (67a973d8) commit 9fdd8d66632441fd0ef1e17af8f21bc0059be801 Merge: 2d5981fc5 a15bf631b Author: Yann Pouillon Date: Mon May 13 13:19:01 2024 +0000 Merge branch '11-correct-again-chemicalspecieslabel' into 'master-simune' Resolve "Correct again ChemicalSpecieslabel" Closes #11 See merge request simune-oss/forks/ase!19 commit a15bf631b106c153e3f64cc1b6fdcd327c4c953b Author: Irina Lebedeva Date: Mon May 13 15:02:49 2024 +0200 Remove duplicating lines commit 556abca28636d80ee7e890b6486bbc8ba4a56be8 Author: Irina Lebedeva Date: Mon May 13 14:57:10 2024 +0200 Label is unused when pseudo path is set commit 8d475442f2a82e72621129412ebc78014ab28c77 Author: Irina Lebedeva Date: Mon May 13 14:54:06 2024 +0200 One more change commit f394fe9905fa9a8407c0fafb3197d1d2065314b6 Author: Irina Lebedeva Date: Mon May 13 14:44:33 2024 +0200 Corrected block commit 2d5981fc534e7a9ab92e9cf33c7488e7ed39dadd Merge: 1d027bd2d 3c35f4f20 Author: Yann Pouillon Date: Mon May 13 09:38:50 2024 +0000 Merge branch '10-add-pseudopotential-file-name-to-chemicalspecieslabel-block' into 'master-simune' Resolve "Add pseudopotential file name to ChemicalSpecieslabel block" Closes #10 See merge request simune-oss/forks/ase!18 commit 3c35f4f204ff9b020e479f3d5079ae8e47104f67 Author: Irina Lebedeva Date: Mon May 13 11:17:41 2024 +0200 Changes commit 3ffb227ad343b0d848f08680014fb17f71346e21 Author: Irina Lebedeva Date: Mon May 13 11:15:33 2024 +0200 Changes commit 6ddd14089a198d7300b7930d2b085bc183c1cb98 Author: Irina Lebedeva Date: Mon May 13 11:10:30 2024 +0200 Changes commit dd20f73b8465a17c3cce89042a4d5ad05418ddba Author: Irina Lebedeva Date: Mon May 13 10:37:51 2024 +0200 Fixing commit 9dc34785d7bac22d8ea1b63c99f95b438853a867 Author: Irina Lebedeva Date: Mon May 13 10:34:59 2024 +0200 Simplifying the test commit 431739f004e6802d3aeb69fb1ba2e23699045ce9 Author: Irina Lebedeva Date: Fri May 10 16:19:50 2024 +0200 Changes commit f9bd03873a2fd8ea152473fa3195af4f7ffa259c Author: Irina Lebedeva Date: Thu May 9 17:04:14 2024 +0200 Check commit 86fddbda2380da01117b317e70b205c5738f2e07 Author: Irina Lebedeva Date: Thu May 9 16:59:17 2024 +0200 Test fix commit d797e20e095d6d121a6064c21ad0386509a205d5 Author: Irina Lebedeva Date: Thu May 9 16:52:44 2024 +0200 Test fix commit fe1cb9715b39818df76267983eacd157aaca9bfb Author: Irina Lebedeva Date: Thu May 9 16:37:25 2024 +0200 extending the test commit 875f17358a72a214d9870aca48237ab38b4ef5c0 Author: Irina Lebedeva Date: Thu May 9 13:15:46 2024 +0200 Format changes commit 8e12f2e5f1126bc45e664515c9ee6668a54d09d0 Author: Irina Lebedeva Date: Thu May 9 13:11:15 2024 +0200 Fixing test commit 787f3b351ba9b59f213e00bf7aaa969f34ef067a Author: Irina Lebedeva Date: Thu May 9 13:02:54 2024 +0200 Fixing symbol commit 4e4f711656ac3a3444f6e2bb9ba4b570770793ce Author: Irina Lebedeva Date: Thu May 9 12:55:56 2024 +0200 Another test commit 86561c72b1fe0c58286b5384e58bf48a5cdcdc1f Author: Irina Lebedeva Date: Thu May 9 12:42:46 2024 +0200 Test check commit e2571d603624bfb1f546090398ad90ad2819028d Author: Irina Lebedeva Date: Thu May 9 12:28:11 2024 +0200 Test check commit 45c32245d635e7e08c5599fec7dd101688527e87 Merge: 99954f24a 7c94a2173 Author: Irina Lebedeva Date: Thu May 9 12:27:49 2024 +0200 Merge branch '10-add-pseudopotential-file-name-to-chemicalspecieslabel-block' of https://gitlab.com/simune-public/ase into 10-add-pseudopotential-file-name-to-chemicalspecieslabel-block commit 7c94a21737f872fea9e02ddda0f99b5dd6d60f7a Author: Irina Lebedeva Date: Thu May 9 12:00:08 2024 +0200 Changes commit fdde78f795c301d234f6c845291d5a8d50321524 Author: Irina Lebedeva Date: Thu May 9 11:46:15 2024 +0200 Changes commit b04b3887ff63f220ef0fa41fb5bb07671dd0d812 Author: Irina Lebedeva Date: Thu May 9 11:09:23 2024 +0200 Test commit 9ca891ab85e1dedbaf250e6cc9c8516219a2f70e Author: Irina Lebedeva Date: Thu May 9 11:06:28 2024 +0200 Test commit 99954f24a336abe82ba8eb905f7c8bf5545196e4 Author: Irina Lebedeva Date: Thu May 9 12:00:08 2024 +0200 Changes commit ef1e56443f03eb720f9b413b15dc3452271c8600 Author: Irina Lebedeva Date: Thu May 9 11:46:15 2024 +0200 Changes commit b776ed7e00e5bad18af7c482905c02a1a6acb94e Merge: 5d777b805 1d027bd2d Author: Irina Lebedeva Date: Thu May 9 11:34:08 2024 +0200 Merge branch 'master-simune' of https://gitlab.com/simune-public/ase into 10-add-pseudopotential-file-name-to-chemicalspecieslabel-block commit 1d027bd2d9b62dfc2a26453c692849eb111d5e53 Merge: f34895587 d62672179 Author: Yann Pouillon Date: Thu May 9 11:22:42 2024 +0200 Merge commit 'd62672179' into master-simune commit 5d777b8055f269c65606b1ef3375a33668bf36e6 Author: Irina Lebedeva Date: Thu May 9 11:09:23 2024 +0200 Test commit 2340f01fbb4a1ea6a827a2be2b0ad86d4228f233 Author: Irina Lebedeva Date: Thu May 9 11:06:28 2024 +0200 Test commit f34895587db0a0acc26b7cdea8d0ed4cab36be58 Merge: 7a6189887 4e1191d64 Author: Irina Lebedeva Date: Fri Apr 19 08:07:56 2024 +0000 Merge branch '9-bugs-in-read_ion' into 'master-simune' Resolve "Bugs in read_ion" Closes #9 See merge request simune-public/ase!16 commit 4e1191d64400bb403a7d95a9ddd5b03ea90dce13 Merge: 3a6305d99 b63b05102 Author: Irina Lebedeva Date: Thu Apr 18 18:13:20 2024 +0200 Merge branch 'master' of https://gitlab.com/simune-public/ase into 9-bugs-in-read_ion commit 3a6305d99ae4800a5a6d6277842a85e55b9f1df4 Author: Irina Lebedeva Date: Thu Apr 18 18:06:32 2024 +0200 Fix names of ions commit 7a618988773aca448566db458838ff66e6a6014b Merge: 0d72a649b b63b05102 Author: Yann Pouillon Date: Wed Apr 17 16:18:08 2024 +0200 Merge remote-tracking branch 'origin/master' (b63b05102) into master-simune commit 21e7164ac52a9d44e1e978bd190e20c0e293601f Author: Irina Lebedeva Date: Wed Apr 10 11:38:58 2024 +0200 Bug fix commit 0d72a649b7d051f0bcf9a660aa3aa51d975b9877 Merge: 3cc332875 231270027 Author: Yann Pouillon Date: Wed Apr 3 14:17:56 2024 +0200 Merge branch 'master' of git+ssh://gitlab.com/simune-public/ase into master-simune commit 3cc332875b00d61d4cc1e7558a0f1b3110cf3bea Merge: 99836bda0 c78f89146 Author: Yann Pouillon Date: Fri Nov 17 15:52:57 2023 +0000 Merge branch 'using-ase-upstream-master' into 'master-simune' Have ASE upstream/master in master-simune 2024.0 Closes gpaw/gpaw#1042 See merge request simune-public/ase!13 --- .gitlab-ci.yml | 12 +- README.rst | 2 +- appveyor.yml | 16 +- ase/atoms.py | 135 +++++---- ase/build/supercells.py | 47 ++- ase/calculators/amber.py | 147 ++------- ase/calculators/espresso.py | 4 +- ase/calculators/lammpsrun.py | 2 +- ase/calculators/mixing.py | 6 - ase/calculators/octopus.py | 4 +- ase/calculators/siesta/siesta.py | 19 +- ase/calculators/socketio.py | 11 +- ase/calculators/subprocesscalculator.py | 1 - ase/calculators/vasp/vasp.py | 4 - ase/calculators/vasp/vasp_auxiliary.py | 2 +- ase/cli/complete.py | 7 - ase/db/sqlite.py | 4 +- ase/dft/bandgap.py | 2 +- ase/ga/slab_operators.py | 3 +- ase/gui/ui.py | 3 +- ase/gui/view.py | 51 ++-- ase/io/amber.py | 131 ++++++++ ase/io/castep/castep_reader.py | 2 + ase/io/espresso_namelist/keys.py | 211 ++++++++++++- ase/io/octopus/output.py | 70 ++--- ase/io/siesta_input.py | 2 +- ase/md/andersen.py | 13 +- ase/optimize/test/systems.py | 8 - ase/parallel.py | 2 +- ase/phonons.py | 91 ++++-- ase/spacegroup/spacegroup.py | 107 ++++--- ase/spacegroup/symmetrize.py | 92 ++++-- ase/spacegroup/utils.py | 7 +- ase/spectrum/band_structure.py | 184 ++++++----- ase/spectrum/doscollection.py | 15 +- ase/spectrum/dosdata.py | 17 +- ase/test/bandstructure/test_bandstructure.py | 3 + ase/test/build_/test_supercells.py | 124 ++++---- ase/test/calculator/amber/test_amber.py | 30 +- .../calculator/nwchem/test_nwchem_h3o2m.py | 5 - ase/test/calculator/octopus/test_big.py | 57 +--- .../calculator/siesta/test_siesta_version.py | 1 + .../calculator/siesta/test_write_input.py | 12 +- ase/test/calculator/vasp/test_chgcar.py | 16 + ase/test/constraints/test_fix_symmetry.py | 12 +- ase/test/factories.py | 2 +- .../test_input.py} | 0 ase/test/fio/octopus/test_output.py | 105 +++++++ ase/test/fio/test_amber.py | 29 ++ ase/test/geometry/test_distance.py | 11 +- ase/test/geometry/test_geometry.py | 12 +- ase/test/md/test_phonon_md_init.py | 8 - ase/test/md/test_rng.py | 31 ++ ase/test/optimize/test_replay.py | 4 - ase/test/spacegroup/test_minerals.py | 6 +- ase/test/test_dos.py | 5 - ase/test/test_phonons.py | 201 +++++++++++- ase/test/test_thermochemistry.py | 4 +- ...near_response_02-h2o_pol_lr.01_h2o_gs_info | 85 ++++++ ...stems_03-sodium_chain.02-unocc_eigenvalues | 23 ++ ...eriodic_systems_25-Fe_polarized.01-gs_info | 285 ++++++++++++++++++ ...iodic_systems_30-stress.05-output_scf_info | 150 +++++++++ ase/test/testdata/vasp/Li/CHG | 111 +++++++ ase/utils/plotting.py | 11 +- doc/ase/calculators/calculators.rst | 2 +- doc/ase/calculators/qmmm.rst | 2 +- doc/ase/dft/bader.rst | 3 +- doc/ase/dft/stm.rst | 4 +- doc/ase/neb.rst | 7 +- doc/ase/neighborlist.rst | 2 +- doc/ase/optimize.rst | 2 +- doc/ase/vibrations/raman.rst | 2 +- doc/conf.py | 2 +- doc/development/licenseinfo.rst | 2 +- doc/gettingstarted/cluster/cluster.rst | 2 +- .../external_calculators/ext_intro.rst | 2 +- doc/index.rst | 2 +- doc/install.rst | 2 +- doc/logo.py | 39 ++- doc/releasenotes.rst | 4 +- doc/tutorials/qmmm/qmmm.rst | 2 +- doc/tutorials/tut03_vibrations/vibrations.rst | 2 +- pyproject.toml | 5 +- 83 files changed, 2121 insertions(+), 744 deletions(-) create mode 100644 ase/io/amber.py create mode 100644 ase/test/calculator/vasp/test_chgcar.py rename ase/test/fio/{test_octopus.py => octopus/test_input.py} (100%) create mode 100644 ase/test/fio/octopus/test_output.py create mode 100644 ase/test/fio/test_amber.py create mode 100644 ase/test/md/test_rng.py create mode 100644 ase/test/testdata/octopus/linear_response_02-h2o_pol_lr.01_h2o_gs_info create mode 100644 ase/test/testdata/octopus/periodic_systems_03-sodium_chain.02-unocc_eigenvalues create mode 100644 ase/test/testdata/octopus/periodic_systems_25-Fe_polarized.01-gs_info create mode 100644 ase/test/testdata/octopus/periodic_systems_30-stress.05-output_scf_info create mode 100644 ase/test/testdata/vasp/Li/CHG diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f91c9b1560..0bac774231 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,15 +42,11 @@ oldlibs: -W "ignore:can't resolve package" -W ignore::PendingDeprecationWarning + # For testing newest versions of libraries against standard images # on dockerhub. -# -# psycopg2-binary is for testing the postgres backend for ase.db -# Currently we have trouble with pyhon3.8 where we need to compile some -# libraries that don't have binary wheels; we don't want to install gcc -# in this test job. pipinstall: - image: python:3.8 + image: python:3.11 extends: .database-configuration script: - python --version @@ -279,13 +275,13 @@ windows_test: # https://stackoverflow.com/questions/61791108/gitlab-ci-shared-windows-runner-for-python # https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers/-/issues/13 - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" - - choco install python --version=3.8 -y -f + - choco install python --version=3.9 -y -f - refreshenv - script: - python --version - python -m pip install --upgrade pip - python -m pip install pytest pytest-mock - python -m pip install . + script: - > ase test --calculators eam,ff,lj,morse,tip3p,tip4p diff --git a/README.rst b/README.rst index 1fdba3a396..a17d4dd1c4 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ Webpage: http://wiki.fysik.dtu.dk/ase Requirements ------------ -* Python_ 3.8 or later +* Python_ 3.9 or later * NumPy_ (base N-dimensional array package) * SciPy_ (library for scientific computing) * Matplotlib_ (2D Plotting) diff --git a/appveyor.yml b/appveyor.yml index f9e588bba3..9169ff6768 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,14 +2,14 @@ environment: matrix: # For Python versions available on Appveyor, see # http://www.appveyor.com/docs/installed-software#python - # # Python 3.8 - #- PYTHON: "C:\\Python38" - # Python 3.8 - 64-bit - - PYTHON: "C:\\Python38-x64" - # # Conda 3.8 - #- PYTHON: "C:\\Miniconda38" - # # Conda 3.8 64-bit - #- PYTHON: "C:\\Miniconda38-x64" + # # Python 3.9 + #- PYTHON: "C:\\Python39" + # Python 3.9 - 64-bit + - PYTHON: "C:\\Python39-x64" + # # Conda 3.9 + #- PYTHON: "C:\\Miniconda39" + # # Conda 3.9 64-bit + #- PYTHON: "C:\\Miniconda39-x64" install: # Prepend chosen Python to the PATH of this build diff --git a/ase/atoms.py b/ase/atoms.py index d307d9f652..767c5cd78d 100644 --- a/ase/atoms.py +++ b/ase/atoms.py @@ -35,34 +35,44 @@ class Atoms: In order to calculate energies, forces and stresses, a calculator object has to attached to the atoms object. - Parameters: - - symbols: str (formula) or list of str - Can be a string formula, a list of symbols or a list of - Atom objects. Examples: 'H2O', 'COPt12', ['H', 'H', 'O'], - [Atom('Ne', (x, y, z)), ...]. - positions: list of xyz-positions - Atomic positions. Anything that can be converted to an - ndarray of shape (n, 3) will do: [(x1,y1,z1), (x2,y2,z2), - ...]. - scaled_positions: list of scaled-positions - Like positions, but given in units of the unit cell. - Can not be set at the same time as positions. - numbers: list of int - Atomic numbers (use only one of symbols/numbers). - tags: list of int + Parameters + ---------- + symbols : str | list[str] | list[Atom] + Chemical formula, a list of chemical symbols, or list of + :class:`~ase.Atom` objects (mutually exclusive with ``numbers``). + + - ``'H2O'`` + - ``'COPt12'`` + - ``['H', 'H', 'O']`` + - ``[Atom('Ne', (x, y, z)), ...]`` + + positions : list[tuple[float, float, float]] + Atomic positions in Cartesian coordinates + (mutually exclusive with ``scaled_positions``). + Anything that can be converted to an ndarray of shape (n, 3) works: + [(x0, y0, z0), (x1, y1, z1), ...]. + scaled_positions : list[tuple[float, float, float]] + Atomic positions in units of the unit cell + (mutually exclusive with ``positions``). + numbers : list[int] + Atomic numbers (mutually exclusive with ``symbols``). + tags : list[int] Special purpose tags. - momenta: list of xyz-momenta - Momenta for all atoms. - masses: list of float + momenta : list[tuple[float, float, float]] + Momenta for all atoms in Cartesian coordinates + (mutually exclusive with ``velocities``). + velocities : list[tuple[float, float, float]] + Velocities for all atoms in Cartesian coordinates + (mutually exclusive with ``momenta``). + masses : list[float] Atomic masses in atomic units. - magmoms: list of float or list of xyz-values + magmoms : list[float] | list[tuple[float, float, float]] Magnetic moments. Can be either a single value for each atom for collinear calculations or three numbers for each atom for non-collinear calculations. - charges: list of float + charges : list[float] Initial atomic charges. - cell: 3x3 matrix or length 3 or 6 vector + cell : 3x3 matrix or length 3 or 6 vector, default: (0, 0, 0) Unit cell vectors. Can also be given as just three numbers for orthorhombic cells, or 6 numbers, where first three are lengths of unit cell vectors, and the @@ -70,28 +80,30 @@ class Atoms: [len(a), len(b), len(c), angle(b,c), angle(a,c), angle(a,b)]. First vector will lie in x-direction, second in xy-plane, and the third one in z-positive subspace. - Default value: [0, 0, 0]. - celldisp: Vector + celldisp : tuple[float, float, float], default: (0, 0, 0) Unit cell displacement vector. To visualize a displaced cell - around the center of mass of a Systems of atoms. Default value - = (0,0,0) - pbc: one or three bool - Periodic boundary conditions flags. Examples: True, - False, 0, 1, (1, 1, 0), (True, False, False). Default - value: False. - constraint: constraint object(s) - Used for applying one or more constraints during structure - optimization. - calculator: calculator object - Used to attach a calculator for calculating energies and atomic - forces. - info: dict of key-value pairs - Dictionary of key-value pairs with additional information - about the system. The following keys may be used by ase: - - - spacegroup: Spacegroup instance - - unit_cell: 'conventional' | 'primitive' | int | 3 ints - - adsorbate_info: Information about special adsorption sites + around the center of mass of a Systems of atoms. + pbc : bool | tuple[bool, bool, bool], default: False + Periodic boundary conditions flags. + + - ``True`` + - ``False`` + - ``0`` + - ``1`` + - ``(1, 1, 0)`` + - ``(True, False, False)`` + + constraint : constraint object(s) + One or more ASE constraints applied during structure optimization. + calculator : calculator object + ASE calculator to obtain energies and atomic forces. + info : dict | None, default: None + Dictionary with additional information about the system. + The following keys may be used by ASE: + + - spacegroup: :class:`~ase.spacegroup.Spacegroup` instance + - unit_cell: 'conventional' | 'primitive' | int | 3 ints + - adsorbate_info: Information about special adsorption sites Items in the info attribute survives copy and slicing and can be stored in and retrieved from trajectory files given that the @@ -99,12 +111,12 @@ class Atoms: user-defined object, its base class is importable. One should not make any assumptions about the existence of keys. - Examples: - - These three are equivalent: - + Examples + -------- >>> from ase import Atom + N2 molecule (These three are equivalent): + >>> d = 1.104 # N2 bondlength >>> a = Atoms('N2', [(0, 0, 0), (0, 0, d)]) >>> a = Atoms(numbers=[7, 7], positions=[(0, 0, 0), (0, 0, d)]) @@ -190,22 +202,19 @@ class Atoms: self.arrays = {} - if symbols is None: - if numbers is None: - if positions is not None: - natoms = len(positions) - elif scaled_positions is not None: - natoms = len(scaled_positions) - else: - natoms = 0 - numbers = np.zeros(natoms, int) - self.new_array('numbers', numbers, int) - else: - if numbers is not None: - raise TypeError( - 'Use only one of "symbols" and "numbers".') + if symbols is not None and numbers is not None: + raise TypeError('Use only one of "symbols" and "numbers".') + if symbols is not None: + numbers = symbols2numbers(symbols) + elif numbers is None: + if positions is not None: + natoms = len(positions) + elif scaled_positions is not None: + natoms = len(scaled_positions) else: - self.new_array('numbers', symbols2numbers(symbols), int) + natoms = 0 + numbers = np.zeros(natoms, int) + self.new_array('numbers', numbers, int) if self.numbers.ndim != 1: raise ValueError('"numbers" must be 1-dimensional.') @@ -227,7 +236,7 @@ class Atoms: else: if scaled_positions is not None: raise TypeError( - 'Use only one of "symbols" and "numbers".') + 'Use only one of "positions" and "scaled_positions".') self.new_array('positions', positions, float, (3,)) self.set_constraint(constraint) diff --git a/ase/build/supercells.py b/ase/build/supercells.py index 1c6f64ec6a..7e890d766b 100644 --- a/ase/build/supercells.py +++ b/ase/build/supercells.py @@ -1,5 +1,7 @@ """Helper functions for creating supercells.""" +import warnings + import numpy as np from ase import Atoms @@ -39,21 +41,32 @@ def get_deviation_from_optimal_cell_shape(cell, target_shape="sc", norm=None): Returns: float: Cell metric (0 is perfect score) + + .. deprecated:: 3.24.0 + `norm` is unused in ASE 3.24.0 and removed in ASE 3.25.0. + """ + if norm is not None: + warnings.warn( + '`norm` is unused in ASE 3.24.0 and removed in ASE 3.25.0', + FutureWarning, + ) + cell_lengths = np.linalg.norm(cell, axis=1) eff_cubic_length = float(abs(np.linalg.det(cell)) ** (1 / 3)) # 'a_0' - if target_shape == 'sc' and norm is None: - norm = 1 / eff_cubic_length + if target_shape == 'sc': + target_length = eff_cubic_length - elif target_shape == 'fcc' and norm is None: + elif target_shape == 'fcc': # FCC is characterised by 60 degree angles & lattice vectors = 2**(1/6) # times the eff cubic length: - eff_fcc_length = eff_cubic_length * 2 ** (1 / 6) - norm = 1 / eff_fcc_length + target_length = eff_cubic_length * 2 ** (1 / 6) + + inv_target_length = 1.0 / target_length # rms difference to eff cubic/FCC length: - return np.sqrt(np.sum(((cell_lengths * norm) - 1) ** 2)) + return np.sqrt(np.sum((cell_lengths * inv_target_length - 1.0) ** 2)) def find_optimal_cell_shape( @@ -97,6 +110,7 @@ def find_optimal_cell_shape( 2D array of integers: Transformation matrix that produces the optimal supercell. """ + cell = np.asarray(cell) # Set up target metric if target_shape == 'sc': @@ -130,13 +144,20 @@ def find_optimal_cell_shape( best_score = 1e6 optimal_P = None - for dP in product(range(lower_limit, upper_limit + 1), repeat=9): - dP = np.array(dP, dtype=int).reshape(3, 3) - P = starting_P + dP - if int(np.around(np.linalg.det(P), 0)) != target_size: - continue - score = get_deviation_from_optimal_cell_shape( - np.dot(P, norm_cell), target_shape=target_shape, norm=1.0) + + # Build a big matrix of all admissible integer matrix operations. + # (If this takes too much memory we could do blocking but there are + # too many for looping one by one.) + operations = np.array([ + *product(range(lower_limit, upper_limit + 1), repeat=9) + ]).reshape(-1, 3, 3) + starting_P + determinants = np.linalg.det(operations) + + good_indices = np.where(abs(determinants - target_size) < 1e-12)[0] + + for i in good_indices: + P = operations[i] + score = get_deviation_from_optimal_cell_shape(P @ cell, target_shape) if score < best_score: best_score = score optimal_P = P diff --git a/ase/calculators/amber.py b/ase/calculators/amber.py index ace11757c4..8b3d92f44a 100644 --- a/ase/calculators/amber.py +++ b/ase/calculators/amber.py @@ -9,10 +9,11 @@ Before usage, input files (infile, topologyfile, incoordfile) import subprocess import numpy as np -from scipy.io import netcdf +from scipy.io import netcdf_file import ase.units as units from ase.calculators.calculator import Calculator, FileIOCalculator +from ase.io.amber import read_amber_coordinates, write_amber_coordinates class Amber(FileIOCalculator): @@ -106,83 +107,19 @@ class Amber(FileIOCalculator): """Write updated coordinates to a file.""" FileIOCalculator.write_input(self, atoms, properties, system_changes) - self.write_coordinates(atoms) + self.write_coordinates(atoms, self.incoordfile) def read_results(self): """ read energy and forces """ self.read_energy() self.read_forces() - def write_coordinates(self, atoms, filename=''): + def write_coordinates(self, atoms, filename): """ write amber coordinates in netCDF format, only rectangular unit cells are allowed""" - if filename == '': - filename = self.incoordfile - from scipy.io import netcdf_file - fout = netcdf_file(filename, 'w') - # dimension - fout.Conventions = 'AMBERRESTART' - fout.ConventionVersion = "1.0" - fout.title = 'Ase-generated-amber-restart-file' - fout.application = "AMBER" - fout.program = "ASE" - fout.programVersion = "1.0" - fout.createDimension('cell_spatial', 3) - fout.createDimension('label', 5) - fout.createDimension('cell_angular', 3) - fout.createDimension('time', 1) - time = fout.createVariable('time', 'd', ('time',)) - time.units = 'picosecond' - time[0] = 0 - fout.createDimension('spatial', 3) - spatial = fout.createVariable('spatial', 'c', ('spatial',)) - spatial[:] = np.asarray(list('xyz')) - # spatial = 'xyz' - - natom = len(atoms) - fout.createDimension('atom', natom) - coordinates = fout.createVariable('coordinates', 'd', - ('atom', 'spatial')) - coordinates.units = 'angstrom' - coordinates[:] = atoms.get_positions()[:] - - if atoms.get_velocities() is not None: - velocities = fout.createVariable('velocities', 'd', - ('atom', 'spatial')) - velocities.units = 'angstrom/picosecond' - velocities[:] = atoms.get_velocities()[:] - - # title - cell_angular = fout.createVariable('cell_angular', 'c', - ('cell_angular', 'label')) - cell_angular[0] = np.asarray(list('alpha')) - cell_angular[1] = np.asarray(list('beta ')) - cell_angular[2] = np.asarray(list('gamma')) - - # title - cell_spatial = fout.createVariable('cell_spatial', 'c', - ('cell_spatial',)) - cell_spatial[0], cell_spatial[1], cell_spatial[2] = 'a', 'b', 'c' - - # data - cell_lengths = fout.createVariable('cell_lengths', 'd', - ('cell_spatial',)) - cell_lengths.units = 'angstrom' - cell_lengths[0] = atoms.get_cell()[0, 0] - cell_lengths[1] = atoms.get_cell()[1, 1] - cell_lengths[2] = atoms.get_cell()[2, 2] - - cell_angles = fout.createVariable('cell_angles', 'd', - ('cell_angular',)) - box_alpha, box_beta, box_gamma = 90.0, 90.0, 90.0 - cell_angles[0] = box_alpha - cell_angles[1] = box_beta - cell_angles[2] = box_gamma - - cell_angles.units = 'degree' - fout.close() - - def read_coordinates(self, atoms, filename=''): + write_amber_coordinates(atoms, filename) + + def read_coordinates(self, atoms): """Import AMBER16 netCDF restart files. Reads atom positions and @@ -192,66 +129,30 @@ class Amber(FileIOCalculator): This may be useful if you have run amber many steps and want to read new positions and velocities """ - - if filename == '': - filename = self.outcoordfile - - import numpy as np - from scipy.io import netcdf - - import ase.units as units - - fin = netcdf.netcdf_file(filename, 'r') - all_coordinates = fin.variables['coordinates'][:] - get_last_frame = False - if hasattr(all_coordinates, 'ndim'): - if all_coordinates.ndim == 3: - get_last_frame = True - elif hasattr(all_coordinates, 'shape'): - if len(all_coordinates.shape) == 3: - get_last_frame = True - if get_last_frame: - all_coordinates = all_coordinates[-1] - atoms.set_positions(all_coordinates) - if 'velocities' in fin.variables: - all_velocities = fin.variables['velocities'][:] / (1000 * units.fs) - if get_last_frame: - all_velocities = all_velocities[-1] - atoms.set_velocities(all_velocities) - if 'cell_lengths' in fin.variables: - all_abc = fin.variables['cell_lengths'] - if get_last_frame: - all_abc = all_abc[-1] - a, b, c = all_abc - all_angles = fin.variables['cell_angles'] - if get_last_frame: - all_angles = all_angles[-1] - alpha, beta, gamma = all_angles - - if (all(angle > 89.99 for angle in [alpha, beta, gamma]) and - all(angle < 90.01 for angle in [alpha, beta, gamma])): - atoms.set_cell( - np.array([[a, 0, 0], - [0, b, 0], - [0, 0, c]])) - atoms.set_pbc(True) - else: - raise NotImplementedError('only rectangular cells are' - ' implemented in ASE-AMBER') - - else: - atoms.set_pbc(False) + # For historical reasons we edit the input atoms rather than + # returning new atoms. + _atoms = read_amber_coordinates(self.outcoordfile) + atoms.cell[:] = _atoms.cell + atoms.pbc[:] = _atoms.pbc + atoms.positions[:] = _atoms.positions + atoms.set_momenta(_atoms.get_momenta()) def read_energy(self, filename='mden'): """ read total energy from amber file """ - with open(filename) as fd: + with open(filename, 'r') as fd: lines = fd.readlines() + blocks = [] + while 'L0' in lines[0].split()[0]: + blocks.append(lines[0:10]) + lines = lines[10:] + if lines == []: + break self.results['energy'] = \ - float(lines[16].split()[2]) * units.kcal / units.mol + float(blocks[-1][6].split()[2]) * units.kcal / units.mol def read_forces(self, filename='mdfrc'): """ read forces from amber file """ - fd = netcdf.netcdf_file(filename, 'r') + fd = netcdf_file(filename, 'r', mmap=False) try: forces = fd.variables['forces'] self.results['forces'] = forces[-1, :, :] \ @@ -278,7 +179,7 @@ class Amber(FileIOCalculator): subprocess.check_call(parmed_command, shell=True, cwd=self.directory) def get_virtual_charges(self, atoms): - with open(self.topologyfile) as fd: + with open(self.topologyfile, 'r') as fd: topology = fd.readlines() for n, line in enumerate(topology): if '%FLAG CHARGE' in line: diff --git a/ase/calculators/espresso.py b/ase/calculators/espresso.py index 35c47533f0..cfaa59eefb 100644 --- a/ase/calculators/espresso.py +++ b/ase/calculators/espresso.py @@ -6,7 +6,6 @@ Run pw.x jobs. import os import warnings -from pathlib import Path from ase.calculators.genericfileio import ( BaseProfile, @@ -36,7 +35,8 @@ class EspressoProfile(BaseProfile): def __init__(self, command, pseudo_dir, **kwargs): super().__init__(command, **kwargs) - self.pseudo_dir = Path(pseudo_dir) + # not Path object to avoid problems in remote calculations from Windows + self.pseudo_dir = str(pseudo_dir) @staticmethod def parse_version(stdout): diff --git a/ase/calculators/lammpsrun.py b/ase/calculators/lammpsrun.py index 1c23a52095..ce9e075000 100644 --- a/ase/calculators/lammpsrun.py +++ b/ase/calculators/lammpsrun.py @@ -123,7 +123,7 @@ class LAMMPS(Calculator): H = Atom('H', position=Ni.cell.diagonal()/2) NiH = Ni + H - lammps = LAMMPS(parameters=parameters, files=files) + lammps = LAMMPS(files=files, **parameters) NiH.calc = lammps print("Energy ", NiH.get_potential_energy()) diff --git a/ase/calculators/mixing.py b/ase/calculators/mixing.py index 509248073e..8731e92f77 100644 --- a/ase/calculators/mixing.py +++ b/ase/calculators/mixing.py @@ -1,7 +1,6 @@ from ase.calculators.calculator import ( BaseCalculator, CalculatorSetupError, - PropertyNotImplementedError, all_changes, ) from ase.stress import full_3x3_to_voigt_6_stress @@ -14,11 +13,6 @@ class Mixer: *(set(calc.implemented_properties) for calc in calcs) ) self.implemented_properties = list(common_properties) - if not self.implemented_properties: - raise PropertyNotImplementedError( - "The provided Calculators have" - " no properties in common!" - ) self.calcs = calcs self.weights = weights diff --git a/ase/calculators/octopus.py b/ase/calculators/octopus.py index f4c29c59ba..2a0a5aebc0 100644 --- a/ase/calculators/octopus.py +++ b/ase/calculators/octopus.py @@ -64,8 +64,8 @@ class OctopusTemplate(CalculatorTemplate): kpt_weights = np.ones(len(kpts)) # XXX ? Or 1 / len(kpts) ? # XXX New Octopus probably has symmetry reduction !! results.update(eigenvalues=eigs, occupations=occs, - ibz_k_points=kpts, - k_point_weights=kpt_weights) + ibz_kpoints=kpts, + kpoint_weights=kpt_weights) return results def execute(self, directory, profile): diff --git a/ase/calculators/siesta/siesta.py b/ase/calculators/siesta/siesta.py index 463dbb672a..d13d12d856 100644 --- a/ase/calculators/siesta/siesta.py +++ b/ase/calculators/siesta/siesta.py @@ -34,7 +34,7 @@ meV = 0.001 * eV def parse_siesta_version(output: bytes) -> str: - match = re.search(rb'Siesta Version\s*:\s*(\S+)', output) + match = re.search(rb'Version\s*:\s*(\S+)', output) if match is None: raise RuntimeError('Could not get Siesta version info from output ' @@ -483,13 +483,10 @@ class Siesta(FileIOCalculator): name = f"{name}.ghost" atomic_number = -atomic_number - label = name.rsplit('.', 2)[0] - - if label not in ion_results: - fname = self.getpath(label, 'ion.xml') - fname = Path(fname) + if name not in ion_results: + fname = self.getpath(name, 'ion.xml') if fname.is_file(): - ion_results[label] = get_ion(fname) + ion_results[name] = get_ion(str(fname)) return ion_results @@ -607,7 +604,7 @@ class SpeciesInfo: src_path = self.pseudo_path / f"{label}.psf" else: src_path = Path(spec['pseudopotential']) - label = src_path.stem + if not src_path.is_absolute(): src_path = self.pseudo_path / src_path if not src_path.exists(): @@ -626,7 +623,11 @@ class SpeciesInfo: file_instructions.append(instr) label = '.'.join(np.array(name.split('.'))[:-1]) - string = ' %d %d %s' % (species_number, atomic_number, label) + pseudo_name = '' + if src_path.suffix != '.psf': + pseudo_name = f'{label}{src_path.suffix}' + string = ' %d %d %s %s' % (species_number, atomic_number, label, + pseudo_name) chemical_labels.append(string) if isinstance(spec['basis_set'], PAOBasisBlock): pao_basis.append(spec['basis_set'].script(label)) diff --git a/ase/calculators/socketio.py b/ase/calculators/socketio.py index aa8ca94233..61459f1a6e 100644 --- a/ase/calculators/socketio.py +++ b/ase/calculators/socketio.py @@ -251,14 +251,19 @@ class FileIOSocketClientLauncher: self.calc.write_input(atoms, properties=properties, system_changes=all_changes) + if isinstance(profile, StandardProfile): + return profile.execute_nonblocking(self.calc) + if profile is None: cmd = self.calc.command.replace('PREFIX', self.calc.prefix) cmd = cmd.format(port=port, unixsocket=unixsocket) elif isinstance(profile, OldShellProfile): cmd = profile.command.replace("PREFIX", self.calc.prefix) - return Popen(cmd, shell=True, cwd=cwd) - elif isinstance(profile, StandardProfile): - return profile.execute_nonblocking(self.calc) + else: + raise TypeError( + f"Profile type {type(profile)} not supported for socketio") + + return Popen(cmd, shell=True, cwd=cwd) class SocketServer(IOContext): diff --git a/ase/calculators/subprocesscalculator.py b/ase/calculators/subprocesscalculator.py index 5ca6760b59..c3814da52a 100644 --- a/ase/calculators/subprocesscalculator.py +++ b/ase/calculators/subprocesscalculator.py @@ -303,7 +303,6 @@ class Client: raise RuntimeError(f'Bad instruction: {instruction}') try: - print('ARGS', args) value = function(*args) except Exception as ex: import traceback diff --git a/ase/calculators/vasp/vasp.py b/ase/calculators/vasp/vasp.py index ffb20c460f..f4364f7f0f 100644 --- a/ase/calculators/vasp/vasp.py +++ b/ase/calculators/vasp/vasp.py @@ -1063,10 +1063,6 @@ class Vasp(GenerateVaspInput, Calculator): # type: ignore[misc] converged = None # First check electronic convergence for line in lines: - if 0: # vasp always prints that! - if line.rfind('aborting loop') > -1: # scf failed - raise RuntimeError(line.strip()) - break # VASP 6 actually labels loop exit reason if 'aborting loop' in line: converged = 'because EDIFF is reached' in line diff --git a/ase/calculators/vasp/vasp_auxiliary.py b/ase/calculators/vasp/vasp_auxiliary.py index e3b94dcc41..0e93188016 100644 --- a/ase/calculators/vasp/vasp_auxiliary.py +++ b/ase/calculators/vasp/vasp_auxiliary.py @@ -88,7 +88,7 @@ class VaspChargeDensity: while True: try: atoms = aiv.read_vasp(fd) - except (OSError, ValueError, IndexError): + except (KeyError, RuntimeError, ValueError): # Probably an empty line, or we tried to read the # augmentation occupancies in CHGCAR break diff --git a/ase/cli/complete.py b/ase/cli/complete.py index be3839f10e..b61702e92b 100755 --- a/ase/cli/complete.py +++ b/ase/cli/complete.py @@ -138,13 +138,6 @@ def complete(word, previous, line, point): return words -if sys.version_info[0] == 2: - import warnings - warnings.warn('Command-line completion running with python2. ' - 'Your ASE autocompletion setup is probably outdated. ' - 'Please consider rerunning \'ase completion\'.') - - def main(): word, previous = sys.argv[2:] line = os.environ['COMP_LINE'] diff --git a/ase/db/sqlite.py b/ase/db/sqlite.py index 884540ec78..72f2eb1a05 100644 --- a/ase/db/sqlite.py +++ b/ase/db/sqlite.py @@ -324,8 +324,8 @@ class SQLite3Database(Database): if not isinstance(data, (str, bytes)): data = encode(data, binary=self.version >= 9) - values += (row.get('energy'), - row.get('free_energy'), + values += (float_if_not_none(row.get('energy')), + float_if_not_none(row.get('free_energy')), blob(row.get('forces')), blob(row.get('stress')), blob(row.get('dipole')), diff --git a/ase/dft/bandgap.py b/ase/dft/bandgap.py index 3afc153dc0..5dbd45967d 100644 --- a/ase/dft/bandgap.py +++ b/ase/dft/bandgap.py @@ -68,7 +68,7 @@ class GapInfo: if ibz_kpoints is not None: coordtxt = '[{:.2f}, {:.2f}, {:.2f}]'.format( *ibz_kpoints[skn[1]]) - description = f'{description}, [{coordtxt}]' + description = f'{description}, {coordtxt}' return f'({description})' gap, skn1, skn2 = self.gap() diff --git a/ase/ga/slab_operators.py b/ase/ga/slab_operators.py index 6ca12c72ec..7ac7109cd1 100644 --- a/ase/ga/slab_operators.py +++ b/ase/ga/slab_operators.py @@ -486,6 +486,7 @@ class SymmetrySlabPermutation(SlabOperator): self.descriptor + parent_message) def operate(self, atoms): + from ase.spacegroup.symmetrize import spglib_get_symmetry_dataset # Do the operation sym_num = 1 sg = self.sym_goal @@ -494,7 +495,7 @@ class SymmetrySlabPermutation(SlabOperator): for _ in range(2): permute2(atoms, rng=self.rng) self.dcf(atoms) - sym_num = spglib.get_symmetry_dataset( + sym_num = spglib_get_symmetry_dataset( atoms_to_spglib_cell(atoms))['number'] if sym_num >= sg: break diff --git a/ase/gui/ui.py b/ase/gui/ui.py index c98112fe1c..704c2ac27d 100644 --- a/ase/gui/ui.py +++ b/ase/gui/ui.py @@ -671,7 +671,8 @@ class ASEGUIWindow(MainWindow): width=width) def line(self, bbox, width=1): - self.canvas.create_line(*tuple(int(x) for x in bbox), width=width) + self.canvas.create_line(*tuple(int(x) for x in bbox), width=width, + fill='black') def text(self, x, y, txt, anchor=tk.CENTER, color='black'): anchor = {'SE': tk.SE}.get(anchor, anchor) diff --git a/ase/gui/view.py b/ase/gui/view.py index 78124843a3..e24a0aaf80 100644 --- a/ase/gui/view.py +++ b/ase/gui/view.py @@ -139,6 +139,11 @@ class View: else: self.draw() + def get_bonds(self, atoms): + # this method exists rather than just using the standalone function + # so that it can be overridden by external libraries + return get_bonds(atoms, self.get_covalent_radii(atoms)) + def set_atoms(self, atoms): natoms = len(atoms) @@ -151,7 +156,7 @@ class View: if self.showing_bonds(): atomscopy = atoms.copy() atomscopy.cell *= self.images.repeat[:, np.newaxis] - bonds = get_bonds(atomscopy, self.get_covalent_radii(atoms)) + bonds = self.get_bonds(atomscopy) else: bonds = np.empty((0, 5), int) @@ -168,29 +173,27 @@ class View: self.X_cell = self.X[natoms:natoms + len(B1)] self.X_bonds = self.X[natoms + len(B1):] - if 1: # if init or frame != self.frame: - cell = atoms.cell - ncellparts = len(B1) - nbonds = len(bonds) - - if 1: # init or (atoms.cell != self.atoms.cell).any(): - self.X_cell[:] = np.dot(B1, cell) - self.B = np.empty((ncellparts + nbonds, 3)) - self.B[:ncellparts] = np.dot(B2, cell) - - if nbonds > 0: - P = atoms.positions - Af = self.images.repeat[:, np.newaxis] * cell - a = P[bonds[:, 0]] - b = P[bonds[:, 1]] + np.dot(bonds[:, 2:], Af) - a - d = (b**2).sum(1)**0.5 - r = 0.65 * self.get_covalent_radii() - x0 = (r[bonds[:, 0]] / d).reshape((-1, 1)) - x1 = (r[bonds[:, 1]] / d).reshape((-1, 1)) - self.X_bonds[:] = a + b * x0 - b *= 1.0 - x0 - x1 - b[bonds[:, 2:].any(1)] *= 0.5 - self.B[ncellparts:] = self.X_bonds + b + cell = atoms.cell + ncellparts = len(B1) + nbonds = len(bonds) + + self.X_cell[:] = np.dot(B1, cell) + self.B = np.empty((ncellparts + nbonds, 3)) + self.B[:ncellparts] = np.dot(B2, cell) + + if nbonds > 0: + P = atoms.positions + Af = self.images.repeat[:, np.newaxis] * cell + a = P[bonds[:, 0]] + b = P[bonds[:, 1]] + np.dot(bonds[:, 2:], Af) - a + d = (b**2).sum(1)**0.5 + r = 0.65 * self.get_covalent_radii() + x0 = (r[bonds[:, 0]] / d).reshape((-1, 1)) + x1 = (r[bonds[:, 1]] / d).reshape((-1, 1)) + self.X_bonds[:] = a + b * x0 + b *= 1.0 - x0 - x1 + b[bonds[:, 2:].any(1)] *= 0.5 + self.B[ncellparts:] = self.X_bonds + b def showing_bonds(self): return self.window['toggle-show-bonds'] diff --git a/ase/io/amber.py b/ase/io/amber.py new file mode 100644 index 0000000000..d77d1ff35a --- /dev/null +++ b/ase/io/amber.py @@ -0,0 +1,131 @@ +import numpy as np + +import ase.units as units + + +def write_amber_coordinates(atoms, filename): + from scipy.io import netcdf_file + with netcdf_file(filename, 'w', mmap=False) as fout: + _write_amber_coordinates(atoms, fout) + + +def read_amber_coordinates(filename): + from scipy.io import netcdf_file + with netcdf_file(filename, 'r', mmap=False) as fin: + return _read_amber_coordinates(fin) + + +def _write_amber_coordinates(atoms, fout): + fout.Conventions = 'AMBERRESTART' + fout.ConventionVersion = "1.0" + fout.title = 'Ase-generated-amber-restart-file' + fout.application = "AMBER" + fout.program = "ASE" + fout.programVersion = "1.0" + fout.createDimension('cell_spatial', 3) + fout.createDimension('label', 5) + fout.createDimension('cell_angular', 3) + fout.createDimension('time', 1) + time = fout.createVariable('time', 'd', ('time',)) + time.units = 'picosecond' + time[0] = 0 + fout.createDimension('spatial', 3) + spatial = fout.createVariable('spatial', 'c', ('spatial',)) + spatial[:] = np.asarray(list('xyz')) + + natom = len(atoms) + fout.createDimension('atom', natom) + coordinates = fout.createVariable('coordinates', 'd', + ('atom', 'spatial')) + coordinates.units = 'angstrom' + coordinates[:] = atoms.get_positions() + + velocities = fout.createVariable('velocities', 'd', + ('atom', 'spatial')) + velocities.units = 'angstrom/picosecond' + # Amber's units of time are 1/20.455 ps + # Any other units are ignored in restart files, so these + # are the only ones it is safe to print + # See: http://ambermd.org/Questions/units.html + # Apply conversion factor from ps: + velocities.scale_factor = 20.455 + # get_velocities call returns velocities with units sqrt(eV/u) + # so convert to Ang/ps + factor = units.fs * 1000 / velocities.scale_factor + velocities[:] = atoms.get_velocities() * factor + + cell_angular = fout.createVariable('cell_angular', 'c', + ('cell_angular', 'label')) + cell_angular = ['alpha', 'beta', 'gamma'] + + cell_spatial = fout.createVariable('cell_spatial', 'c', ('cell_spatial',)) + cell_spatial[:] = ['a', 'b', 'c'] + + cell_lengths = fout.createVariable('cell_lengths', 'd', ('cell_spatial',)) + cell_lengths.units = 'angstrom' + cell_lengths[:] = atoms.cell.lengths() + + if not atoms.cell.orthorhombic: + raise ValueError('Non-orthorhombic cell not supported with amber') + + cell_angles = fout.createVariable('cell_angles', 'd', ('cell_angular',)) + cell_angles[:3] = 90.0 + cell_angles.units = 'degree' + + +def _read_amber_coordinates(fin): + from ase import Atoms + + all_coordinates = fin.variables['coordinates'][:] + get_last_frame = False + if hasattr(all_coordinates, 'ndim'): + if all_coordinates.ndim == 3: + get_last_frame = True + elif hasattr(all_coordinates, 'shape'): + if len(all_coordinates.shape) == 3: + get_last_frame = True + if get_last_frame: + all_coordinates = all_coordinates[-1] + + atoms = Atoms(positions=all_coordinates) + + if 'velocities' in fin.variables: + all_velocities = fin.variables['velocities'] + if hasattr(all_velocities, 'units'): + if all_velocities.units != b'angstrom/picosecond': + raise Exception( + f'Unrecognised units {all_velocities.units}') + if hasattr(all_velocities, 'scale_factor'): + scale_factor = all_velocities.scale_factor + else: + scale_factor = 1.0 + all_velocities = all_velocities[:] * scale_factor + all_velocities = all_velocities / (1000 * units.fs) + if get_last_frame: + all_velocities = all_velocities[-1] + atoms.set_velocities(all_velocities) + if 'cell_lengths' in fin.variables: + all_abc = fin.variables['cell_lengths'] + if get_last_frame: + all_abc = all_abc[-1] + a, b, c = all_abc + all_angles = fin.variables['cell_angles'] + if get_last_frame: + all_angles = all_angles[-1] + alpha, beta, gamma = all_angles + + if (all(angle > 89.99 for angle in [alpha, beta, gamma]) and + all(angle < 90.01 for angle in [alpha, beta, gamma])): + atoms.set_cell( + np.array([[a, 0, 0], + [0, b, 0], + [0, 0, c]])) + atoms.set_pbc(True) + else: + raise NotImplementedError('only rectangular cells are' + ' implemented in ASE-AMBER') + + else: + atoms.set_pbc(False) + + return atoms diff --git a/ase/io/castep/castep_reader.py b/ase/io/castep/castep_reader.py index 9b4e244ffe..693ca2060f 100644 --- a/ase/io/castep/castep_reader.py +++ b/ase/io/castep/castep_reader.py @@ -60,6 +60,7 @@ def read_castep_castep(fd, index=-1): images = [] results = {} + constraints = [] species_pot = [] castep_warnings = [] for i, line in enumerate(fd): @@ -166,6 +167,7 @@ def read_castep_castep(fd, index=-1): species = None positions_frac = None results = {} + constraints = [] # extract info from the Mulliken analysis elif 'Atomic Populations' in line: diff --git a/ase/io/espresso_namelist/keys.py b/ase/io/espresso_namelist/keys.py index 7da1a12c7e..ca08f16da5 100644 --- a/ase/io/espresso_namelist/keys.py +++ b/ase/io/espresso_namelist/keys.py @@ -1299,6 +1299,214 @@ dvscf_q2r = { ] } +epw_keys = { + "inputepw": [ + "adapt_ethrdg_plrn", + "a2f", + "amass", + "asr_typ", + "assume_metal", + "band_plot", + "bands_skipped", + "bfieldx", + "bfieldy", + "bfieldz", + "bnd_cum", + "broyden_beta", + "broyden_ndim", + "cal_psir_plrn", + "carrier", + "conv_thr_iaxis", + "conv_thr_plrn", + "conv_thr_racon", + "conv_thr_raxis", + "cumulant", + "degaussq", + "degaussw", + "delta_approx", + "delta_qsmear", + "delta_smear", + "dvscf_dir", + "do_CHBB", + "efermi_read", + "eig_read", + "elecselfen", + "eliashberg", + "elph", + "ep_coupling", + "epbwrite", + "epbread", + "epexst", + "ephwrite", + "epmatkqread", + "eps_acustic", + "epsiHEG", + "epwread", + "epwwrite", + "etf_mem", + "ethrdg_plrn", + "fermi_diff", + "fermi_energy", + "fermi_plot", + "fila2f", + "fildvscf", + "filkf", + "filqf", + "filukk", + "filukq", + "fixsym", + "fsthick", + "gap_edge", + "gb_scattering", + "gb_only", + "gb_size", + "imag_read", + "init_ethrdg_plrn", + "init_k0_plrn", + "init_ntau_plrn", + "init_plrn", + "init_sigma_plrn", + "interp_Ank_plrn", + "interp_Bqu_plrn", + "int_mob", + "io_lvl_plrn", + "iterative_bte", + "iverbosity", + "ii_g", + "ii_scattering", + "ii_only", + "ii_lscreen", + "ii_partion", + "ii_charge", + "ii_n", + "ii_eda", + "kerread", + "kerwrite", + "kmaps", + "lacon", + "laniso", + "lifc", + "limag", + "lindabs", + "liso", + "longrange", + "lpade", + "lphase", + "lpolar", + "lreal", + "lscreen", + "lunif", + "loptabs", + "len_mesh", + "max_memlt", + "meff", + "mob_maxiter", + "mp_mesh_k", + "mp_mesh_q", + "muc", + "meshnum", + "nbndsub", + "ncarrier", + "nc", + "nel", + "nest_fn", + "nethrdg_plrn", + "ngaussw", + "niter_plrn", + "nk1", + "nk2", + "nk3", + "nkf1", + "nkf2", + "nkf3", + "nq1", + "nq2", + "nq3", + "nqf1", + "nqf2", + "nqf3", + "npade", + "nqsmear", + "nqstep", + "n_r", + "nsiter", + "nsmear", + "nstemp", + "nswi", + "nswc", + "nswfc", + "nw", + "nw_specfun", + "nq_init", + "omegamax", + "omegamin", + "omegastep", + "phonselfen", + "plselfen", + "plrn", + "prefix", + "prtgkk", + "pwc", + "QD_bin", + "QD_min", + "rand_nq", + "rand_nk", + "rand_q", + "rand_k", + "restart", + "restart_filq", + "restart_plrn", + "restart_step", + "scell_mat", + "scell_mat_plrn", + "scr_typ", + "scatread", + "scattering", + "scattering_serta", + "scattering_0rta", + "scissor", + "selecqread", + "smear_rpa", + "specfun_el", + "specfun_ph", + "specfun_pl", + "system_2d", + "shortrange", + "step_wf_grid_plrn", + "start_mesh", + "temps", + "tc_linear", + "tc_linear_solver", + "type_plrn", + "vme", + "wannierize", + "wepexst", + "wmax", + "wmax_specfun", + "wmin", + "wmin_specfun", + "wscut", + "wsfc", + "auto_projections", + "dis_froz_min", + "dis_froz_max", + "iprint", + "num_iter", + "proj", + "reduce_unk", + "scdm_entanglement", + "scdm_mu", + "scdm_proj", + "scdm_sigma", + "wannier_plot", + "wannier_plot_list", + "wannier_plot_radius", + "wannier_plot_scale", + "wannier_plot_supercell", + "wdata" + ] +} + ALL_KEYS = { "pw": pw_keys, "ph": ph_keys, @@ -1334,5 +1542,6 @@ ALL_KEYS = { "d3hess": d3hess_keys, "neb": neb_keys, "postahc": postahc_keys, - "dvscf_q2r": dvscf_q2r + "dvscf_q2r": dvscf_q2r, + "epw": epw_keys } diff --git a/ase/io/octopus/output.py b/ase/io/octopus/output.py index 41b42448e9..facdff22fb 100644 --- a/ase/io/octopus/output.py +++ b/ase/io/octopus/output.py @@ -112,9 +112,9 @@ def read_static_info_kpoints(fd): kpts.append(kxyz) weights.append(weight) - ibz_k_points = np.array(kpts, float) - k_point_weights = np.array(weights, float) - return dict(ibz_k_points=ibz_k_points, k_point_weights=k_point_weights) + ibz_kpoints = np.array(kpts, float) + kpoint_weights = np.array(weights, float) + return dict(ibz_kpoints=ibz_kpoints, kpoint_weights=kpoint_weights) def read_static_info_eigenvalues(fd, energy_unit): @@ -186,31 +186,28 @@ def read_static_info(fd): elif line.startswith('Energy ['): unit = get_energy_unit(line) results.update(read_static_info_energy(fd, unit)) - elif line.startswith('Stress tensor'): - assert line.split()[-1] == '[H/b^3]' - stress = read_static_info_stress(fd) - stress *= Hartree / Bohr**3 - results.update(stress=stress) + elif line.startswith('Total stress tensor ['): + if '[H/b^3]' in line: + stress = read_static_info_stress(fd) + stress *= Hartree / Bohr**3 + results.update(stress=stress) elif line.startswith('Total Magnetic Moment'): - if 0: - line = next(fd) + line = next(fd) + values = line.split() + results['magmom'] = float(values[-1]) + line = next(fd) + assert line.startswith('Local Magnetic Moments') + line = next(fd) + assert line.split() == ['Ion', 'mz'] + # Reading Local Magnetic Moments + magmoms = [] + for line in fd: + if line == '\n': + break # there is no more thing to search for + line = line.replace('\n', ' ') values = line.split() - results['magmom'] = float(values[-1]) - - line = next(fd) - assert line.startswith('Local Magnetic Moments') - line = next(fd) - assert line.split() == ['Ion', 'mz'] - # Reading Local Magnetic Moments - mag_moment = [] - for line in fd: - if line == '\n': - break # there is no more thing to search for - line = line.replace('\n', ' ') - values = line.split() - mag_moment.append(float(values[-1])) - - results['magmoms'] = np.array(mag_moment) + magmoms.append(float(values[-1])) + results['magmoms'] = np.array(magmoms) elif line.startswith('Dipole'): assert line.split()[-1] == '[Debye]' dipole = [float(next(fd).split()[-1]) for i in range(3)] @@ -228,26 +225,5 @@ def read_static_info(fd): tokens = line.split()[-3:] forces.append([float(f) for f in tokens]) results['forces'] = np.array(forces) * forceunit - elif line.startswith('Fermi'): - tokens = line.split() - unit = {'eV': eV, 'H': Hartree}[tokens[-1]] - eFermi = float(tokens[-2]) * unit - results['efermi'] = eFermi - - if 'ibz_k_points' not in results: - results['ibz_k_points'] = np.zeros((1, 3)) - results['k_point_weights'] = np.ones(1) - if 0: # 'efermi' not in results: - # Find HOMO level. Note: This could be a very bad - # implementation with fractional occupations if the Fermi - # level was not found otherwise. - all_energies = results['eigenvalues'].ravel() - all_occupations = results['occupations'].ravel() - args = np.argsort(all_energies) - for arg in args[::-1]: - if all_occupations[arg] > 0.1: - break - eFermi = all_energies[arg] - results['efermi'] = eFermi return results diff --git a/ase/io/siesta_input.py b/ase/io/siesta_input.py index 38f0bbb29c..0b5521342e 100644 --- a/ase/io/siesta_input.py +++ b/ase/io/siesta_input.py @@ -91,7 +91,7 @@ class SiestaInput: mask = np.logical_and(mask1, mask2) if sum(mask) > 0: species_numbers[mask] = i - i += 1 + i += 1 all_species = default_species + non_default_species return all_species, species_numbers diff --git a/ase/md/andersen.py b/ase/md/andersen.py index c93742c936..9d57cb604e 100644 --- a/ase/md/andersen.py +++ b/ase/md/andersen.py @@ -45,10 +45,9 @@ class Andersen(MolecularDynamics): If True, the position and momentum of the center of mass is kept unperturbed. Default: True. - rng: RNG object (optional) - Random number generator, by default numpy.random. Must have a - random_sample method matching the signature of - numpy.random.random_sample. + rng: RNG object, default: ``numpy.random`` + Random number generator. This must have the ``random`` method + with the same signature as ``numpy.random.random``. logfile: file object or str (optional) If *logfile* is a string, a file with that name will be opened. @@ -97,8 +96,8 @@ class Andersen(MolecularDynamics): self.dt = timestep def boltzmann_random(self, width, size): - x = self.rng.random_sample(size=size) - y = self.rng.random_sample(size=size) + x = self.rng.random(size=size) + y = self.rng.random(size=size) z = width * cos(2 * pi * x) * (-2 * log(1 - y))**0.5 return z @@ -135,7 +134,7 @@ class Andersen(MolecularDynamics): # apply Andersen thermostat self.random_velocity = self.get_maxwell_boltzmann_velocities() - self.andersen_chance = self.rng.random_sample(size=self.v.shape) + self.andersen_chance = self.rng.random(size=self.v.shape) self.communicator.broadcast(self.random_velocity, 0) self.communicator.broadcast(self.andersen_chance, 0) self.v[self.andersen_chance <= self.andersen_prob] \ diff --git a/ase/optimize/test/systems.py b/ase/optimize/test/systems.py index 6e98cb9d2d..68dab1cf70 100644 --- a/ase/optimize/test/systems.py +++ b/ase/optimize/test/systems.py @@ -96,14 +96,6 @@ def create_database(): name = atoms.get_chemical_formula() db.write(atoms, description=description, name=name) - if False: - for atoms, description in systems: - for seed in range(5): - a = atoms.copy() - a.rattle(0.1, seed=seed) - name = a.get_chemical_formula() + '-' + str(seed) - db.write(a, description=description, seed=seed, name=name) - if __name__ == '__main__': create_database() diff --git a/ase/parallel.py b/ase/parallel.py index 6a46654c7e..4a9905925e 100644 --- a/ase/parallel.py +++ b/ase/parallel.py @@ -199,7 +199,7 @@ world = None # Check for special MPI-enabled Python interpreters: if '_gpaw' in sys.builtin_module_names: - # http://wiki.fysik.dtu.dk/gpaw + # http://gpaw.readthedocs.io import _gpaw world = _gpaw.Communicator() elif '_asap' in sys.builtin_module_names: diff --git a/ase/phonons.py b/ase/phonons.py index 9e26ea420b..1d549e6221 100644 --- a/ase/phonons.py +++ b/ase/phonons.py @@ -582,6 +582,9 @@ class Phonons(Displacement): `band_structure` method of the `Phonons` class. The method can optionally calculate and return phonon modes. + Frequencies and modes are in units of eV and 1/sqrt(amu), + respectively. + Parameters: path : BandPath object @@ -601,12 +604,17 @@ class Phonons(Displacement): Returns: BandStructure or tuple of (BandStructure, ndarray) - If `modes` is False, returns a `BandStructure` object - containing the phonon band structure. If `modes` is True, + If ``modes`` is False, returns a ``BandStructure`` object + containing the phonon band structure. If ``modes`` is True, returns a tuple, where the first element is the - `BandStructure` object and the second element is an ndarray + ``BandStructure`` object and the second element is an ndarray of phonon modes. + If modes are returned, the array is of shape + (k-point, bands, atoms, 3) and the norm-squared of the mode + is `1 / m_{eff}`, where `m_{eff}` is the effective mass of the + mode. + Example: >>> from ase.dft.kpoints import BandPath @@ -659,7 +667,7 @@ class Phonons(Displacement): eigenvalues (squared frequency), the corresponding negative frequency is returned. - Frequencies and modes are in units of eV and Ang/sqrt(amu), + Frequencies and modes are in units of eV and 1/sqrt(amu), respectively. Parameters: @@ -678,6 +686,11 @@ class Phonons(Displacement): verbose: bool Print warnings when imaginary frequncies are detected. + Returns: + + If modes=False: Array of energies + + If modes=True: Tuple of two arrays with energies and modes. """ assert self.D_N is not None @@ -698,7 +711,6 @@ class Phonons(Displacement): vol = abs(la.det(self.atoms.cell)) / units.Bohr**3 for q_c in path_kc: - # Add non-analytic part if born: # q-vector in cartesian coordinates @@ -726,7 +738,8 @@ class Phonons(Displacement): if modes: omega2_l, u_xl = la.eigh(D_q, UPLO='U') # Sort eigenmodes according to eigenvalues (see below) and - # multiply with mass prefactor + # multiply with mass prefactor. This gives the eigenmode + # (which is now not normalized!) with units 1/sqrt(amu). u_lx = (self.m_inv_x[:, np.newaxis] * u_xl[:, omega2_l.argsort()]).T.copy() u_kl.append(u_lx.reshape((-1, len(self.indices), 3))) @@ -761,30 +774,63 @@ class Phonons(Displacement): return omega_kl - def get_dos(self, kpts=(10, 10, 10), npts=1000, delta=1e-3, indices=None): + def get_dos(self, kpts=(10, 10, 10), indices=None, verbose=True): + """Return a phonon density of states. + + Parameters: + + kpts: tuple + Shape of Monkhorst-Pack grid for sampling the Brillouin zone. + indices: list + If indices is not None, the amplitude-weighted atomic-partial + DOS for the specified atoms will be calculated. + verbose: bool + Print warnings when imaginary frequncies are detected. + + Returns: + A RawDOSData object containing the density of states. + """ from ase.spectrum.dosdata import RawDOSData # dos = self.dos(kpts, npts, delta, indices) kpts_kc = monkhorst_pack(kpts) - omega_w = self.band_structure(kpts_kc).ravel() - dos = RawDOSData(omega_w, np.ones_like(omega_w)) + if indices is None: + # Return the total DOS + omega_w = self.band_structure(kpts_kc, verbose=verbose).ravel() + dos = RawDOSData(omega_w, np.ones_like(omega_w)) + else: + # Return a partial DOS + omegas, amplitudes = self.band_structure(kpts_kc, + modes=True, + verbose=verbose) + # omegas.shape = (k-points, bands) + # amplitudes.shape = (k-points, bands, atoms, 3) + ampl_sq = (np.abs(amplitudes)**2).sum(axis=3) + assert ampl_sq.ndim == 3 + assert ampl_sq.shape == omegas.shape + (len(self.indices),) + weights = ampl_sq[:, :, indices].sum(axis=2) / ampl_sq.sum(axis=2) + dos = RawDOSData(omegas.ravel(), weights.ravel()) return dos - def dos(self, kpts=(10, 10, 10), npts=1000, delta=1e-3, indices=None): + @deprecated('Please use Phonons.get_dos() instead of Phonons.dos().') + def dos(self, kpts=(10, 10, 10), npts=1000, delta=1e-3): """Calculate phonon dos as a function of energy. Parameters: - qpts: tuple + kpts: tuple Shape of Monkhorst-Pack grid for sampling the Brillouin zone. npts: int Number of energy points. delta: float Broadening of Lorentzian line-shape in eV. - indices: list - If indices is not None, the atomic-partial dos for the specified - atoms will be calculated. + Returns: + Tuple of (frequencies, dos). The frequencies are in units of eV. + + .. deprecated:: 3.23.1 + Please use the ``.get_dos()`` method instead, it returns a proper + RawDOSData object. """ # Monkhorst-Pack grid @@ -812,7 +858,7 @@ class Phonons(Displacement): Parameters: - q_c: ndarray + q_c: ndarray of shape (3,) q-vector of the modes. branches: int or list Branch index of modes. @@ -830,6 +876,8 @@ class Phonons(Displacement): center: bool Center atoms in unit cell if True (default: False). + To exaggerate the amplitudes for better visualization, multiply + kT by the square of the desired factor. """ if isinstance(branches, int): @@ -856,13 +904,20 @@ class Phonons(Displacement): phase_N = np.exp(2.j * pi * np.dot(q_c, R_cN)) phase_Na = phase_N.repeat(len(self.atoms)) + hbar = units._hbar * units.J * units.second for lval in branch_l: omega = omega_l[0, lval] u_av = u_l[0, lval] - - # Mean displacement of a classical oscillator at temperature T - u_av *= sqrt(kT) / abs(omega) + assert u_av.ndim == 2 + + # For a classical harmonic oscillator, = k T / m omega^2 + # and = 1/2 u^2 where u is the amplitude and m is the + # effective mass of the mode. + # The reciprocal mass is already included in the normalization + # of the modes. The variable omega is actually hbar*omega (it + # is in eV, not reciprocal ASE time units). + u_av *= hbar * sqrt(2 * kT) / abs(omega) mode_av = np.zeros((len(self.atoms), 3), dtype=complex) # Insert slice with atomic displacements for the included atoms diff --git a/ase/spacegroup/spacegroup.py b/ase/spacegroup/spacegroup.py index f5fadc5e87..707247016d 100644 --- a/ase/spacegroup/spacegroup.py +++ b/ase/spacegroup/spacegroup.py @@ -13,6 +13,8 @@ from typing import Union import numpy as np +from ase.utils import deprecated + __all__ = ['Spacegroup'] @@ -441,49 +443,57 @@ class Spacegroup: >>> kinds [0, 0, 0, 0, 1, 1, 1, 1] """ - kinds = [] - sites = [] + if onduplicates not in ('keep', 'replace', 'warn', 'error'): + raise SpacegroupValueError( + 'Argument "onduplicates" must be one of: ' + '"keep", "replace", "warn" or "error".' + ) scaled = np.array(scaled_positions, ndmin=2) - symop = self.get_symop() - + rotations, translations = zip(*self.get_symop()) + rotations = np.array(rotations) + translations = np.array(translations) + + def find_orbit(point: np.ndarray) -> np.ndarray: + """Find crystallographic orbit of the given point.""" + candidates = ((rotations @ point) + translations % 1.0) % 1.0 + orbit = [candidates[0]] + for member in candidates[1:]: + diff = member - orbit + diff -= np.rint(diff) + if not np.any(np.all(np.abs(diff) < symprec, axis=1)): + orbit.append(member) + return np.array(orbit) + + orbits = [] for kind, pos in enumerate(scaled): - for rot, trans in symop: - site = np.mod(np.dot(rot, pos) + trans, 1.) - if not sites: - sites.append(site) - kinds.append(kind) - continue - t = site - sites - mask = np.all( - (abs(t) < symprec) | (abs(abs(t) - 1.0) < symprec), axis=1) - if np.any(mask): - inds = np.argwhere(mask).flatten() - for ind in inds: - # then we would just add the same thing again -> skip - if kinds[ind] == kind: - pass - elif onduplicates == 'keep': - pass - elif onduplicates == 'replace': - kinds[ind] = kind - elif onduplicates == 'warn': - warnings.warn('scaled_positions %d and %d ' - 'are equivalent' % - (kinds[ind], kind)) - elif onduplicates == 'error': - raise SpacegroupValueError( - 'scaled_positions %d and %d are equivalent' % - (kinds[ind], kind)) - else: - raise SpacegroupValueError( - 'Argument "onduplicates" must be one of: ' - '"keep", "replace", "warn" or "error".') - else: - sites.append(site) - kinds.append(kind) - - return np.array(sites), kinds + for i, (kind0, positions0) in enumerate(orbits): + diff = pos - positions0 + diff -= np.rint(diff) + if np.any(np.all(np.abs(diff) < symprec, axis=1)): + if onduplicates == 'keep': + pass + elif onduplicates == 'replace': + orbits[i] = (kind, positions0) + elif onduplicates == 'warn': + warnings.warn( + 'scaled_positions %d and %d are equivalent' % + (kind0, kind)) + elif onduplicates == 'error': + raise SpacegroupValueError( + 'scaled_positions %d and %d are equivalent' % + (kind0, kind)) + break + else: + orbits.append((kind, find_orbit(pos))) + + kinds = [] + sites = [] + for kind, orbit in orbits: + kinds.extend(len(orbit) * [kind]) + sites.append(orbit) + + return np.concatenate(sites, axis=0), kinds def symmetry_normalised_sites(self, scaled_positions, @@ -952,11 +962,28 @@ def spacegroup_from_data(no=None, return spg +@deprecated( + '`get_spacegroup` has been deprecated due to its misleading output. ' + 'The returned `Spacegroup` object has symmetry operations for a ' + 'standard setting regardress of the given `Atoms` object. ' + 'See https://gitlab.com/ase/ase/-/issues/1534 for details. ' + 'Please use `ase.spacegroup.symmetrize.check_symmetry` or `spglib` ' + 'directly to get the symmetry operations for the given `Atoms` object.' +) def get_spacegroup(atoms, symprec=1e-5): """Determine the spacegroup to which belongs the Atoms object. This requires spglib: https://atztogo.github.io/spglib/ . + .. warning:: + The returned ``Spacegroup`` object has symmetry operations for a + standard setting regardless of the given ``Atoms`` object. + See https://gitlab.com/ase/ase/-/issues/1534 for details. + + .. deprecated:: 3.24.0 + Please use ``ase.spacegroup.symmetrize.check_symmetry`` or ``spglib`` + directly to get the symmetry operations for the given ``Atoms`` object. + Parameters: atoms: Atoms object diff --git a/ase/spacegroup/symmetrize.py b/ase/spacegroup/symmetrize.py index 81d620e7da..b746f7198c 100644 --- a/ase/spacegroup/symmetrize.py +++ b/ase/spacegroup/symmetrize.py @@ -1,6 +1,7 @@ """ Provides utility functions for FixSymmetry class """ +from collections.abc import MutableMapping from typing import Optional import numpy as np @@ -10,11 +11,55 @@ from ase.utils import atoms_to_spglib_cell __all__ = ['refine_symmetry', 'check_symmetry'] +def spglib_get_symmetry_dataset(*args, **kwargs): + """Temporary compatibility adapter around spglib dataset. + + Return an object that allows attribute-based access + in line with recent spglib. This allows ASE code to not care about + older spglib versions. + """ + import spglib + dataset = spglib.get_symmetry_dataset(*args, **kwargs) + if dataset is None: + return None + if isinstance(dataset, dict): # spglib < 2.5.0 + return SpglibDatasetWrapper(dataset) + return dataset # spglib >= 2.5.0 + + +class SpglibDatasetWrapper(MutableMapping): + # Spglib 2.5.0 returns SpglibDataset with deprecated __getitem__. + # Spglib 2.4.0 and earlier return dict. + # + # We use this object to wrap dictionaries such that both types of access + # work correctly. + def __init__(self, spglib_dct): + self._spglib_dct = spglib_dct + + def __getattr__(self, attr): + return self[attr] + + def __getitem__(self, key): + return self._spglib_dct[key] + + def __len__(self): + return len(self._spglib_dct) + + def __iter__(self): + return iter(self._spglib_dct) + + def __setitem__(self, key, value): + self._spglib_dct[key] = value + + def __delitem__(self, item): + del self._spglib_dct[item] + + def print_symmetry(symprec, dataset): print("ase.spacegroup.symmetrize: prec", symprec, - "got symmetry group number", dataset["number"], - ", international (Hermann-Mauguin)", dataset["international"], - ", Hall ", dataset["hall"]) + "got symmetry group number", dataset.number, + ", international (Hermann-Mauguin)", dataset.international, + ", Hall ", dataset.hall) def refine_symmetry(atoms, symprec=0.01, verbose=False): @@ -69,11 +114,11 @@ def get_symmetrized_atoms(atoms, original_dataset = _check_and_symmetrize_cell(atoms, symprec=symprec) intermediate_dataset = _check_and_symmetrize_positions( atoms, symprec=symprec) - if intermediate_dataset['number'] != original_dataset['number']: + if intermediate_dataset.number != original_dataset.number: raise IntermediateDatasetError() final_symprec = final_symprec or symprec final_dataset = check_symmetry(atoms, symprec=final_symprec) - assert final_dataset['number'] == original_dataset['number'] + assert final_dataset.number == original_dataset.number return atoms, final_dataset @@ -86,9 +131,9 @@ def _check_and_symmetrize_cell(atoms, **kwargs): def _symmetrize_cell(atoms, dataset): # set actual cell to symmetrized cell vectors by copying # transformed and rotated standard cell - std_cell = dataset['std_lattice'] - trans_std_cell = dataset['transformation_matrix'].T @ std_cell - rot_trans_std_cell = trans_std_cell @ dataset['std_rotation_matrix'] + std_cell = dataset.std_lattice + trans_std_cell = dataset.transformation_matrix.T @ std_cell + rot_trans_std_cell = trans_std_cell @ dataset.std_rotation_matrix atoms.set_cell(rot_trans_std_cell, True) @@ -106,22 +151,22 @@ def _symmetrize_positions(atoms, dataset, primitive_spglib_cell): prim_cell, prim_scaled_pos, prim_types = primitive_spglib_cell # calculate offset between standard cell and actual cell - std_cell = dataset['std_lattice'] - rot_std_cell = std_cell @ dataset['std_rotation_matrix'] - rot_std_pos = dataset['std_positions'] @ rot_std_cell + std_cell = dataset.std_lattice + rot_std_cell = std_cell @ dataset.std_rotation_matrix + rot_std_pos = dataset.std_positions @ rot_std_cell pos = atoms.get_positions() - dp0 = (pos[list(dataset['mapping_to_primitive']).index(0)] - rot_std_pos[ - list(dataset['std_mapping_to_primitive']).index(0)]) + dp0 = (pos[list(dataset.mapping_to_primitive).index(0)] - rot_std_pos[ + list(dataset.std_mapping_to_primitive).index(0)]) # create aligned set of standard cell positions to figure out mapping - rot_prim_cell = prim_cell @ dataset['std_rotation_matrix'] + rot_prim_cell = prim_cell @ dataset.std_rotation_matrix inv_rot_prim_cell = np.linalg.inv(rot_prim_cell) aligned_std_pos = rot_std_pos + dp0 # find ideal positions from position of corresponding std cell atom + # integer_vec . primitive cell vectors - mapping_to_primitive = list(dataset['mapping_to_primitive']) - std_mapping_to_primitive = list(dataset['std_mapping_to_primitive']) + mapping_to_primitive = list(dataset.mapping_to_primitive) + std_mapping_to_primitive = list(dataset.std_mapping_to_primitive) pos = atoms.get_positions() for i_at in range(len(atoms)): std_i_at = std_mapping_to_primitive.index(mapping_to_primitive[i_at]) @@ -137,8 +182,7 @@ def check_symmetry(atoms, symprec=1.0e-6, verbose=False): Prints a summary and returns result of `spglib.get_symmetry_dataset()` """ - import spglib - dataset = spglib.get_symmetry_dataset(atoms_to_spglib_cell(atoms), + dataset = spglib_get_symmetry_dataset(atoms_to_spglib_cell(atoms), symprec=symprec) if verbose: print_symmetry(symprec, dataset) @@ -149,8 +193,8 @@ def is_subgroup(sup_data, sub_data, tol=1e-10): """ Test if spglib dataset `sub_data` is a subgroup of dataset `sup_data` """ - for rot1, trns1 in zip(sub_data['rotations'], sub_data['translations']): - for rot2, trns2 in zip(sup_data['rotations'], sup_data['translations']): + for rot1, trns1 in zip(sub_data.rotations, sub_data.translations): + for rot2, trns2 in zip(sup_data.rotations, sup_data.translations): if np.all(rot1 == rot2) and np.linalg.norm(trns1 - trns2) < tol: break else: @@ -164,14 +208,12 @@ def prep_symmetry(atoms, symprec=1.0e-6, verbose=False): Returns a tuple `(rotations, translations, symm_map)` """ - import spglib - - dataset = spglib.get_symmetry_dataset(atoms_to_spglib_cell(atoms), + dataset = spglib_get_symmetry_dataset(atoms_to_spglib_cell(atoms), symprec=symprec) if verbose: print_symmetry(symprec, dataset) - rotations = dataset['rotations'].copy() - translations = dataset['translations'].copy() + rotations = dataset.rotations.copy() + translations = dataset.translations.copy() symm_map = [] scaled_pos = atoms.get_scaled_positions() for (rot, trans) in zip(rotations, translations): diff --git a/ase/spacegroup/utils.py b/ase/spacegroup/utils.py index 521eac4ec5..cb158d6f32 100644 --- a/ase/spacegroup/utils.py +++ b/ase/spacegroup/utils.py @@ -167,10 +167,11 @@ def _get_reduced_indices(atoms: Atoms, tol: float = 1e-5) -> List[int]: :param atoms: ase Atoms object to reduce :param tol: ``float``, numeric tolerance for positional comparisons """ - import spglib + from ase.spacegroup.symmetrize import spglib_get_symmetry_dataset # Create input for spglib spglib_cell = (atoms.get_cell(), atoms.get_scaled_positions(), atoms.numbers) - symmetry_data = spglib.get_symmetry_dataset(spglib_cell, symprec=tol) - return list(set(symmetry_data['equivalent_atoms'])) + symmetry_data = spglib_get_symmetry_dataset(spglib_cell, + symprec=tol) + return list(set(symmetry_data.equivalent_atoms)) diff --git a/ase/spectrum/band_structure.py b/ase/spectrum/band_structure.py index 31b59cfef3..63b52be784 100644 --- a/ase/spectrum/band_structure.py +++ b/ase/spectrum/band_structure.py @@ -159,90 +159,138 @@ class BandStructurePlot: self.bs = bs self.ax = None self.xcoords = None - self.show_legend = False - def plot(self, ax=None, spin=None, emin=-10, emax=5, filename=None, - show=False, ylabel=None, colors=None, label=None, - spin_labels=['spin up', 'spin down'], loc=None, **plotkwargs): + def plot(self, ax=None, emin=-10, emax=5, filename=None, + show=False, ylabel=None, colors=None, point_colors=None, + label=None, loc=None, + cmap=None, cmin=-1.0, cmax=1.0, sortcolors=False, + colorbar=True, clabel='$s_z$', cax=None, + **plotkwargs): """Plot band-structure. - spin: int or None - Spin channel. Default behaviour is to plot both spin up and down - for spin-polarized calculations. - emin,emax: float - Maximum energy above reference. - filename: str - Write image to a file. ax: Axes MatPlotLib Axes object. Will be created if not supplied. + emin, emax: float + Minimum and maximum energy above reference. + filename: str + If given, write image to a file. show: bool - Show the image. + Show the image (not needed in notebooks). + ylabel: str + The label along the y-axis. Defaults to 'energies [eV]' + colors: sequence of str + A sequence of one or two color specifications, depending on + whether there is spin. + Default: green if no spin, yellow and blue if spin is present. + point_colors: ndarray + An array of numbers of the shape (nspins, n_kpts, nbands) which + are then mapped onto colors by the colormap (see ``cmap``). + ``colors`` and ``point_colors`` are mutually exclusive + label: str or list of str + Label for the curves on the legend. A string if one spin is + present, a list of two strings if two spins are present. + Default: If no spin is given, no legend is made; if spin is + present default labels 'spin up' and 'spin down' are used, but + can be suppressed by setting ``label=False``. + loc: str + Location of the legend. + + If ``point_colors`` is given, the following arguments can be specified. + + cmap: + Only used if colors is an array of numbers. A matplotlib + colormap object, or a string naming a standard colormap. + Default: The matplotlib default, typically 'viridis'. + cmin, cmax: float + Minimal and maximal values used for colormap translation. + Default: -1.0 and 1.0 + colorbar: bool + Whether to make a colorbar. + clabel: str + Label for the colorbar (default 's_z', set to None to suppress. + cax: Axes + Axes object used for plotting colorbar. Default: split off a + new one. + sortcolors (bool or callable): + Sort points so highest color values are in front. If a callable is + given, then it is called on the color values to determine the sort + order. + + Any additional keyword arguments are passed directly to matplotlib's + plot() or scatter() methods, depending on whether point_colors is + given. """ + import matplotlib.pyplot as plt + + if colors is not None and point_colors is not None: + raise ValueError("Don't give both 'color' and 'point_color'") if self.ax is None: ax = self.prepare_plot(ax, emin, emax, ylabel) - if spin is None: - e_skn = self.bs.energies - else: - e_skn = self.bs.energies[spin, np.newaxis] - - if colors is None: - if len(e_skn) == 1: - colors = 'g' - else: - colors = 'yb' - + e_skn = self.bs.energies nspins = len(e_skn) - for spin, e_kn in enumerate(e_skn): - color = colors[spin] - kwargs = dict(color=color) - kwargs.update(plotkwargs) - if nspins == 2: - if label: - lbl = label + ' ' + spin_labels[spin] + if point_colors is None: + # Normal band structure plot + if colors is None: + if len(e_skn) == 1: + colors = 'g' else: - lbl = spin_labels[spin] - else: - lbl = label - ax.plot(self.xcoords, e_kn[:, 0], label=lbl, **kwargs) - - for e_k in e_kn.T[1:]: - ax.plot(self.xcoords, e_k, **kwargs) - - self.show_legend = label is not None or nspins == 2 - self.finish_plot(filename, show, loc) - - return ax - - def plot_with_colors(self, ax=None, emin=-10, emax=5, filename=None, - show=False, energies=None, colors=None, - ylabel=None, clabel='$s_z$', cmin=-1.0, cmax=1.0, - sortcolors=False, loc=None, s=2): - """Plot band-structure with colors.""" - - import matplotlib.pyplot as plt - - if self.ax is None: - ax = self.prepare_plot(ax, emin, emax, ylabel) + colors = 'yb' + elif (len(colors) != nspins): + raise ValueError( + "colors should be a sequence of {nspin} colors" + ) + + # Default values for label + if label is None and nspins == 2: + label = ['spin up', 'spin down'] + + if label: + if nspins == 1 and isinstance(label, str): + label = [label] + elif len(label) != nspins: + raise ValueError( + f'label should be a list of {nspins} strings' + ) + + for spin, e_kn in enumerate(e_skn): + kwargs = dict(color=colors[spin]) + kwargs.update(plotkwargs) + lbl = None # Retain lbl=None if label=False + if label: + lbl = label[spin] + ax.plot(self.xcoords, e_kn[:, 0], label=lbl, **kwargs) - shape = energies.shape - xcoords = np.vstack([self.xcoords] * shape[1]) - if sortcolors: - perm = colors.argsort(axis=None) - energies = energies.ravel()[perm].reshape(shape) - colors = colors.ravel()[perm].reshape(shape) - xcoords = xcoords.ravel()[perm].reshape(shape) + for e_k in e_kn.T[1:]: + ax.plot(self.xcoords, e_k, **kwargs) + show_legend = label is not None or nspins == 2 - for e_k, c_k, x_k in zip(energies, colors, xcoords): - things = ax.scatter(x_k, e_k, c=c_k, s=s, - vmin=cmin, vmax=cmax) + else: + # A color per datapoint. + kwargs = dict(vmin=cmin, vmax=cmax, cmap=cmap, s=1) + kwargs.update(plotkwargs) + shape = e_skn.shape + xcoords = np.zeros(shape) + xcoords += self.xcoords[np.newaxis, :, np.newaxis] + if sortcolors: + if callable(sortcolors): + perm = sortcolors(point_colors).argsort(axis=None) + else: + perm = point_colors.argsort(axis=None) + e_skn = e_skn.ravel()[perm].reshape(shape) + point_colors = point_colors.ravel()[perm].reshape(shape) + xcoords = xcoords.ravel()[perm].reshape(shape) - cbar = plt.colorbar(things) - cbar.set_label(clabel) + things = ax.scatter(xcoords, e_skn, c=point_colors, **kwargs) + if colorbar: + cbar = plt.colorbar(things, cax=cax) + if clabel: + cbar.set_label(clabel) + show_legend = False - self.finish_plot(filename, show, loc) + self.finish_plot(filename, show, loc, show_legend) return ax @@ -284,10 +332,10 @@ class BandStructurePlot: self.ax = ax return ax - def finish_plot(self, filename, show, loc): + def finish_plot(self, filename, show, loc, show_legend=False): import matplotlib.pyplot as plt - if self.show_legend: + if show_legend: leg = plt.legend(loc=loc) leg.get_frame().set_alpha(1) diff --git a/ase/spectrum/doscollection.py b/ase/spectrum/doscollection.py index ffbba272bd..b590524367 100644 --- a/ase/spectrum/doscollection.py +++ b/ase/spectrum/doscollection.py @@ -13,14 +13,11 @@ from typing import ( ) import numpy as np +from matplotlib.axes import Axes from ase.spectrum.dosdata import DOSData, Floats, GridDOSData, Info, RawDOSData from ase.utils.plotting import SimplePlottingAxes -# This import is for the benefit of type-checking / mypy -if False: - import matplotlib.axes - class DOSCollection(collections.abc.Sequence): """Base class for a collection of DOSData objects""" @@ -62,10 +59,10 @@ class DOSCollection(collections.abc.Sequence): xmax: float = None, width: float = 0.1, smearing: str = 'Gauss', - ax: 'matplotlib.axes.Axes' = None, + ax: Axes = None, show: bool = False, filename: str = None, - mplargs: dict = None) -> 'matplotlib.axes.Axes': + mplargs: dict = None) -> Axes: """Simple plot of collected DOS data, resampled onto a grid If the special key 'label' is present in self.info, this will be set @@ -545,10 +542,10 @@ class GridDOSCollection(DOSCollection): xmax: float = None, width: float = None, smearing: str = 'Gauss', - ax: 'matplotlib.axes.Axes' = None, + ax: Axes = None, show: bool = False, filename: str = None, - mplargs: dict = None) -> 'matplotlib.axes.Axes': + mplargs: dict = None) -> Axes: """Simple plot of collected DOS data, resampled onto a grid If the special key 'label' is present in self.info, this will be set @@ -598,7 +595,7 @@ class GridDOSCollection(DOSCollection): return ax @staticmethod - def _plot_broadened(ax: 'matplotlib.axes.Axes', + def _plot_broadened(ax: Axes, energies: Floats, all_y: np.ndarray, all_labels: Sequence[str], diff --git a/ase/spectrum/dosdata.py b/ase/spectrum/dosdata.py index 819e4fd9b5..d91acfad11 100644 --- a/ase/spectrum/dosdata.py +++ b/ase/spectrum/dosdata.py @@ -5,13 +5,10 @@ from abc import ABCMeta, abstractmethod from typing import Any, Dict, Sequence, Tuple, TypeVar, Union import numpy as np +from matplotlib.axes import Axes from ase.utils.plotting import SimplePlottingAxes -# This import is for the benefit of type-checking / mypy -if False: - import matplotlib.axes - # For now we will be strict about Info and say it has to be str->str. Perhaps # later we will allow other types that have reliable comparison operations. Info = Dict[str, str] @@ -150,10 +147,10 @@ class DOSData(metaclass=ABCMeta): xmax: float = None, width: float = 0.1, smearing: str = 'Gauss', - ax: 'matplotlib.axes.Axes' = None, + ax: Axes = None, show: bool = False, filename: str = None, - mplargs: dict = None) -> 'matplotlib.axes.Axes': + mplargs: dict = None) -> Axes: """Simple 1-D plot of DOS data, resampled onto a grid If the special key 'label' is present in self.info, this will be set @@ -288,10 +285,10 @@ class RawDOSData(GeneralDOSData): return new_object def plot_deltas(self, - ax: 'matplotlib.axes.Axes' = None, + ax: Axes = None, show: bool = False, filename: str = None, - mplargs: dict = None) -> 'matplotlib.axes.Axes': + mplargs: dict = None) -> Axes: """Simple plot of sparse DOS data as a set of delta functions Items at the same x-value can overlap and will not be summed together @@ -434,10 +431,10 @@ class GridDOSData(GeneralDOSData): xmax: float = None, width: float = None, smearing: str = 'Gauss', - ax: 'matplotlib.axes.Axes' = None, + ax: Axes = None, show: bool = False, filename: str = None, - mplargs: dict = None) -> 'matplotlib.axes.Axes': + mplargs: dict = None) -> Axes: """Simple 1-D plot of DOS data Data will be resampled onto a grid with `npts` points unless `npts` is diff --git a/ase/test/bandstructure/test_bandstructure.py b/ase/test/bandstructure/test_bandstructure.py index f4522d5382..3d9aa38d40 100644 --- a/ase/test/bandstructure/test_bandstructure.py +++ b/ase/test/bandstructure/test_bandstructure.py @@ -23,6 +23,9 @@ def test_bandstructure(testdir, plt): print(labels) assert ''.join(labels) == 'GXWKGLUWLKUX' bs.plot(emax=10, filename='bs.png') + cols = np.linspace(-1.0, 1.0, bs.energies.size) + cols.shape = bs.energies.shape + bs.plot(emax=10, point_colors=cols, filename='bs2.png') @pytest.fixture() diff --git a/ase/test/build_/test_supercells.py b/ase/test/build_/test_supercells.py index ff4410dc96..c14645c111 100644 --- a/ase/test/build_/test_supercells.py +++ b/ase/test/build_/test_supercells.py @@ -101,63 +101,81 @@ def test_make_supercell_vs_repeat(prim, rep): assert all(at1.symbols == at2.symbols) -def test_get_deviation_from_optimal_cell_shape(): - # also tested via the docs data examples - # test perfect scores for SC, where cell vector permutation or magnitude - # do not matter: - cell = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) - for perm, factor in itertools.product( - itertools.permutations(range(3)), range(1, 9) - ): +@pytest.mark.parametrize( + 'cell, target_shape', ( + ([[1, 0, 0], [0, 1, 0], [0, 0, 1]], 'sc'), + ([[0, 1, 1], [1, 0, 1], [1, 1, 0]], 'fcc'), + ) +) +def test_cell_metric_ideal(target_shape, cell): + """Test cell with the ideal shape. + + Test if `get_deviation_from_optimal_cell_shape` returns perfect scores + (0.0) for the ideal cells. + Test also cell vectors with permutatation and elongation. + """ + cell = np.asarray(cell) + indices_permuted = itertools.permutations(range(3)) + elongations = range(1, 4) + for perm, factor in itertools.product(indices_permuted, elongations): permuted_cell = [cell[i] * factor for i in perm] - assert np.isclose( - get_deviation_from_optimal_cell_shape( - permuted_cell, target_shape="sc" - ), 0.0 + cell_metric = get_deviation_from_optimal_cell_shape( + permuted_cell, + target_shape=target_shape, ) + assert np.isclose(cell_metric, 0.0) - # likewise for FCC: - cell = np.array([[1, 1, 0], [0, 1, 1], [1, 0, 1]]) - for perm, factor in itertools.product(itertools.permutations(range(3)), - range(1, 9)): - permuted_cell = [cell[i] * factor for i in perm] - assert np.isclose( - get_deviation_from_optimal_cell_shape( - permuted_cell, target_shape="fcc" - ), - 0.0, - ) - # spot check some cases: - cell = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 2]]) - assert np.isclose(get_deviation_from_optimal_cell_shape(cell, "sc"), - 0.6558650332) - - # fcc - cell = np.array([[0, 1, 1], [1, 0, 1], [2, 2, 0]]) - assert np.isclose(get_deviation_from_optimal_cell_shape(cell, "fcc"), - 0.6558650332) - - # negative determinant - cell = np.array([[-1, 0, 0], [0, -1, 0], [0, 0, -1]]) - assert np.isclose(get_deviation_from_optimal_cell_shape(cell, "sc"), 0.0) - - -def test_find_optimal_cell_shape(): - # also tested via the docs data examples - cell = np.diag([1.0, 2.0, 4.0]) - target_size = 8 - target_shape = "sc" - result = find_optimal_cell_shape(cell, target_size, target_shape) - assert np.isclose( - get_deviation_from_optimal_cell_shape(np.dot(result, cell), "sc"), 0.0 +@pytest.mark.parametrize( + 'cell, target_shape', ( + ([[1, 0, 0], [0, 1, 0], [0, 0, 2]], 'sc'), + ([[0, 1, 1], [1, 0, 1], [2, 2, 0]], 'fcc'), ) - assert np.allclose(np.linalg.norm(np.dot(result, cell), axis=1), 4) +) +def test_cell_metric_twice_larger_lattice_vector(cell, target_shape): + """Test cell with a twice larger lattice vector than the others. + + Test if `get_deviation_from_optimal_cell_shape` gives a correct value for + the cells that have a lattice vector twice longer than the others. + """ + # sqrt((1 - cbrt(2))**2 + (1 - cbrt(2))**2 + (2 - cbrt(2))**2) / cbrt(2) + cell_metric_ref = 0.6558650332 + cell_metric = get_deviation_from_optimal_cell_shape(cell, target_shape) + assert np.isclose(cell_metric, cell_metric_ref) - # docs examples: - conf = bulk("Au") # fcc - P1 = find_optimal_cell_shape(conf.cell, 32, "sc") - assert np.allclose(P1, np.array([[-2, 2, 2], [2, -2, 2], [2, 2, -2]])) - P1 = find_optimal_cell_shape(conf.cell, 495, "sc") - assert np.allclose(P1, np.array([[-6, 5, 5], [5, -6, 5], [5, 5, -5]])) +@pytest.mark.parametrize( + 'cell, target_shape', ( + ([[-1, 0, 0], [0, -1, 0], [0, 0, -1]], 'sc'), + ([[0, -1, -1], [-1, 0, -1], [-1, -1, 0]], 'fcc'), + ) +) +def test_cell_metric_negative_determinant(cell, target_shape): + """Test cell with negative determinant. + + Test if `get_deviation_from_optimal_cell_shape` works for the cells with + negative determinants. + """ + cell_metric = get_deviation_from_optimal_cell_shape(cell, target_shape) + assert np.isclose(cell_metric, 0.0) + + +@pytest.mark.parametrize('cell, target_shape, target_size, ref_lengths', [ + (np.diag([1.0, 2.0, 4.0]), 'sc', 8, 4.0), + ([[1, 0, 0], [0, 1, 0], [0, 0, 1]], 'fcc', 2, np.sqrt(2.0)), + ([[0, 1, 1], [1, 0, 1], [1, 1, 0]], 'sc', 4, 2.0), +]) +def test_find_optimal_cell_shape( + cell, target_shape, target_size, ref_lengths): + """Test `find_optimal_cell_shape`. + + We test from sc to sc; from sc to fcc; and from fcc to sc.""" + supercell_matrix = find_optimal_cell_shape(cell, target_size, target_shape, + lower_limit=-1, upper_limit=1) + cell_metric = get_deviation_from_optimal_cell_shape( + supercell_matrix @ cell, + target_shape, + ) + assert np.isclose(cell_metric, 0.0) + cell_lengths = np.linalg.norm(np.dot(supercell_matrix, cell), axis=1) + assert np.allclose(cell_lengths, ref_lengths) diff --git a/ase/test/calculator/amber/test_amber.py b/ase/test/calculator/amber/test_amber.py index 9b27faa287..ea8ac19062 100644 --- a/ase/test/calculator/amber/test_amber.py +++ b/ase/test/calculator/amber/test_amber.py @@ -1,7 +1,10 @@ import subprocess +import numpy as np + from ase import Atoms from ase.calculators.amber import Amber +from ase.io import write def test_amber(factories): @@ -24,32 +27,41 @@ def test_amber(factories): END """) + atoms = Atoms('OH2OH2', + [[-0.956, -0.121, 0], + [-1.308, 0.770, 0], + [0.000, 0.000, 0], + [3.903, 0.000, 0], + [4.215, -0.497, -0.759], + [4.215, -0.497, 0.759]]) + atoms.arrays['residuenames'] = ['WAT'] * 6 + atoms.arrays['residuenumbers'] = [1] * 3 + [2] * 3 + atoms.arrays['atomtypes'] = ['O', 'H1', 'H2'] * 2 + write('2h2o.pdb', atoms) + with open('tleap.in', 'w') as outfile: outfile.write("""\ source leaprc.protein.ff14SB source leaprc.gaff source leaprc.water.tip3p mol = loadpdb 2h2o.pdb - saveamberparm mol 2h2o.top h2o.inpcrd + saveamberparm mol 2h2o.top 2h2o.inpcrd quit """) subprocess.call('tleap -f tleap.in'.split()) - atoms = Atoms('OH2OH2', - [[-0.956, -0.121, 0], - [-1.308, 0.770, 0], - [0.000, 0.000, 0], - [3.903, 0.000, 0], - [4.215, -0.497, -0.759], - [4.215, -0.497, 0.759]]) - calc = Amber(amber_exe='sander -O ', infile='mm.in', outfile='mm.out', topologyfile='2h2o.top', incoordfile='mm.crd') calc.write_coordinates(atoms, 'mm.crd') + atoms_check = atoms.copy() + calc.read_coordinates(atoms_check, 'mm.crd') + assert np.allclose(atoms_check.positions, atoms.positions) + assert np.allclose(atoms_check.get_velocities(), atoms.get_velocities()) + atoms.calc = calc e = atoms.get_potential_energy() diff --git a/ase/test/calculator/nwchem/test_nwchem_h3o2m.py b/ase/test/calculator/nwchem/test_nwchem_h3o2m.py index be4f8754d8..6cd38524e8 100644 --- a/ase/test/calculator/nwchem/test_nwchem_h3o2m.py +++ b/ase/test/calculator/nwchem/test_nwchem_h3o2m.py @@ -6,7 +6,6 @@ from ase import Atoms from ase.constraints import FixAtoms from ase.mep import NEB from ase.optimize import BFGS, QuasiNewton -from ase.visualize import view @pytest.mark.calculator('nwchem') @@ -23,8 +22,6 @@ def test_h3o2m(factory): (0., 0., doh), (0., 0., doo), (sin(angle) * doht, 0., doo - cos(angle) * doht)]) - if 0: - view(initial) final = Atoms( 'HOHOH', @@ -33,8 +30,6 @@ def test_h3o2m(factory): (0., 0., doo - doh), (0., 0., doo), (sin(angle) * doht, 0., doo - cos(angle) * doht)]) - if 0: - view(final) # Make band: images = [initial.copy()] diff --git a/ase/test/calculator/octopus/test_big.py b/ase/test/calculator/octopus/test_big.py index 7079a5be6a..27f56d3bf5 100644 --- a/ase/test/calculator/octopus/test_big.py +++ b/ase/test/calculator/octopus/test_big.py @@ -1,7 +1,6 @@ -import numpy as np import pytest -from ase.build import bulk, graphene_nanoribbon +from ase.build import bulk from ase.collections import g2 @@ -16,27 +15,6 @@ def calculate(factory, system, **kwargs): calc = pytest.mark.calculator -@calc('octopus', Spacing='0.25 * angstrom') -@pytest.mark.xfail() -def test_h2o(factory): - calc = calculate(factory, - g2['H2O'], - OutputFormat='xcrysden', - SCFCalculateDipole=True) - dipole = calc.get_dipole_moment() - E = calc.get_potential_energy() - - print('dipole', dipole) - print('energy', E) - - # XXX What's with the dipole not being correct? - # XXX Investigate - - assert pytest.approx(dipole, abs=0.02) == [0, 0, -0.37] - dipole_err = np.abs(dipole - [0., 0., -0.37]).max() - assert dipole_err < 0.02, dipole_err - - @calc('octopus', Spacing='0.2 * angstrom') def test_o2(factory): atoms = g2['O2'] @@ -61,36 +39,3 @@ def test_si(factory): Spacing='0.45 * Angstrom') eF = calc.get_fermi_level() print('eF', eF) - - -if 0: # This calculation does not run will in Octopus - # We will do the "toothless" spin-polarised Si instead. - calc = calculate('Fe', - bulk('Fe', orthorhombic=True), - KPointsGrid=[[4, 4, 4]], - KPointsUseSymmetries=True, - ExtraStates=4, - Spacing='0.15 * Angstrom', - SmearingFunction='fermi_dirac', - Smearing='0.1 * eV', - PseudoPotentialSet='sg15', - ExperimentalFeatures=True, - SpinComponents='spin_polarized') - eF = calc.get_fermi_level() - assert abs(eF - 5.33) < 1e-1 - # XXXX octopus does not get magnetic state? - print('eF', eF) - -if 0: - # Experimental feature: mixed periodicity. Let us not do this for now... - graphene = graphene_nanoribbon(2, 2, sheet=True) - graphene.positions = graphene.positions[:, [0, 2, 1]] - graphene.pbc = [1, 1, 0] # from 1, 0, 1 - calc = calculate('graphene', - graphene, - KPointsGrid=[[2, 1, 2]], - KPointsUseSymmetries=True, - ExperimentalFeatures=True, - ExtraStates=4, - SmearingFunction='fermi_dirac', - Smearing='0.1 * eV') diff --git a/ase/test/calculator/siesta/test_siesta_version.py b/ase/test/calculator/siesta/test_siesta_version.py index ab09ff6bfc..5949986928 100644 --- a/ase/test/calculator/siesta/test_siesta_version.py +++ b/ase/test/calculator/siesta/test_siesta_version.py @@ -24,3 +24,4 @@ def test_siesta_version(): test('Siesta Version: siesta-4.0--500', 'siesta-4.0--500') test('Siesta Version : v4.0.2', 'v4.0.2') test('Siesta Version: siesta-4.1--736', 'siesta-4.1--736') + test(' Version : 5.0.0', '5.0.0') diff --git a/ase/test/calculator/siesta/test_write_input.py b/ase/test/calculator/siesta/test_write_input.py index 56447101a3..39d35e83b4 100644 --- a/ase/test/calculator/siesta/test_write_input.py +++ b/ase/test/calculator/siesta/test_write_input.py @@ -98,24 +98,28 @@ def test_species(factory, atoms_ch4): siesta = factory.calc( species=[ + Species(symbol='C', tag=-1), Species( symbol='H', tag=1, - basis_set='SZ')]) + basis_set='SZ', + pseudopotential='somepseudo')]) + species, numbers = siesta.species(atoms_ch4) - assert all(numbers == np.array([1, 2, 2, 3, 2])) + assert all(numbers == np.array([1, 2, 2, 4, 2])) siesta = factory.calc(label='test_label', species=species) siesta.write_input(atoms_ch4, properties=['energy']) with open('test_label.fdf', encoding='utf-8') as fd: lines = fd.readlines() + lines = [line.split() for line in lines] assert ['1', '6', 'C.lda.1'] in lines assert ['2', '1', 'H.lda.2'] in lines - assert ['3', '1', 'H.lda.3'] in lines + assert ['4', '1', 'H.4', 'H.4.psml'] in lines assert ['C.lda.1', 'DZP'] in lines assert ['H.lda.2', 'DZP'] in lines - assert ['H.lda.3', 'SZ'] in lines + assert ['H.4', 'SZ'] in lines @pytest.mark.calculator_lite() diff --git a/ase/test/calculator/vasp/test_chgcar.py b/ase/test/calculator/vasp/test_chgcar.py new file mode 100644 index 0000000000..3340893932 --- /dev/null +++ b/ase/test/calculator/vasp/test_chgcar.py @@ -0,0 +1,16 @@ +"""Tests for CHG/CHGCAR.""" +import numpy as np +import pytest + +from ase.build import bulk +from ase.calculators.calculator import compare_atoms +from ase.calculators.vasp import VaspChargeDensity + + +def test_chgcar(datadir): + """Test if a CHG/CHGCAR file can be parsed correctly.""" + charge_density = VaspChargeDensity(datadir / 'vasp/Li/CHG') + atoms = charge_density.atoms[0] + chg = charge_density.chg[0] + assert not compare_atoms(atoms, bulk('Li', a=3.49)) + assert np.mean(chg) * atoms.get_volume() == pytest.approx(1.0, rel=1e-3) diff --git a/ase/test/constraints/test_fix_symmetry.py b/ase/test/constraints/test_fix_symmetry.py index c6109c3553..bc20af9ce0 100644 --- a/ase/test/constraints/test_fix_symmetry.py +++ b/ase/test/constraints/test_fix_symmetry.py @@ -110,45 +110,41 @@ def filter(request): @pytest.mark.filterwarnings('ignore:ASE Atoms-like input is deprecated') @pytest.mark.filterwarnings('ignore:Armijo linesearch failed') def test_no_symmetrization(filter): - print("NO SYM") at_init, at_rot = setup_cell() at_unsym = at_init.copy() di, df = symmetrized_optimisation(at_unsym, filter) - assert di["number"] == 229 and not is_subgroup(sub_data=di, sup_data=df) + assert di.number == 229 and not is_subgroup(sub_data=di, sup_data=df) @pytest.mark.filterwarnings('ignore:ASE Atoms-like input is deprecated') @pytest.mark.filterwarnings('ignore:Armijo linesearch failed') def test_no_sym_rotated(filter): - print("NO SYM ROT") at_init, at_rot = setup_cell() at_unsym_rot = at_rot.copy() di, df = symmetrized_optimisation(at_unsym_rot, filter) - assert di["number"] == 229 and not is_subgroup(sub_data=di, sup_data=df) + assert di.number == 229 and not is_subgroup(sub_data=di, sup_data=df) @pytest.mark.filterwarnings('ignore:ASE Atoms-like input is deprecated') @pytest.mark.filterwarnings('ignore:Armijo linesearch failed') def test_sym_adj_cell(filter): - print("SYM POS+CELL") at_init, at_rot = setup_cell() at_sym_3 = at_init.copy() at_sym_3.set_constraint( FixSymmetry(at_sym_3, adjust_positions=True, adjust_cell=True)) di, df = symmetrized_optimisation(at_sym_3, filter) - assert di["number"] == 229 and is_subgroup(sub_data=di, sup_data=df) + assert di.number == 229 and is_subgroup(sub_data=di, sup_data=df) @pytest.mark.filterwarnings('ignore:ASE Atoms-like input is deprecated') @pytest.mark.filterwarnings('ignore:Armijo linesearch failed') def test_sym_rot_adj_cell(filter): - print("SYM POS+CELL ROT") at_init, at_rot = setup_cell() at_sym_3_rot = at_init.copy() at_sym_3_rot.set_constraint( FixSymmetry(at_sym_3_rot, adjust_positions=True, adjust_cell=True)) di, df = symmetrized_optimisation(at_sym_3_rot, filter) - assert di["number"] == 229 and is_subgroup(sub_data=di, sup_data=df) + assert di.number == 229 and is_subgroup(sub_data=di, sup_data=df) @pytest.mark.filterwarnings('ignore:ASE Atoms-like input is deprecated') diff --git a/ase/test/factories.py b/ase/test/factories.py index 9048b1c38c..d312409c99 100644 --- a/ase/test/factories.py +++ b/ase/test/factories.py @@ -272,7 +272,7 @@ class EspressoFactory: @lazyproperty def pseudopotentials(self): pseudopotentials = {} - for path in self.profile.pseudo_dir.glob('*.UPF'): + for path in Path(self.profile.pseudo_dir).glob('*.UPF'): fname = path.name # Names are e.g. si_lda_v1.uspp.F.UPF symbol = fname.split('_', 1)[0].capitalize() diff --git a/ase/test/fio/test_octopus.py b/ase/test/fio/octopus/test_input.py similarity index 100% rename from ase/test/fio/test_octopus.py rename to ase/test/fio/octopus/test_input.py diff --git a/ase/test/fio/octopus/test_output.py b/ase/test/fio/octopus/test_output.py new file mode 100644 index 0000000000..b4a938257a --- /dev/null +++ b/ase/test/fio/octopus/test_output.py @@ -0,0 +1,105 @@ +"""Tests for Octopus outputs.""" +from typing import Any, Dict + +import numpy as np +import pytest + +from ase.io.octopus.output import read_eigenvalues_file, read_static_info +from ase.units import Bohr, Debye, Hartree + + +@pytest.fixture(name='info_iron') +def fixture_info_iron(datadir) -> Dict[str, Any]: + """`info` of 'periodic_systems/25-Fe_polarized.01-gs'""" + file = datadir / 'octopus/periodic_systems_25-Fe_polarized.01-gs_info' + with file.open(encoding='utf-8') as fd: + return read_static_info(fd) + + +def test_eigenvalues(datadir): + """Test if the eigenvalues are parsed correctly from `eigenvalues`.""" + file = ( + datadir + / 'octopus/periodic_systems_03-sodium_chain.02-unocc_eigenvalues' + ) + with file.open(encoding='utf-8') as fd: + kptsarr, eigsarr, occsarr = read_eigenvalues_file(fd) + kptsarr_ref = [ + [0.0, 0.0, 0.0], + [0.1, 0.0, 0.0], + [0.2, 0.0, 0.0], + [0.3, 0.0, 0.0], + [0.4, 0.0, 0.0], + [0.5, 0.0, 0.0], + ] + eigsarr_ref = [ + [[-3.647610, -1.236399]], + [[-3.551626, -1.144852]], + [[-3.264556, -0.870333]], + [[-2.789110, -0.413463]], + [[-2.130396, -0.280652]], + [[-1.367358, -1.210151]], + ] + occsarr_ref = [ + [[2.0, 0.0]], + [[2.0, 0.0]], + [[2.0, 0.0]], + [[0.0, 0.0]], + [[0.0, 0.0]], + [[0.0, 0.0]], + ] + np.testing.assert_allclose(kptsarr, kptsarr_ref) + np.testing.assert_allclose(eigsarr, eigsarr_ref) + np.testing.assert_allclose(occsarr, occsarr_ref) + + +def test_fermi_level(info_iron: Dict[str, Any]): + """Test if the Fermi level is parsed correctly.""" + efermi_ref = 0.153766 * Hartree + np.testing.assert_allclose(info_iron['fermi_level'], efermi_ref) + + +def test_dipole_moment(datadir): + """Test if the dipole moment is parsed correctly.""" + file = datadir / 'octopus/linear_response_02-h2o_pol_lr.01_h2o_gs_info' + with file.open(encoding='utf-8') as fd: + results = read_static_info(fd) + dipole_ref = np.array((7.45151E-16, 9.30594E-01, 3.24621E-15)) * Debye + np.testing.assert_allclose(results['dipole'], dipole_ref) + + +def test_magnetic_moment(info_iron: Dict[str, Any]): + """Test if the magnetic moment is parsed correctly.""" + magmom_ref = 7.409638 + magmoms_ref = [3.385730, 3.385730] + np.testing.assert_allclose(info_iron['magmom'], magmom_ref) + np.testing.assert_allclose(info_iron['magmoms'], magmoms_ref) + + +def test_stress(datadir): + """Test if the stress tensor is parsed correctly.""" + file = datadir / 'octopus/periodic_systems_30-stress.05-output_scf_info' + with file.open(encoding='utf-8') as fd: + results = read_static_info(fd) + stress_ref = ( + (-5.100825936E-04, -9.121282047E-16, +4.495864617E-16), + (-9.121277710E-16, -5.100825936E-04, -1.086184124E-15), + (+4.496421897E-16, -1.086295146E-15, -5.100825937E-04), + ) + stress_ref = np.array(stress_ref) * Hartree / Bohr**3 + np.testing.assert_allclose(results['stress'], stress_ref) + + +def test_kpoints(info_iron: Dict[str, Any]): + """Test if the kpoints are parsed correctly.""" + nkpts_ref = 4 + kpoint_weights_ref = [0.25, 0.25, 0.25, 0.25] + ibz_kpoints_ref = [ + [0.0000, 0.0000, 0.0000], + [0.5000, 0.0000, 0.0000], + [0.0000, 0.5000, 0.0000], + [0.5000, 0.5000, 0.0000], + ] + assert info_iron['nkpts'] == nkpts_ref + np.testing.assert_allclose(info_iron['kpoint_weights'], kpoint_weights_ref) + np.testing.assert_allclose(info_iron['ibz_kpoints'], ibz_kpoints_ref) diff --git a/ase/test/fio/test_amber.py b/ase/test/fio/test_amber.py new file mode 100644 index 0000000000..c0dba91f79 --- /dev/null +++ b/ase/test/fio/test_amber.py @@ -0,0 +1,29 @@ +import numpy as np +import pytest + +from ase.build import bulk +from ase.calculators.calculator import compare_atoms +from ase.io.amber import read_amber_coordinates, write_amber_coordinates + + +@pytest.mark.parametrize('with_velocities', [False, True]) +def test_io_amber_coordinates(with_velocities): + atoms = bulk('Au', orthorhombic=True) + filename = 'amber.netcdf' + + if with_velocities: + atoms.set_velocities(np.random.default_rng(42).random((len(atoms), 3))) + + write_amber_coordinates(atoms, filename) + atoms2 = read_amber_coordinates(filename) + + # The format does not save the species so they revert to 'X' + assert all(atoms2.symbols == 'X') + assert compare_atoms(atoms, atoms2) == ['numbers'] + assert atoms.get_velocities() == pytest.approx(atoms2.get_velocities()) + + +def test_cannot_write_nonorthorhombic(): + atoms = bulk('Ti') + with pytest.raises(ValueError, match='Non-orthorhombic'): + write_amber_coordinates(atoms, 'xxx') diff --git a/ase/test/geometry/test_distance.py b/ase/test/geometry/test_distance.py index 2d54a79ad2..b214a9e464 100644 --- a/ase/test/geometry/test_distance.py +++ b/ase/test/geometry/test_distance.py @@ -2,7 +2,7 @@ import itertools import numpy as np -from ase import Atom, Atoms +from ase import Atoms from ase.geometry import distance @@ -40,15 +40,6 @@ def test_distance(): assert dist < maxdist assert dist == dist2 - if 0: - # reflect - new = Atoms() - cm = org.get_center_of_mass() - for a in org: - new.append(Atom(a.symbol, -(a.position - cm))) - dist = distance(org, new) - print('reflected -> distance', dist) - # permute for i, a in enumerate(org): if i < 3: diff --git a/ase/test/geometry/test_geometry.py b/ase/test/geometry/test_geometry.py index 59993c878a..351a676f2e 100644 --- a/ase/test/geometry/test_geometry.py +++ b/ase/test/geometry/test_geometry.py @@ -1,9 +1,12 @@ +from dataclasses import is_dataclass + import numpy as np from ase.build import bulk, cut, fcc111 from ase.cell import Cell from ase.geometry import get_layers, wrap_positions -from ase.spacegroup import crystal, get_spacegroup +from ase.spacegroup import crystal +from ase.utils import atoms_to_spglib_cell def test_geometry(): @@ -82,8 +85,11 @@ def test_geometry(): ag = crystal(['Ag'], basis=[(0, 0, 0)], spacegroup=225, cellpar=4.09) si = crystal(['Si'], basis=[(0, 0, 0)], spacegroup=227, cellpar=5.43) try: - assert get_spacegroup(ag).no == 225 - assert get_spacegroup(si).no == 227 + import spglib + for atoms, no_ref in zip([ag, si], [225, 227]): + dataset = spglib.get_symmetry_dataset(atoms_to_spglib_cell(atoms)) + no = dataset.number if is_dataclass(dataset) else dataset['number'] + assert no == no_ref except ImportError: pass diff --git a/ase/test/md/test_phonon_md_init.py b/ase/test/md/test_phonon_md_init.py index 666d078361..cc00321855 100644 --- a/ase/test/md/test_phonon_md_init.py +++ b/ase/test/md/test_phonon_md_init.py @@ -94,11 +94,3 @@ def test_phonon_md_init(asap3, testdir): assert Terr < 0.1 * T, Terr # error in Kelvin for instantaneous velocity # Epot == Ekin give or take 2 %: assert relative_imbalance < 0.1, relative_imbalance - - if 0: - import matplotlib.pyplot as plt - Ivalues = np.arange(len(Epots)) - plt.plot(Ivalues, Epots, 'o', label='pot') - plt.plot(Ivalues, Ekins, 'o', label='kin') - plt.plot(Ivalues, Etots, 'o', label='tot') - plt.show() diff --git a/ase/test/md/test_rng.py b/ase/test/md/test_rng.py new file mode 100644 index 0000000000..e93769bf60 --- /dev/null +++ b/ase/test/md/test_rng.py @@ -0,0 +1,31 @@ +"""Tests for legacy and modern NumPy PRNGs.""" +import numpy as np +import pytest + +from ase.build import bulk +from ase.calculators.emt import EMT +from ase.md import Andersen +from ase.units import fs + + +@pytest.fixture(name='atoms') +def _fixture_atoms(): + atoms = bulk('Cu') * (2, 2, 2) + atoms.calc = EMT() + return atoms + + +@pytest.mark.parametrize( + 'rng', + [np.random.RandomState(0), np.random.default_rng(42)], +) +def test_andersen(atoms, rng): + """Test legacy and modern NumPy PRNGs for `Andersen`.""" + with Andersen( + atoms, + timestep=1.0 / fs, + temperature_K=1000.0, + andersen_prob=0.01, + rng=rng, + ) as md: + md.run(5) diff --git a/ase/test/optimize/test_replay.py b/ase/test/optimize/test_replay.py index 6c11965899..4eee7fb737 100644 --- a/ase/test/optimize/test_replay.py +++ b/ase/test/optimize/test_replay.py @@ -7,7 +7,6 @@ from ase.calculators.emt import EMT from ase.constraints import FixAtoms from ase.io import read from ase.optimize import QuasiNewton -from ase.visualize import view @pytest.mark.optimize() @@ -24,9 +23,6 @@ def test_replay(testdir): h0 = 2.0 a += Atom('Ag', (d / 2, d / 2, h0)) - if 0: - view(a) - constraint = FixAtoms(range(len(a) - 1)) a.calc = EMT() a.set_constraint(constraint) diff --git a/ase/test/spacegroup/test_minerals.py b/ase/test/spacegroup/test_minerals.py index 06d49681fb..803ce087e0 100644 --- a/ase/test/spacegroup/test_minerals.py +++ b/ase/test/spacegroup/test_minerals.py @@ -51,7 +51,7 @@ named_minerals = [ def test_mineral_spacegroups(datadir, mineral): atoms = read(datadir / mineral.datafile) dataset = check_symmetry(atoms) - assert dataset["number"] == mineral.spacegroup + assert dataset.number == mineral.spacegroup @pytest.mark.parametrize('mineral,rngseed', product( @@ -66,12 +66,12 @@ def test_mineral_symmetrization(datadir, mineral, rngseed): atoms.set_cell(cell.array + rng.normal(scale=0.01, size=(3, 3))) atoms.rattle(0.01, rng=rng) rattled_dataset = check_symmetry(atoms) - assert rattled_dataset["number"] == 1 + assert rattled_dataset.number == 1 # Find a symmetry precision that recovers the original symmetry symprec = 1e-5 symatoms, dataset = get_symmetrized_atoms(atoms, symprec=symprec) - while dataset["number"] != mineral.spacegroup: + while dataset.number != mineral.spacegroup: if symprec > 0.5: raise ValueError('Could not recover original symmetry of the' f'mineral {mineral.name}') diff --git a/ase/test/test_dos.py b/ase/test/test_dos.py index b4fd16df0d..a5774cb6a7 100644 --- a/ase/test/test_dos.py +++ b/ase/test/test_dos.py @@ -42,8 +42,3 @@ def test_dos(): print(dims, norm, error) assert error < 0.2, error assert abs(norm - 1) < 0.11**dims, norm - if 0: - import matplotlib.pyplot as plt - plt.plot(energies, dos) - plt.plot(energies, ref) - plt.show() diff --git a/ase/test/test_phonons.py b/ase/test/test_phonons.py index 2fc6c741fe..a217159d4b 100644 --- a/ase/test/test_phonons.py +++ b/ase/test/test_phonons.py @@ -1,5 +1,12 @@ +import os + +import numpy as np + +from ase import Atoms, units from ase.build import bulk, molecule from ase.calculators.emt import EMT +from ase.calculators.lj import LennardJones +from ase.io.trajectory import Trajectory from ase.phonons import Phonons @@ -58,13 +65,15 @@ def test_get_band_structure_with_modes(testdir): atoms = bulk('Al', 'fcc', a=4.05) N = 7 + npoints = 100 # k-points in band path + natoms = len(atoms) ph = Phonons(atoms, EMT(), supercell=(N, N, N), delta=0.05) ph.run() ph.read(acoustic=True) ph.clean() - path = atoms.cell.bandpath('GXULGK', npoints=100) + path = atoms.cell.bandpath('GXULGK', npoints=npoints) band_structure, modes = ph.get_band_structure(path, modes=True, verbose=False) @@ -73,3 +82,193 @@ def test_get_band_structure_with_modes(testdir): assert band_structure is not None, "Band structure should not be None" assert modes is not None, "Modes should not be None" assert modes.ndim == 4, "Modes should be a 4-dimensional numpy array" + assert modes.shape == (npoints, 3 * natoms, natoms, 3), \ + "Modes should have shape (k-points, nbands, natoms, 3)" + + +def test_frequencies_amplitudes(testdir): + """Test frequencies and amplitudes of the phonon modes. + + The calculation is done for a diatomic chain of atoms + with different masses and known spring constants, so + frequencies and mode amplitudes can be compared with + the theoretical values. We use Cu and O with a + Lennard-Jones potential. + """ + + # Reasonable Lennard-Jones parameters taken from the + # OpenKIM project, DOI: 10.25950/962b4967 + LJ_epsilon_O = 5.1264700 + LJ_sigma_O = 1.1759900 + LJ_epsilon_Cu = 2.0446300 + LJ_sigma_Cu = 2.3519700 + + LJ_epsilon = np.sqrt(LJ_epsilon_O * LJ_epsilon_Cu) + LJ_sigma = (LJ_sigma_O + LJ_sigma_Cu) / 2 + + # Equilibrium distance + d0 = 2**(1 / 6) * LJ_sigma + # Spring constant + C = 36 * 2**(2 / 3) * LJ_epsilon / LJ_sigma**2 + print(f'LJ epsilon: {LJ_epsilon:.5f} eV sigma: {LJ_sigma:.5f} Å') + print(f'Bond length d0 = {d0:.5f} Å. C = {C:.5f} eV / Å^2') + + # Make chain of Cu-O atoms + pos = np.array( + [[0, 0, 0], + [d0, 0, 0]] + ) + atoms = Atoms( + symbols='CuO', + positions=pos, + cell=[2 * d0, 10., 10.], + pbc=(True, False, False) + ) + atoms.center() + calc = LennardJones(sigma=LJ_sigma, epsilon=LJ_epsilon, rc=1.5 * d0) + + print('Calculating phonons') + N = 7 + ph = Phonons(atoms, calc, supercell=(N, 1, 1), + delta=0.005, name='phonon_CuO') + ph.run() + assert ph.check_eq_forces()[1] < 1e-9, "System is not at equilibrium" + # Read forces and assemble the dynamical matrix + ph.read(acoustic=True) + ph.clean() + + path = atoms.cell.bandpath(npoints=50, pbc=[1, 0, 0]) + kpoints = path.kpts + gamma_point = path.special_points['G'] + x_point = path.special_points['X'] + omegas, us = ph.band_structure(kpoints, modes=True) + + e_gamma_O = omegas[0, 5] + e_X_O = omegas[-1, 5] + e_X_A = omegas[-1, 4] + + (m1, m2) = atoms.get_masses() + hbar = units._hbar * units.J * units.second + + e_gamma_O_th = hbar * np.sqrt(2 * C * (1 / m1 + 1 / m2)) + e_X_O_th = hbar * np.sqrt(2 * C / m2) + e_X_A_th = hbar * np.sqrt(2 * C / m1) + + print() + print('ENERGIES Numerical Analytical') + print(f'Gamma, O: {e_gamma_O:<9.5f} {e_gamma_O_th:<9.5f} eV') + print(f'Zone edge, O: {e_X_O:<9.5f} {e_X_O_th:<9.5f} eV') + print(f'Zone edge, A: {e_X_A:<9.5f} {e_X_A_th:<9.5f} eV') + + assert np.isclose(e_gamma_O, e_gamma_O_th, atol=1e-4) + assert np.isclose(e_X_O, e_X_O_th, atol=1e-4) + assert np.isclose(e_X_A, e_X_A_th, atol=1e-4) + + print() + mr = m1 / m2 + print(f'Mass ratios: {mr:.5f} {m2 / m1:.5f}') + + print('Amplitude ratios, Optical mode at gamma point:') + amp_gamma_O = us[0, 5, 1, 0] / us[0, 5, 0, 0] + print(amp_gamma_O) + assert np.isclose(amp_gamma_O, -mr, atol=1e-5) + + print('Amplitude ratios, Optical mode NEAR gamma point:') + amp_nearG_O = us[1, 5, 1, 0] / us[1, 5, 0, 0] + print(amp_nearG_O, np.abs(amp_nearG_O)) + assert np.isclose(np.abs(amp_nearG_O), mr, atol=1e-2) + + print('Amplitude ratios, Acoustic mode NEAR gamma point:') + amp_nearG_A = us[1, 4, 1, 0] / us[1, 4, 0, 0] + print(amp_nearG_A, np.abs(amp_nearG_A)) + assert np.isclose(np.abs(amp_nearG_A), 1.0, atol=1e-3) + + # Test of absolute amplitudes + # This is done by testing that the kinetic energy of each + # mode is 1/2 k T + + repeat = 8 + T = 300 + + checkmodes = ( + (gamma_point, 5, e_gamma_O), + (x_point, 5, e_X_O), + (x_point, 4, e_X_A), + ) + + for kk, br, hbaromega in checkmodes: + print(f'Ckecking k-point {kk} branch {br}') + ph.write_modes(kk, branches=(br,), + repeat=(repeat, 1, 1), kT=T * units.kB) + filename = f'{ph.name}.mode.{br}.traj' + pos = [] + with Trajectory(filename) as traj: + for a in traj: + pos.append(a.get_positions()) + masses = a.get_masses() + os.unlink(filename) + + # Now calculate the velocities from the differences in the positions. + # The first frame should be compared to the last. + delta_t = 2 * np.pi * hbar / (hbaromega * len(pos)) + + vel = [] + ekin = [] + for i in range(len(pos)): + v = (pos[i] - pos[i - 1]) / delta_t + vel.append(v) + ek = (0.5 * masses * (v * v).sum(axis=1)).sum() / repeat + ekin.append(ek) + + ekin_avg = np.mean(ekin) + ekin_exp = units.kB * T / 2 + print(f"Avg. kinetic energy: {ekin_avg} eV - expected {ekin_exp} eV") + assert np.isclose(ekin_avg, ekin_exp, rtol=0.01) + + +def test_partial_dos(testdir): + """Test partial phonon DOS. + + Tests that the partial phonon densities of states sum + up to the total density of states. + """ + + # Reasonable Lennard-Jones parameters taken from the + # OpenKIM project, DOI: 10.25950/962b4967 + Epsilon_Zn, Sigma_Zn = 0.1915460, 2.1737900 + Epsilon_S, Sigma_S = 4.3692700, 1.8708900 + + LJ_epsilon = np.sqrt(Epsilon_Zn * Epsilon_S) + LJ_sigma = (Sigma_Zn + Sigma_S) / 2 + + # Equilibrium distance + d0 = 2**(1 / 6) * LJ_sigma + latconst = d0 * np.sqrt(2) + cutoff = d0 * (1 + np.sqrt(2)) / 2 # Between first and second neighbor + + # Set up a zincblende structure with a reasonable lattice constant + atoms = bulk('ZnS', 'zincblende', a=latconst) + calc = LennardJones(sigma=LJ_sigma, epsilon=LJ_epsilon, rc=cutoff) + + # Calculating phonons + N = 3 + ph = Phonons(atoms, calc, supercell=(N, N, N), + delta=0.005, name='phonon_ZnS') + ph.run() + assert ph.check_eq_forces()[1] < 1e-9, "System is not at equilibrium" + # Read forces and assemble the dynamical matrix + ph.read(acoustic=True) + ph.clean() + + # Analyzing phonons + kpts = (10, 10, 10) + w = 3e-2 + dos = ph.get_dos(kpts=kpts).sample_grid(npts=500, width=w) + dosZn = ph.get_dos(kpts=kpts, indices=(0,)).sample_grid(npts=500, width=w) + dosS = ph.get_dos(kpts=kpts, indices=(1,)).sample_grid(npts=500, width=w) + + dosZn_array = dosZn.get_weights() + dosS_array = dosS.get_weights() + dosTotal_array = dos.get_weights() + + assert np.allclose(dosTotal_array, dosS_array + dosZn_array) diff --git a/ase/test/test_thermochemistry.py b/ase/test/test_thermochemistry.py index f88e45d027..5c1dfe2cbb 100644 --- a/ase/test/test_thermochemistry.py +++ b/ase/test/test_thermochemistry.py @@ -296,7 +296,9 @@ def test_crystal_thermo(asap3, testdir): ph.run() ph.read(acoustic=True) - phonon_energies, phonon_DOS = ph.dos(kpts=(4, 4, 4), npts=30, delta=5e-4) + dos = ph.get_dos(kpts=(4, 4, 4)).sample_grid(npts=30, width=5e-4) + phonon_energies = dos.get_energies() + phonon_DOS = dos.get_weights() thermo = CrystalThermo( phonon_energies=phonon_energies, diff --git a/ase/test/testdata/octopus/linear_response_02-h2o_pol_lr.01_h2o_gs_info b/ase/test/testdata/octopus/linear_response_02-h2o_pol_lr.01_h2o_gs_info new file mode 100644 index 0000000000..f95c728775 --- /dev/null +++ b/ase/test/testdata/octopus/linear_response_02-h2o_pol_lr.01_h2o_gs_info @@ -0,0 +1,85 @@ + +******************************** Grid ******************************** +Simulation Box: + Type = minimum + Radius [b] = 7.559 +Main mesh: + Spacing [b] = ( 0.650, 0.650, 0.650) volume/point [b^3] = 0.27463 + # inner mesh = 8807 + # total mesh = 17863 + Grid Cutoff [H] = 11.680005 Grid Cutoff [Ry] = 23.360010 +********************************************************************** + + +***************************** Symmetries ***************************** +Symmetry elements : (C2) 2*(sigma) +Symmetry group : C2v +********************************************************************** + + +**************************** Theory Level **************************** +Input: [TheoryLevel = kohn_sham] + +Exchange-correlation: + Exchange + Slater exchange (LDA) + [1] P. A. M. Dirac., Math. Proc. Cambridge Philos. Soc. 26, 376 (1930) + [2] F. Bloch., Z. Phys. 57, 545 (1929) + Correlation + Perdew & Zunger (Modified) (LDA) + [1] J. P. Perdew and A. Zunger., Phys. Rev. B 23, 5048 (1981) + +********************************************************************** + +SCF converged in 18 iterations + +Eigenvalues [H] + #st Spin Eigenvalue Occupation + 1 -- -1.167471 2.000000 + 2 -- -0.453075 2.000000 + 3 -- -0.444696 2.000000 + 4 -- -0.200360 2.000000 + +Energy [H]: + Total = -16.06669135 + Free = -16.06669135 + ----------- + Ion-ion = 6.98512326 + Eigenvalues = -4.53120519 + Hartree = 19.70599283 + Int[n*v_xc] = -5.01651358 + Exchange = -3.38419827 + Correlation = -0.44693189 + vanderWaals = 0.00000000 + Delta XC = 0.00000000 + Entropy = 0.00000000 + -TS = -0.00000000 + Photon ex. = 0.00000000 + Kinetic = 9.76911360 + External = -48.69579085 + Non-local = -1.93722680 + Int[n*v_E] = 0.00000000 + +Dipole: [b] [Debye] + = 2.93165E-16 7.45151E-16 + = 3.66124E-01 9.30594E-01 + = 1.27716E-15 3.24621E-15 + +Convergence: + abs_energy = 2.48689958E-14 ( 0.00000000E+00) [H] + rel_energy = 1.54786044E-15 ( 0.00000000E+00) + abs_dens = 3.25504028E-07 ( 0.00000000E+00) + rel_dens = 4.06880036E-08 ( 8.00000000E-08) + abs_evsum = 2.59547375E-07 ( 0.00000000E+00) [H] + rel_evsum = 5.72799870E-08 ( 0.00000000E+00) + +Forces on the ions [H/b] + Ion x y z + 1 O -5.29412822E-17 -4.36640978E-01 1.06852083E-14 + 2 H 1.26174198E-01 1.63394325E-01 6.98642109E-16 + 3 H -1.26174198E-01 1.63394325E-01 -9.41131712E-17 + ---------------------------------------------------------- + Max abs force 1.26174198E-01 4.36640978E-01 1.06852083E-14 + Total force -1.16573418E-15 -1.09852328E-01 1.12897372E-14 + Total torque -5.58052295E-15 -1.13359011E-15 5.82867088E-16 + diff --git a/ase/test/testdata/octopus/periodic_systems_03-sodium_chain.02-unocc_eigenvalues b/ase/test/testdata/octopus/periodic_systems_03-sodium_chain.02-unocc_eigenvalues new file mode 100644 index 0000000000..02f9c6b18d --- /dev/null +++ b/ase/test/testdata/octopus/periodic_systems_03-sodium_chain.02-unocc_eigenvalues @@ -0,0 +1,23 @@ +All states converged. +Criterion = 0.100000E-06 + +Eigenvalues [eV] + #st Spin Eigenvalue Occupation Error +#k = 1, k = ( 0.000000, 0.000000, 0.000000) + 1 -- -3.647610 2.000000 ( 3.8E-08) + 2 -- -1.236399 0.000000 ( 4.8E-08) +#k = 2, k = ( 0.100000, 0.000000, 0.000000) + 1 -- -3.551626 2.000000 ( 3.7E-08) + 2 -- -1.144852 0.000000 ( 4.1E-08) +#k = 3, k = ( 0.200000, 0.000000, 0.000000) + 1 -- -3.264556 2.000000 ( 4.6E-08) + 2 -- -0.870333 0.000000 ( 3.4E-08) +#k = 4, k = ( 0.300000, 0.000000, 0.000000) + 1 -- -2.789110 0.000000 ( 4.6E-08) + 2 -- -0.413463 0.000000 ( 5.8E-08) +#k = 5, k = ( 0.400000, 0.000000, 0.000000) + 1 -- -2.130396 0.000000 ( 4.4E-08) + 2 -- -0.280652 0.000000 ( 8.0E-08) +#k = 6, k = ( 0.500000, 0.000000, 0.000000) + 1 -- -1.367358 0.000000 ( 7.2E-08) + 2 -- -1.210151 0.000000 ( 4.9E-08) diff --git a/ase/test/testdata/octopus/periodic_systems_25-Fe_polarized.01-gs_info b/ase/test/testdata/octopus/periodic_systems_25-Fe_polarized.01-gs_info new file mode 100644 index 0000000000..0e999f8e07 --- /dev/null +++ b/ase/test/testdata/octopus/periodic_systems_25-Fe_polarized.01-gs_info @@ -0,0 +1,285 @@ + +******************************** Grid ******************************** +Simulation Box: + Type = parallelepiped + Lengths [b] = ( 4.674, 4.674, 9.348) +Main mesh: + Spacing [b] = ( 0.425, 0.425, 0.425) volume/point [b^3] = 0.05906 + # inner mesh = 2662 + # total mesh = 9352 + Grid Cutoff [H] = 27.332522 Grid Cutoff [Ry] = 54.665045 +********************************************************************** + + +***************************** Symmetries ***************************** +Space group No. 229 +International: Im-3m +Schoenflies: Oh^9 + Index Rotation matrix Fractional translations + 1 : 1 0 0 0 1 0 0 0 1 0.000000 0.000000 0.000000 + 2 : -1 0 0 0 -1 0 0 0 -1 0.000000 0.000000 0.000000 + 3 : 0 1 0 1 0 0 -2 -2 -1 0.000000 0.000000 0.000000 + 4 : 0 -1 0 -1 0 0 2 2 1 0.000000 0.000000 0.000000 + 5 : -1 0 0 0 -1 0 2 2 1 0.000000 0.000000 0.000000 + 6 : 1 0 0 0 1 0 -2 -2 -1 0.000000 0.000000 0.000000 + 7 : 0 -1 0 -1 0 0 0 0 -1 0.000000 0.000000 0.000000 + 8 : 0 1 0 1 0 0 0 0 1 0.000000 0.000000 0.000000 +Info: The system has 8 symmetries that can be used. +********************************************************************** + + +********************** Brillouin zone sampling *********************** +Dimensions of the k-point grid = 2 2 1 +Total number of k-points = 4 +Number of symmetry-reduced k-points = 4 + +List of k-points: + ik k_x k_y k_z Weight +--------------------------------------------------------- + 1 0.0000 0.0000 0.0000 0.2500 + 2 0.5000 0.0000 0.0000 0.2500 + 3 0.0000 0.5000 0.0000 0.2500 + 4 0.5000 0.5000 0.0000 0.2500 + +********************************************************************** + + + +**************************** Theory Level **************************** +Input: [TheoryLevel = kohn_sham] + +Exchange-correlation: + Exchange + Slater exchange (LDA) + [1] P. A. M. Dirac., Math. Proc. Cambridge Philos. Soc. 26, 376 (1930) + [2] F. Bloch., Z. Phys. 57, 545 (1929) + Correlation + Perdew & Wang (LDA) + [1] J. P. Perdew and Y. Wang., Phys. Rev. B 45, 13244 (1992) + +********************************************************************** + +SCF converged in 41 iterations + +Some of the states are not fully converged! +Eigenvalues [H] + #st Spin Eigenvalue Occupation +#k = 1, k = ( 0.000000, 0.000000, 0.000000) + 1 up -2.937170 1.000000 + 1 dn -2.813866 1.000000 + 2 up -2.933898 1.000000 + 2 dn -2.810330 1.000000 + 3 up -1.748337 1.000000 + 3 dn -1.624588 1.000000 + 4 up -1.737457 1.000000 + 4 dn -1.612539 1.000000 + 5 up -1.732254 1.000000 + 5 dn -1.606831 1.000000 + 6 up -1.732230 1.000000 + 6 dn -1.606799 1.000000 + 7 up -1.732230 1.000000 + 7 dn -1.606799 1.000000 + 8 up -1.731527 1.000000 + 8 dn -1.606066 1.000000 + 9 up -0.180242 1.000000 + 9 dn -0.122869 1.000000 + 10 up -0.042553 1.000000 + 10 dn 0.044765 1.000000 + 11 up 0.005584 1.000000 + 11 dn 0.107529 0.999997 + 12 up 0.042209 1.000000 + 12 dn 0.150116 0.729686 + 13 up 0.042209 1.000000 + 13 dn 0.150116 0.729685 + 14 up 0.042282 1.000000 + 14 dn 0.150270 0.721352 + 15 up 0.114118 0.999979 + 15 dn 0.199829 0.000004 + 16 up 0.125197 0.999580 + 16 dn 0.238104 0.000000 + 17 up 0.125197 0.999580 + 17 dn 0.248839 0.000000 + 18 up 0.129486 0.998651 + 18 dn 0.253735 0.000000 + 19 up 0.133400 0.996095 + 19 dn 0.253735 0.000000 + 20 up 0.140305 0.974985 + 20 dn 0.263658 0.000000 + 21 up 0.381006 0.000000 + 21 dn 0.472814 0.000000 +#k = 2, k = ( 0.500000, 0.000000, 0.000000) + 1 up -2.933898 1.000000 + 1 dn -2.810330 1.000000 + 2 up -2.933898 1.000000 + 2 dn -2.810330 1.000000 + 3 up -1.748781 1.000000 + 3 dn -1.625051 1.000000 + 4 up -1.748337 1.000000 + 4 dn -1.624588 1.000000 + 5 up -1.737485 1.000000 + 5 dn -1.612567 1.000000 + 6 up -1.737457 1.000000 + 6 dn -1.612539 1.000000 + 7 up -1.732254 1.000000 + 7 dn -1.606831 1.000000 + 8 up -1.731767 1.000000 + 8 dn -1.606323 1.000000 + 9 up -0.042553 1.000000 + 9 dn 0.044765 1.000000 + 10 up -0.042520 1.000000 + 10 dn 0.044789 1.000000 + 11 up 0.005584 1.000000 + 11 dn 0.107529 0.999997 + 12 up 0.005621 1.000000 + 12 dn 0.107613 0.999996 + 13 up 0.113928 0.999980 + 13 dn 0.199716 0.000004 + 14 up 0.114119 0.999979 + 14 dn 0.199829 0.000004 + 15 up 0.129399 0.998682 + 15 dn 0.237897 0.000000 + 16 up 0.129486 0.998651 + 16 dn 0.238104 0.000000 + 17 up 0.133400 0.996095 + 17 dn 0.248693 0.000000 + 18 up 0.133405 0.996091 + 18 dn 0.248839 0.000000 + 19 up 0.140195 0.975702 + 19 dn 0.263658 0.000000 + 20 up 0.140305 0.974985 + 20 dn 0.263659 0.000000 + 21 up 0.381021 0.000000 + 21 dn 0.473025 0.000000 +#k = 3, k = ( 0.000000, 0.500000, 0.000000) + 1 up -2.933898 1.000000 + 1 dn -2.810330 1.000000 + 2 up -2.933898 1.000000 + 2 dn -2.810330 1.000000 + 3 up -1.748781 1.000000 + 3 dn -1.625051 1.000000 + 4 up -1.748337 1.000000 + 4 dn -1.624588 1.000000 + 5 up -1.737485 1.000000 + 5 dn -1.612567 1.000000 + 6 up -1.737457 1.000000 + 6 dn -1.612539 1.000000 + 7 up -1.732254 1.000000 + 7 dn -1.606831 1.000000 + 8 up -1.731767 1.000000 + 8 dn -1.606323 1.000000 + 9 up -0.042553 1.000000 + 9 dn 0.044765 1.000000 + 10 up -0.042520 1.000000 + 10 dn 0.044789 1.000000 + 11 up 0.005584 1.000000 + 11 dn 0.107529 0.999997 + 12 up 0.005621 1.000000 + 12 dn 0.107613 0.999996 + 13 up 0.113928 0.999980 + 13 dn 0.199716 0.000004 + 14 up 0.114119 0.999979 + 14 dn 0.199829 0.000004 + 15 up 0.129399 0.998682 + 15 dn 0.237897 0.000000 + 16 up 0.129486 0.998651 + 16 dn 0.238104 0.000000 + 17 up 0.133400 0.996095 + 17 dn 0.248693 0.000000 + 18 up 0.133404 0.996091 + 18 dn 0.248839 0.000000 + 19 up 0.140195 0.975702 + 19 dn 0.263658 0.000000 + 20 up 0.140305 0.974985 + 20 dn 0.263659 0.000000 + 21 up 0.381230 0.000000 + 21 dn 0.473074 0.000000 +#k = 4, k = ( 0.500000, 0.500000, 0.000000) + 1 up -2.933898 1.000000 + 1 dn -2.810330 1.000000 + 2 up -2.931523 1.000000 + 2 dn -2.807772 1.000000 + 3 up -1.748781 1.000000 + 3 dn -1.625051 1.000000 + 4 up -1.743997 1.000000 + 4 dn -1.619730 1.000000 + 5 up -1.743997 1.000000 + 5 dn -1.619730 1.000000 + 6 up -1.743310 1.000000 + 6 dn -1.619013 1.000000 + 7 up -1.737485 1.000000 + 7 dn -1.612567 1.000000 + 8 up -1.731767 1.000000 + 8 dn -1.606323 1.000000 + 9 up -0.042520 1.000000 + 9 dn 0.044789 1.000000 + 10 up -0.022262 1.000000 + 10 dn 0.079286 1.000000 + 11 up -0.022262 1.000000 + 11 dn 0.079286 1.000000 + 12 up 0.005621 1.000000 + 12 dn 0.107613 0.999996 + 13 up 0.113928 0.999980 + 13 dn 0.199716 0.000004 + 14 up 0.120746 0.999875 + 14 dn 0.237897 0.000000 + 15 up 0.120746 0.999875 + 15 dn 0.238942 0.000000 + 16 up 0.120863 0.999871 + 16 dn 0.238942 0.000000 + 17 up 0.129399 0.998682 + 17 dn 0.239152 0.000000 + 18 up 0.133404 0.996091 + 18 dn 0.248693 0.000000 + 19 up 0.140195 0.975702 + 19 dn 0.263659 0.000000 + 20 up 0.381279 0.000000 + 20 dn 0.473114 0.000000 + 21 up 0.481447 0.000000 + 21 dn 0.538380 0.000000 +Fermi energy = 0.153766 H + + +Energy [H]: + Total = -251.61187197 + Free = -251.61433435 + ----------- + Ion-ion = -156.63361293 + Eigenvalues = -30.44627318 + Hartree = 64.99005908 + Int[n*v_xc] = -36.20107444 + Exchange = -33.04090367 + Correlation = -2.70209756 + vanderWaals = 0.00000000 + Delta XC = 0.00000000 + Entropy = 0.67004733 + -TS = -0.00246238 + Photon ex. = 0.00000000 + Kinetic = 119.36276558 + External = -243.58808149 + Non-local = -16.89180224 + Int[n*v_E] = 0.00000000 + +Total Magnetic Moment: + mz = 7.409638 +Local Magnetic Moments (sphere radius [b] = 2.337): + Ion mz + 1 Fe 3.385730 + 2 Fe 3.385730 + +Convergence: + abs_energy = 1.83106891E-07 ( 0.00000000E+00) [H] + rel_energy = 7.27735499E-10 ( 0.00000000E+00) + abs_dens = 1.73141357E-06 ( 0.00000000E+00) + rel_dens = 5.41066740E-08 ( 1.00000000E-07) + abs_evsum = 2.33703663E-07 ( 0.00000000E+00) [H] + rel_evsum = 7.67593660E-09 ( 0.00000000E+00) + +Forces on the ions [H/b] + Ion x y z + 1 Fe 1.47379597E-07 1.85241668E-07 2.64704985E-08 + 2 Fe -1.58136376E-07 -2.03160406E-07 -2.33266166E-08 + ---------------------------------------------------------- + Max abs force 1.58136376E-07 2.03160406E-07 2.64704985E-08 + Total force -1.07567789E-08 -1.79187378E-08 3.14388191E-09 + Total torque 6.11181780E-07 -4.89683132E-07 1.21498648E-07 + diff --git a/ase/test/testdata/octopus/periodic_systems_30-stress.05-output_scf_info b/ase/test/testdata/octopus/periodic_systems_30-stress.05-output_scf_info new file mode 100644 index 0000000000..ea15c1441d --- /dev/null +++ b/ase/test/testdata/octopus/periodic_systems_30-stress.05-output_scf_info @@ -0,0 +1,150 @@ + +******************************** Grid ******************************** +Simulation Box: + Type = parallelepiped + Lengths [b] = ( 10.000, 10.000, 10.000) +Main mesh: + Spacing [b] = ( 0.714, 0.714, 0.714) volume/point [b^3] = 0.36443 + # inner mesh = 2744 + # total mesh = 8184 + Grid Cutoff [H] = 9.672212 Grid Cutoff [Ry] = 19.344425 +********************************************************************** + + +***************************** Symmetries ***************************** +Space group No. 227 +International: Fd-3m +Schoenflies: Oh^7 + Index Rotation matrix Fractional translations + 1 : 1 0 0 0 1 0 0 0 1 0.000000 0.000000 0.000000 + 2 : -1 0 0 0 1 0 0 0 -1 0.000000 0.000000 0.000000 + 3 : -1 0 0 0 -1 0 0 0 1 0.000000 0.000000 0.000000 + 4 : 1 0 0 0 -1 0 0 0 -1 0.000000 0.000000 0.000000 + 5 : 0 -1 0 0 0 1 -1 0 0 0.000000 0.000000 0.000000 + 6 : 0 1 0 0 0 1 1 0 0 0.000000 0.000000 0.000000 + 7 : 0 1 0 0 0 -1 -1 0 0 0.000000 0.000000 0.000000 + 8 : 0 -1 0 0 0 -1 1 0 0 0.000000 0.000000 0.000000 + 9 : 0 0 -1 -1 0 0 0 1 0 0.000000 0.000000 0.000000 + 10 : 0 0 1 -1 0 0 0 -1 0 0.000000 0.000000 0.000000 + 11 : 0 0 1 1 0 0 0 1 0 0.000000 0.000000 0.000000 + 12 : 0 0 -1 1 0 0 0 -1 0 0.000000 0.000000 0.000000 + 13 : 0 0 -1 0 -1 0 1 0 0 0.000000 0.000000 0.000000 + 14 : 0 0 1 0 -1 0 -1 0 0 0.000000 0.000000 0.000000 + 15 : 0 0 -1 0 1 0 -1 0 0 0.000000 0.000000 0.000000 + 16 : 0 0 1 0 1 0 1 0 0 0.000000 0.000000 0.000000 + 17 : 1 0 0 0 0 -1 0 -1 0 0.000000 0.000000 0.000000 + 18 : -1 0 0 0 0 -1 0 1 0 0.000000 0.000000 0.000000 + 19 : 1 0 0 0 0 1 0 1 0 0.000000 0.000000 0.000000 + 20 : -1 0 0 0 0 1 0 -1 0 0.000000 0.000000 0.000000 + 21 : 0 -1 0 1 0 0 0 0 -1 0.000000 0.000000 0.000000 + 22 : 0 1 0 1 0 0 0 0 1 0.000000 0.000000 0.000000 + 23 : 0 -1 0 -1 0 0 0 0 1 0.000000 0.000000 0.000000 + 24 : 0 1 0 -1 0 0 0 0 -1 0.000000 0.000000 0.000000 +Info: The system has 24 symmetries that can be used. +********************************************************************** + + +********************** Brillouin zone sampling *********************** +Dimensions of the k-point grid = 1 1 1 +Total number of k-points = 1 +Number of symmetry-reduced k-points = 1 + +List of k-points: + ik k_x k_y k_z Weight +--------------------------------------------------------- + 1 0.0000 0.0000 0.0000 1.0000 + +********************************************************************** + + + +**************************** Theory Level **************************** +Input: [TheoryLevel = kohn_sham] + +Exchange-correlation: + Exchange + Slater exchange (LDA) + [1] P. A. M. Dirac., Math. Proc. Cambridge Philos. Soc. 26, 376 (1930) + [2] F. Bloch., Z. Phys. 57, 545 (1929) + Correlation + Perdew & Wang (LDA) + [1] J. P. Perdew and Y. Wang., Phys. Rev. B 45, 13244 (1992) + +********************************************************************** + +SCF converged in 29 iterations + +Eigenvalues [H] + #st Spin Eigenvalue Occupation +#k = 1, k = ( 0.000000, 0.000000, 0.000000) + 1 -- -0.281234 2.000000 + 2 -- -0.118639 2.000000 + 3 -- -0.118639 2.000000 + 4 -- -0.118639 2.000000 + 5 -- -0.115894 2.000000 + 6 -- -0.115894 2.000000 + 7 -- -0.115894 2.000000 + 8 -- 0.071217 2.000000 + 9 -- 0.071217 2.000000 + 10 -- 0.071217 2.000000 + 11 -- 0.071217 2.000000 + 12 -- 0.071217 2.000000 + 13 -- 0.071217 2.000000 + 14 -- 0.188068 2.000000 + 15 -- 0.188068 2.000000 + 16 -- 0.188068 2.000000 + 17 -- 0.276290 0.000000 + +Direct gap at ik= 1 of 0.0882 H +Indirect gap between ik= 1 and ik= 1 of 0.0882 H + +Energy [H]: + Total = -33.75819799 + Free = -33.75819799 + ----------- + Ion-ion = -31.96223336 + Eigenvalues = 0.01335339 + Hartree = 2.44901505 + Int[n*v_xc] = -13.38508892 + Exchange = -10.88869920 + Correlation = -1.85669269 + vanderWaals = 0.00000000 + Delta XC = 0.00000000 + Entropy = 0.00000000 + -TS = -0.00000000 + Photon ex. = 0.00000000 + Kinetic = 13.65291054 + External = -5.15249833 + Non-local = 5.30939598 + Int[n*v_E] = 0.00000000 + +Convergence: + abs_energy = 4.36727987E-10 ( 0.00000000E+00) [H] + rel_energy = 1.29369461E-11 ( 0.00000000E+00) + abs_dens = 2.51775177E-08 ( 0.00000000E+00) + rel_dens = 7.86797428E-10 ( 1.00000000E-08) + abs_evsum = 4.27841984E-10 ( 0.00000000E+00) [H] + rel_evsum = 3.20399630E-08 ( 0.00000000E+00) + +Forces on the ions [H/b] + Ion x y z + 1 Si -1.57980175E-11 1.41220668E-12 -3.29062324E-12 + 2 Si -1.57985126E-11 1.40861942E-12 -3.28943025E-12 + 3 Si -1.58018476E-11 1.41389209E-12 -3.28991615E-12 + 4 Si -1.58015394E-11 1.40950471E-12 -3.28718266E-12 + 5 Si -1.58682089E-11 1.47461196E-12 -2.68518945E-12 + 6 Si -1.58691379E-11 1.47453724E-12 -2.68512318E-12 + 7 Si -1.58689971E-11 1.47520884E-12 -2.68352517E-12 + 8 Si -1.58689998E-11 1.47561645E-12 -2.68436231E-12 + ---------------------------------------------------------- + Max abs force 1.58691379E-11 1.47561645E-12 3.29062324E-12 + Total force -1.26675261E-10 1.15441974E-11 -2.38953524E-11 + Total torque 4.70061659E-11 1.25124087E-10 -1.72113941E-10 + +Total stress tensor [H/b^3] = + T_{ij} 1 2 3 + 1 -5.100825936E-04 -9.121282047E-16 4.495864617E-16 + 2 -9.121277710E-16 -5.100825936E-04 -1.086184124E-15 + 3 4.496421897E-16 -1.086295146E-15 -5.100825937E-04 + +Pressure [H/b^3] = 5.10082594E-04 Pressure [GPa] = 15.00715350 diff --git a/ase/test/testdata/vasp/Li/CHG b/ase/test/testdata/vasp/Li/CHG new file mode 100644 index 0000000000..573501b88a --- /dev/null +++ b/ase/test/testdata/vasp/Li/CHG @@ -0,0 +1,111 @@ +unknown system + 1.00000000000000 + -1.745000 1.745000 1.745000 + 1.745000 -1.745000 1.745000 + 1.745000 1.745000 -1.745000 + Li + 1 +Direct + 0.000000 0.000000 0.000000 + + 10 10 10 + 0.40155 0.40130 0.52858 0.81819 1.0415 1.1062 1.0415 0.81819 0.52858 0.40130 + 0.40130 0.40785 0.50946 0.76660 1.0084 1.1050 1.0876 0.94326 0.67069 0.45701 + 0.52858 0.50946 0.60934 0.81850 1.0151 1.1036 1.1141 1.0578 0.89457 0.67069 + 0.81819 0.76660 0.81850 0.94191 1.0539 1.1053 1.1164 1.1090 1.0578 0.94326 + 1.0415 1.0084 1.0151 1.0539 1.0926 1.1095 1.1126 1.1164 1.1141 1.0876 + 1.1062 1.1050 1.1036 1.1053 1.1095 1.1117 1.1095 1.1053 1.1036 1.1050 + 1.0415 1.0876 1.1141 1.1164 1.1126 1.1095 1.0926 1.0539 1.0151 1.0084 + 0.81819 0.94326 1.0578 1.1090 1.1164 1.1053 1.0539 0.94191 0.81850 0.76660 + 0.52858 0.67069 0.89457 1.0578 1.1141 1.1036 1.0151 0.81850 0.60934 0.50946 + 0.40130 0.45701 0.67069 0.94326 1.0876 1.1050 1.0084 0.76660 0.50946 0.40785 + 0.40130 0.40785 0.50946 0.76660 1.0084 1.1050 1.0876 0.94326 0.67069 0.45701 + 0.40785 0.40129 0.45700 0.67068 0.94324 1.0876 1.1050 1.0085 0.76661 0.50946 + 0.50946 0.45700 0.50945 0.69070 0.93193 1.0779 1.1156 1.0779 0.93194 0.69072 + 0.76660 0.67068 0.69070 0.81851 0.98242 1.0842 1.1152 1.1112 1.0614 0.93193 + 1.0084 0.94324 0.93193 0.98242 1.0540 1.0992 1.1116 1.1144 1.1112 1.0779 + 1.1050 1.0876 1.0779 1.0842 1.0992 1.1095 1.1112 1.1116 1.1152 1.1156 + 1.0876 1.1050 1.1156 1.1152 1.1116 1.1112 1.1095 1.0992 1.0842 1.0779 + 0.94326 1.0085 1.0779 1.1112 1.1144 1.1116 1.0992 1.0539 0.98241 0.93193 + 0.67069 0.76661 0.93194 1.0614 1.1112 1.1152 1.0842 0.98241 0.81851 0.69072 + 0.45701 0.50946 0.69072 0.93193 1.0779 1.1156 1.0779 0.93193 0.69072 0.50946 + 0.52858 0.50946 0.60934 0.81850 1.0151 1.1036 1.1141 1.0578 0.89457 0.67069 + 0.50946 0.45700 0.50945 0.69070 0.93193 1.0779 1.1156 1.0779 0.93194 0.69072 + 0.60934 0.50945 0.52857 0.67068 0.89457 1.0578 1.1141 1.1036 1.0151 0.81851 + 0.81850 0.69070 0.67068 0.76660 0.93194 1.0614 1.1112 1.1152 1.0842 0.98241 + 1.0151 0.93193 0.89457 0.93194 1.0151 1.0842 1.1103 1.1130 1.1103 1.0842 + 1.1036 1.0779 1.0578 1.0614 1.0842 1.1053 1.1116 1.1104 1.1130 1.1152 + 1.1141 1.1156 1.1141 1.1112 1.1103 1.1116 1.1126 1.1116 1.1103 1.1112 + 1.0578 1.0779 1.1036 1.1152 1.1130 1.1104 1.1116 1.1053 1.0842 1.0614 + 0.89457 0.93194 1.0151 1.0842 1.1103 1.1130 1.1103 1.0842 1.0151 0.93194 + 0.67069 0.69072 0.81851 0.98241 1.0842 1.1152 1.1112 1.0614 0.93194 0.76661 + 0.81819 0.76660 0.81850 0.94191 1.0539 1.1053 1.1164 1.1090 1.0578 0.94326 + 0.76660 0.67068 0.69070 0.81851 0.98242 1.0842 1.1152 1.1112 1.0614 0.93193 + 0.81850 0.69070 0.67068 0.76660 0.93194 1.0614 1.1112 1.1152 1.0842 0.98241 + 0.94191 0.81851 0.76660 0.81819 0.94327 1.0578 1.1090 1.1164 1.1053 1.0539 + 1.0539 0.98242 0.93194 0.94327 1.0085 1.0779 1.1112 1.1144 1.1116 1.0992 + 1.1053 1.0842 1.0614 1.0578 1.0779 1.1036 1.1152 1.1130 1.1104 1.1116 + 1.1164 1.1152 1.1112 1.1090 1.1112 1.1152 1.1164 1.1144 1.1130 1.1144 + 1.1090 1.1112 1.1152 1.1164 1.1144 1.1130 1.1144 1.1164 1.1152 1.1112 + 1.0578 1.0614 1.0842 1.1053 1.1116 1.1104 1.1130 1.1152 1.1036 1.0779 + 0.94326 0.93193 0.98241 1.0539 1.0992 1.1116 1.1144 1.1112 1.0779 1.0085 + 1.0415 1.0084 1.0151 1.0539 1.0926 1.1095 1.1126 1.1164 1.1141 1.0876 + 1.0084 0.94324 0.93193 0.98242 1.0540 1.0992 1.1116 1.1144 1.1112 1.0779 + 1.0151 0.93193 0.89457 0.93194 1.0151 1.0842 1.1103 1.1130 1.1103 1.0842 + 1.0539 0.98242 0.93194 0.94327 1.0085 1.0779 1.1112 1.1144 1.1116 1.0992 + 1.0926 1.0540 1.0151 1.0085 1.0416 1.0876 1.1141 1.1164 1.1126 1.1095 + 1.1095 1.0992 1.0842 1.0779 1.0876 1.1050 1.1156 1.1152 1.1116 1.1112 + 1.1126 1.1116 1.1103 1.1112 1.1141 1.1156 1.1141 1.1112 1.1103 1.1116 + 1.1164 1.1144 1.1130 1.1144 1.1164 1.1152 1.1112 1.1090 1.1112 1.1152 + 1.1141 1.1112 1.1103 1.1116 1.1126 1.1116 1.1103 1.1112 1.1141 1.1156 + 1.0876 1.0779 1.0842 1.0992 1.1095 1.1112 1.1116 1.1152 1.1156 1.1050 + 1.1062 1.1050 1.1036 1.1053 1.1095 1.1117 1.1095 1.1053 1.1036 1.1050 + 1.1050 1.0876 1.0779 1.0842 1.0992 1.1095 1.1112 1.1116 1.1152 1.1156 + 1.1036 1.0779 1.0578 1.0614 1.0842 1.1053 1.1116 1.1104 1.1130 1.1152 + 1.1053 1.0842 1.0614 1.0578 1.0779 1.1036 1.1152 1.1130 1.1104 1.1116 + 1.1095 1.0992 1.0842 1.0779 1.0876 1.1050 1.1156 1.1152 1.1116 1.1112 + 1.1117 1.1095 1.1053 1.1036 1.1050 1.1062 1.1050 1.1036 1.1053 1.1095 + 1.1095 1.1112 1.1116 1.1152 1.1156 1.1050 1.0876 1.0779 1.0842 1.0992 + 1.1053 1.1116 1.1104 1.1130 1.1152 1.1036 1.0779 1.0578 1.0614 1.0842 + 1.1036 1.1152 1.1130 1.1104 1.1116 1.1053 1.0842 1.0614 1.0578 1.0779 + 1.1050 1.1156 1.1152 1.1116 1.1112 1.1095 1.0992 1.0842 1.0779 1.0876 + 1.0415 1.0876 1.1141 1.1164 1.1126 1.1095 1.0926 1.0539 1.0151 1.0084 + 1.0876 1.1050 1.1156 1.1152 1.1116 1.1112 1.1095 1.0992 1.0842 1.0779 + 1.1141 1.1156 1.1141 1.1112 1.1103 1.1116 1.1126 1.1116 1.1103 1.1112 + 1.1164 1.1152 1.1112 1.1090 1.1112 1.1152 1.1164 1.1144 1.1130 1.1144 + 1.1126 1.1116 1.1103 1.1112 1.1141 1.1156 1.1141 1.1112 1.1103 1.1116 + 1.1095 1.1112 1.1116 1.1152 1.1156 1.1050 1.0876 1.0779 1.0842 1.0992 + 1.0926 1.1095 1.1126 1.1164 1.1141 1.0876 1.0416 1.0085 1.0151 1.0540 + 1.0539 1.0992 1.1116 1.1144 1.1112 1.0779 1.0085 0.94327 0.93194 0.98242 + 1.0151 1.0842 1.1103 1.1130 1.1103 1.0842 1.0151 0.93194 0.89457 0.93193 + 1.0084 1.0779 1.1112 1.1144 1.1116 1.0992 1.0540 0.98242 0.93193 0.94324 + 0.81819 0.94326 1.0578 1.1090 1.1164 1.1053 1.0539 0.94191 0.81850 0.76660 + 0.94326 1.0085 1.0779 1.1112 1.1144 1.1116 1.0992 1.0539 0.98241 0.93193 + 1.0578 1.0779 1.1036 1.1152 1.1130 1.1104 1.1116 1.1053 1.0842 1.0614 + 1.1090 1.1112 1.1152 1.1164 1.1144 1.1130 1.1144 1.1164 1.1152 1.1112 + 1.1164 1.1144 1.1130 1.1144 1.1164 1.1152 1.1112 1.1090 1.1112 1.1152 + 1.1053 1.1116 1.1104 1.1130 1.1152 1.1036 1.0779 1.0578 1.0614 1.0842 + 1.0539 1.0992 1.1116 1.1144 1.1112 1.0779 1.0085 0.94327 0.93194 0.98242 + 0.94191 1.0539 1.1053 1.1164 1.1090 1.0578 0.94327 0.81819 0.76660 0.81851 + 0.81850 0.98241 1.0842 1.1152 1.1112 1.0614 0.93194 0.76660 0.67068 0.69070 + 0.76660 0.93193 1.0614 1.1112 1.1152 1.0842 0.98242 0.81851 0.69070 0.67068 + 0.52858 0.67069 0.89457 1.0578 1.1141 1.1036 1.0151 0.81850 0.60934 0.50946 + 0.67069 0.76661 0.93194 1.0614 1.1112 1.1152 1.0842 0.98241 0.81851 0.69072 + 0.89457 0.93194 1.0151 1.0842 1.1103 1.1130 1.1103 1.0842 1.0151 0.93194 + 1.0578 1.0614 1.0842 1.1053 1.1116 1.1104 1.1130 1.1152 1.1036 1.0779 + 1.1141 1.1112 1.1103 1.1116 1.1126 1.1116 1.1103 1.1112 1.1141 1.1156 + 1.1036 1.1152 1.1130 1.1104 1.1116 1.1053 1.0842 1.0614 1.0578 1.0779 + 1.0151 1.0842 1.1103 1.1130 1.1103 1.0842 1.0151 0.93194 0.89457 0.93193 + 0.81850 0.98241 1.0842 1.1152 1.1112 1.0614 0.93194 0.76660 0.67068 0.69070 + 0.60934 0.81851 1.0151 1.1036 1.1141 1.0578 0.89457 0.67068 0.52857 0.50945 + 0.50946 0.69072 0.93194 1.0779 1.1156 1.0779 0.93193 0.69070 0.50945 0.45700 + 0.40130 0.45701 0.67069 0.94326 1.0876 1.1050 1.0084 0.76660 0.50946 0.40785 + 0.45701 0.50946 0.69072 0.93193 1.0779 1.1156 1.0779 0.93193 0.69072 0.50946 + 0.67069 0.69072 0.81851 0.98241 1.0842 1.1152 1.1112 1.0614 0.93194 0.76661 + 0.94326 0.93193 0.98241 1.0539 1.0992 1.1116 1.1144 1.1112 1.0779 1.0085 + 1.0876 1.0779 1.0842 1.0992 1.1095 1.1112 1.1116 1.1152 1.1156 1.1050 + 1.1050 1.1156 1.1152 1.1116 1.1112 1.1095 1.0992 1.0842 1.0779 1.0876 + 1.0084 1.0779 1.1112 1.1144 1.1116 1.0992 1.0540 0.98242 0.93193 0.94324 + 0.76660 0.93193 1.0614 1.1112 1.1152 1.0842 0.98242 0.81851 0.69070 0.67068 + 0.50946 0.69072 0.93194 1.0779 1.1156 1.0779 0.93193 0.69070 0.50945 0.45700 + 0.40785 0.50946 0.76661 1.0085 1.1050 1.0876 0.94324 0.67068 0.45700 0.40129 diff --git a/ase/utils/plotting.py b/ase/utils/plotting.py index 4acc83661e..18612e52eb 100644 --- a/ase/utils/plotting.py +++ b/ase/utils/plotting.py @@ -1,12 +1,10 @@ -# This import is for the benefit of type-checking / mypy -if False: - import matplotlib.axes - import matplotlib.figure +import matplotlib.pyplot as plt +from matplotlib.axes import Axes class SimplePlottingAxes: def __init__(self, - ax: 'matplotlib.axes.Axes' = None, + ax: Axes = None, show: bool = False, filename: str = None) -> None: self.ax = ax @@ -14,9 +12,8 @@ class SimplePlottingAxes: self.filename = filename self.figure = None - def __enter__(self) -> 'matplotlib.axes.Axes': + def __enter__(self) -> Axes: if self.ax is None: - import matplotlib.pyplot as plt self.figure, self.ax = plt.subplots() else: self.figure = self.ax.get_figure() diff --git a/doc/ase/calculators/calculators.rst b/doc/ase/calculators/calculators.rst index 917ae5c7ec..7fe28a9101 100644 --- a/doc/ase/calculators/calculators.rst +++ b/doc/ase/calculators/calculators.rst @@ -148,7 +148,7 @@ where ``abc`` is the module name and ``ABC`` is the class name. .. _Asap: https://wiki.fysik.dtu.dk/asap .. _BigDFT: https://l_sim.gitlab.io/bigdft-suite/tutorials/Interoperability-Simulation.html#ASE-Interoperability .. _CHGNet: https://github.com/CederGroupHub/chgnet/blob/e2a2b82bf2c64e5a3d39cd75d0addfa864a2771a/chgnet/model/dynamics.py#L63 -.. _GPAW: https://wiki.fysik.dtu.dk/gpaw +.. _GPAW: https://gpaw.readthedocs.io .. _Hotbit: https://github.com/pekkosk/hotbit .. _DFTK: https://dftk.org .. _DeePMD-kit: https://github.com/deepmodeling/deepmd-kit diff --git a/doc/ase/calculators/qmmm.rst b/doc/ase/calculators/qmmm.rst index a4b4361937..1567f09fa1 100644 --- a/doc/ase/calculators/qmmm.rst +++ b/doc/ase/calculators/qmmm.rst @@ -29,7 +29,7 @@ Other ASE-calculators that currently support EIQMMM: 3. :mod:`TURBOMOLE ` 4. :mod:`ORCA ` -.. _GPAW: https://wiki.fysik.dtu.dk/gpaw +.. _GPAW: https://gpaw.readthedocs.io .. seealso:: diff --git a/doc/ase/dft/bader.rst b/doc/ase/dft/bader.rst index 54ea92f0e4..fa564b7ca6 100644 --- a/doc/ase/dft/bader.rst +++ b/doc/ase/dft/bader.rst @@ -4,7 +4,8 @@ Bader Analysis An example of Bader analysis: `The water molecule`_. -.. _The water molecule: https://wiki.fysik.dtu.dk/gpaw/tutorials/bader/bader.html +.. _The water molecule: https://gpaw.readthedocs.io/tutorialsexercises/ + wavefunctions/charge/charge.html#bader You can attach the output charges from the bader program to the atoms for further processing:: diff --git a/doc/ase/dft/stm.rst b/doc/ase/dft/stm.rst index 661faa696c..3d19af1d12 100644 --- a/doc/ase/dft/stm.rst +++ b/doc/ase/dft/stm.rst @@ -25,9 +25,7 @@ and `\Psi_{\mathbf k n}(\mathbf r)` is the wave function. .. seealso:: * `Tutorial using GPAW - `__ - * `Execise using GPAW - `__ + `__ More details: diff --git a/doc/ase/neb.rst b/doc/ase/neb.rst index 32960bf6ba..cb82acf474 100644 --- a/doc/ase/neb.rst +++ b/doc/ase/neb.rst @@ -252,9 +252,10 @@ only some of them have a calculator attached:: Create the NEB object with ``NEB(images, parallel=True)``. For a complete example using GPAW_, see here_. -.. _GPAW: https://wiki.fysik.dtu.dk/gpaw -.. _gpaw-python: https://wiki.fysik.dtu.dk/gpaw/documentation/manual.html#parallel-calculations -.. _here: https://wiki.fysik.dtu.dk/gpaw/tutorials/neb/neb.html +.. _GPAW: https://gpaw.readthedocs.io/ +.. _gpaw-python: https://gpaw.readthedocs.io/documentation/parallel_runs/parallel_runs.html +.. _here: https://gpaw.readthedocs.io/tutorialsexercises/moleculardynamics/neb/neb.html + Using Shared Calculators ======================== diff --git a/doc/ase/neighborlist.rst b/doc/ase/neighborlist.rst index bbe5b09084..0e2303d4b5 100644 --- a/doc/ase/neighborlist.rst +++ b/doc/ase/neighborlist.rst @@ -33,4 +33,4 @@ ___ .. automodule:: ase.neighborlist :members: -.. _GPAW: http://wiki.fysik.dtu.dk/gpaw +.. _GPAW: http://gpaw.readthedocs.io diff --git a/doc/ase/optimize.rst b/doc/ase/optimize.rst index 6f8f457d5d..f84bc90dcb 100644 --- a/doc/ase/optimize.rst +++ b/doc/ase/optimize.rst @@ -34,7 +34,7 @@ The local optimization algorithms available in ASE are: :class:`BFGS`, .. seealso:: `Performance test - `_ + `_ for all ASE local optimizers. diff --git a/doc/ase/vibrations/raman.rst b/doc/ase/vibrations/raman.rst index e4c2b58eee..fe99df3013 100644 --- a/doc/ase/vibrations/raman.rst +++ b/doc/ase/vibrations/raman.rst @@ -140,7 +140,7 @@ Their sum should give ``approximation='Albrecht'``. See more details in [1]_. -.. _GPAW: https://wiki.fysik.dtu.dk/gpaw/ +.. _GPAW: https://gpaw.readthedocs.io/ .. [1] :doi:`Ab-initio wave-length dependent Raman spectra: Placzek approximation and beyond <10.1021/acs.jctc.9b00584>` diff --git a/doc/conf.py b/doc/conf.py index 3e1ecb189a..d9ea03996c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -50,7 +50,7 @@ latex_engine = 'xelatex' latex_documents = [ ('index', 'ASE.tex', 'ASE', 'ASE-developers', 'howto', not True)] -intersphinx_mapping = {'gpaw': ('https://wiki.fysik.dtu.dk/gpaw', None), +intersphinx_mapping = {'gpaw': ('https://gpaw.readthedocs.io', None), 'python': ('https://docs.python.org/3.10', None)} # Avoid GUI windows during doctest: diff --git a/doc/development/licenseinfo.rst b/doc/development/licenseinfo.rst index 5505d95122..6be311bd49 100644 --- a/doc/development/licenseinfo.rst +++ b/doc/development/licenseinfo.rst @@ -91,7 +91,7 @@ for the following reasons: .. _LGPL: http://www.gnu.org/licenses/lgpl-3.0.html .. _GPL: http://www.gnu.org/licenses/gpl-3.0.html .. _`LGPL on Wikipedia`: https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License -.. _GPAW: https://wiki.fysik.dtu.dk/gpaw +.. _GPAW: https://gpaw.readthedocs.io .. _Asap: https://wiki.fysik.dtu.dk/asap .. _`statement by Fedora`: https://fedoraproject.org/wiki/Licensing:FAQ?rd=Licensing/FAQ#Linking_and_multiple_licenses diff --git a/doc/gettingstarted/cluster/cluster.rst b/doc/gettingstarted/cluster/cluster.rst index 7ea62c1515..7c67916ddd 100644 --- a/doc/gettingstarted/cluster/cluster.rst +++ b/doc/gettingstarted/cluster/cluster.rst @@ -112,7 +112,7 @@ strongly size dependent. The above analysis is speculative. To verify the analysis we would want to calculate s, p, and d-projected DOS to see if our assumptions were correct. In case we want to go on doing this, -the GPAW documentation will be of help, see: `GPAW DOS `__. +the GPAW documentation will be of help, see: `GPAW DOS `__. Solutions diff --git a/doc/gettingstarted/external_calculators/ext_intro.rst b/doc/gettingstarted/external_calculators/ext_intro.rst index cda979564b..631e801ef8 100644 --- a/doc/gettingstarted/external_calculators/ext_intro.rst +++ b/doc/gettingstarted/external_calculators/ext_intro.rst @@ -4,7 +4,7 @@ External calculators Many external calculators can be used with ASE, including GPAW_, Abinit_, Vasp_, Siesta_, `Quantum ESPRESSO`_, Asap_, LAMMPS_ and many more, see :ref:`supported calculators` for the full list. .. _Asap: http://wiki.fysik.dtu.dk/asap -.. _GPAW: http://wiki.fysik.dtu.dk/gpaw +.. _GPAW: http://gpaw.readthedocs.io .. _Siesta: http://www.icmab.es/siesta .. _Abinit: https://www.abinit.org .. _Vasp: https://www.vasp.at diff --git a/doc/index.rst b/doc/index.rst index eb39483d2f..654badb829 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -254,7 +254,7 @@ Contents :target: ase/calculators/gamess_us.html :align: middle .. |gpaw| image:: static/gpaw.png - :target: https://wiki.fysik.dtu.dk/gpaw/ + :target: https://gpaw.readthedocs.io/ :align: middle .. |gromacs| image:: static/gromacs.png :target: ase/calculators/gromacs.html diff --git a/doc/install.rst b/doc/install.rst index d305bec684..3d122ac235 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -7,7 +7,7 @@ Installation Requirements ============ -* Python_ 3.8 or newer +* Python_ 3.9 or newer * NumPy_ (base N-dimensional array package) * SciPy_ (library for scientific computing) * Matplotlib_ (plotting) diff --git a/doc/logo.py b/doc/logo.py index 241f38f621..209ef39b0b 100644 --- a/doc/logo.py +++ b/doc/logo.py @@ -1,4 +1,6 @@ +import matplotlib.pyplot as plt import numpy as np +from gpaw import GPAW from ase import Atom, Atoms @@ -19,27 +21,20 @@ for i, line in enumerate(ase.split('\n')): logo.set_cell((15, 15, 2)) logo.center() -if 1: - from gpaw import GPAW - calc = GPAW() - logo.calc = calc - e = logo.get_potential_energy() - calc.write('logo2.gpw') -if 0: - from gpaw import GPAW - calc = GPAW('logo2.gpw', idiotproof=0) +calc = GPAW() +logo.calc = calc +e = logo.get_potential_energy() +calc.write('logo2.gpw') +print(calc.density.nt_sg.shape) +n = calc.density.nt_sg[0, :, :, 10] +# 1c4e63 +c0 = np.array([19, 63, 82.0]).reshape((3, 1, 1)) / 255 +c1 = np.array([1.0, 1, 0]).reshape((3, 1, 1)) +a = c0 + n / n.max() * (c1 - c0) +print(a.shape) -if 1: - print(calc.density.nt_sg.shape) - n = calc.density.nt_sg[0, :, :, 10] - # 1c4e63 - c0 = np.array([19, 63, 82.0]).reshape((3, 1, 1)) / 255 - c1 = np.array([1.0, 1, 0]).reshape((3, 1, 1)) - a = c0 + n / n.max() * (c1 - c0) - import pylab as p - print(a.shape) - i = p.imshow(a.T, aspect=True) - i.write_png('ase.png') - p.axis('off') - p.savefig('ase2.png', dpi=200) +i = plt.imshow(a.T, aspect=True) +i.write_png('ase.png') +plt.axis('off') +plt.savefig('ase2.png', dpi=200) diff --git a/doc/releasenotes.rst b/doc/releasenotes.rst index 28835b46bc..61b06e54e3 100644 --- a/doc/releasenotes.rst +++ b/doc/releasenotes.rst @@ -1276,7 +1276,7 @@ Algorithms: * New Gaussian Process (GP) regression optimizer (:class:`~ase.optimize.GPMin`). Check out this `performance test - `_. + `_. * New filter for lattice optimization, :class:`~ase.constraints.ExpCellFilter`, based on an exponential @@ -1982,7 +1982,7 @@ Version 3.5.0 .. _ASAP: https://wiki.fysik.dtu.dk/asap -.. _GPAW: https://wiki.fysik.dtu.dk/gpaw/documentation/xc/vdwcorrection.html +.. _GPAW: https://gpaw.readthedocs.io/documentation/xc/vdwcorrection.html Version 3.4.1 diff --git a/doc/tutorials/qmmm/qmmm.rst b/doc/tutorials/qmmm/qmmm.rst index dbe1c70e28..8205a551f1 100644 --- a/doc/tutorials/qmmm/qmmm.rst +++ b/doc/tutorials/qmmm/qmmm.rst @@ -37,7 +37,7 @@ To see examples of how to make point charge potentials for EIQMMM, have a look at the :class:`~ase.calculators.dftb.PointChargePotential` classes in any of the calculators above. -.. _GPAW: https://wiki.fysik.dtu.dk/gpaw/ +.. _GPAW: https://gpaw.readthedocs.io/ .. _DFTBplus: https://wiki.fysik.dtu.dk/ase/ase/calculators/dftb.html .. _CRYSTAL: https://wiki.fysik.dtu.dk/ase/ase/calculators/crystal.html .. _TURBOMOLE: https://wiki.fysik.dtu.dk/ase/ase/calculators/turbomole.html diff --git a/doc/tutorials/tut03_vibrations/vibrations.rst b/doc/tutorials/tut03_vibrations/vibrations.rst index 83fb255e53..1459c41e43 100644 --- a/doc/tutorials/tut03_vibrations/vibrations.rst +++ b/doc/tutorials/tut03_vibrations/vibrations.rst @@ -65,4 +65,4 @@ the density, or effects of the simulation box size. A solution and other comments to this exercise can be found on the GPAW web page: -https://wiki.fysik.dtu.dk/gpaw/exercises/vibrations/vibrations.html +https://gpaw.readthedocs.io/tutorialsexercises/vibrational/vibrations/vibrations.html \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 54ad1815a9..80cee0bb1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,6 @@ classifiers = [ 'Intended Audience :: Science/Research', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', @@ -23,9 +22,9 @@ classifiers = [ 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Physics' ] -requires-python = '>=3.8' +requires-python = '>=3.9' dependencies = [ - 'numpy>=1.18.5', # June 2020 + 'numpy>=1.19.5', # January 2021 'scipy>=1.6.0', # December 2020 'matplotlib>=3.3.4' # January 2021 (3.3.0 is July 2020) ] -- GitLab From 3c92250459104a83b1a4c71da4829b50970e75da Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" Date: Fri, 11 Oct 2024 10:49:43 +0100 Subject: [PATCH 2/4] WIP remove ASE from repo --- CHANGELOG.rst | 6 - CONTRIBUTING.rst | 6 - LICENSE | 6 +- README.rst | 35 +- appveyor.yml | 63 - ase_pwmat/__init__.py | 3 + .../pwmat.py => ase_pwmat/calculator.py | 0 ase/io/pwmat.py => ase_pwmat/io.py | 0 .../namelist}/__init__.py | 0 .../namelist}/keys.py | 0 .../namelist}/namelist.py | 0 bin/ase | 4 - doc/.gitignore | 18 - doc/ASE.bib | 48 - doc/Makefile | 62 - doc/about.rst | 58 - doc/ase-gui.desktop | 14 - doc/ase/ase.rst | 90 - doc/ase/atom.rst | 117 - doc/ase/atoms.py | 19 - doc/ase/atoms.rst | 373 --- doc/ase/build/build.rst | 206 -- doc/ase/build/connected.rst | 8 - doc/ase/build/general_surface.py | 54 - doc/ase/build/general_surface.tex | 295 --- doc/ase/build/structure.py | 26 - doc/ase/build/surface.py | 67 - doc/ase/build/surface.rst | 281 --- doc/ase/build/tools.rst | 14 - doc/ase/calculators/FHI-aims.rst | 114 - doc/ase/calculators/INCAR_NaCl | 5 - doc/ase/calculators/NaCl.py | 15 - doc/ase/calculators/abinit.rst | 87 - doc/ase/calculators/ace.rst | 101 - doc/ase/calculators/amber.rst | 63 - doc/ase/calculators/ase_castep_demo.py | 71 - doc/ase/calculators/calculators.rst | 263 --- doc/ase/calculators/castep.rst | 18 - doc/ase/calculators/checkpointing.rst | 124 - doc/ase/calculators/cp2k.rst | 6 - doc/ase/calculators/crystal.rst | 180 -- doc/ase/calculators/demon.rst | 8 - doc/ase/calculators/demonnano.rst | 35 - doc/ase/calculators/demonnano_ex1_relax.py | 26 - doc/ase/calculators/dftb.rst | 142 -- doc/ase/calculators/dftb_ex1_relax.py | 16 - doc/ase/calculators/dftb_ex2_relaxbyDFTB.py | 21 - doc/ase/calculators/dftb_ex3_make_2h2o.py | 76 - doc/ase/calculators/dftd3.rst | 110 - doc/ase/calculators/dftd3_alone.py | 7 - doc/ase/calculators/dftd3_gpaw.py | 21 - doc/ase/calculators/dmol.rst | 81 - doc/ase/calculators/eam.rst | 17 - doc/ase/calculators/emt.rst | 359 --- doc/ase/calculators/espresso.rst | 316 --- doc/ase/calculators/exciting.py | 24 - doc/ase/calculators/exciting.rst | 123 - doc/ase/calculators/fleur.rst | 13 - doc/ase/calculators/gamess_us.rst | 123 - doc/ase/calculators/gaussian.rst | 244 -- doc/ase/calculators/gromacs.rst | 110 - .../calculators/gromacs_example_mm_relax.py | 28 - .../calculators/gromacs_example_mm_relax2.py | 46 - doc/ase/calculators/gulp.rst | 63 - doc/ase/calculators/gulp_example.py | 65 - doc/ase/calculators/harmonic.rst | 198 -- doc/ase/calculators/his.pdb | 15 - doc/ase/calculators/jacapo.rst | 13 - doc/ase/calculators/kim.rst | 207 -- doc/ase/calculators/lammps.rst | 50 - doc/ase/calculators/lammpslib.rst | 7 - doc/ase/calculators/lammpsrun.rst | 21 - doc/ase/calculators/loggingcalc.rst | 8 - doc/ase/calculators/mixing.rst | 19 - doc/ase/calculators/mopac.rst | 8 - doc/ase/calculators/nwchem.rst | 152 -- doc/ase/calculators/octopus.rst | 105 - doc/ase/calculators/octopus_h2o.py | 13 - doc/ase/calculators/octopus_silicon.py | 15 - doc/ase/calculators/onetep.rst | 239 -- doc/ase/calculators/openmx.rst | 314 --- doc/ase/calculators/orca.rst | 63 - doc/ase/calculators/others.rst | 35 - doc/ase/calculators/plumed.rst | 81 - doc/ase/calculators/psi4.rst | 92 - doc/ase/calculators/qchem.rst | 50 - doc/ase/calculators/qmmm.rst | 108 - doc/ase/calculators/siesta.rst | 330 --- .../calculators/socketio/example_abinit.py | 53 - doc/ase/calculators/socketio/example_aims.py | 34 - .../socketio/example_client_gpaw.py | 21 - doc/ase/calculators/socketio/example_dftb.py | 20 - .../calculators/socketio/example_espresso.py | 46 - .../calculators/socketio/example_nwchem.py | 23 - .../calculators/socketio/example_server.py | 26 - .../calculators/socketio/example_siesta.py | 33 - doc/ase/calculators/socketio/socketio.rst | 135 -- doc/ase/calculators/spc216.gro | 651 ------ doc/ase/calculators/test.rst | 9 - doc/ase/calculators/turbomole.rst | 474 ---- doc/ase/calculators/vasp.rst | 601 ----- doc/ase/calculators/vasp_si_bandstructure.py | 175 -- doc/ase/cell.rst | 36 - doc/ase/cluster/cluster.py | 34 - doc/ase/cluster/cluster.rst | 128 -- doc/ase/collections.rst | 102 - doc/ase/constraints.rst | 417 ---- doc/ase/data.rst | 245 -- doc/ase/db/db.py | 62 - doc/ase/db/db.rst | 596 ----- doc/ase/dft/bader.rst | 20 - doc/ase/dft/bandgap.rst | 8 - doc/ase/dft/bs.py | 10 - doc/ase/dft/bz.py | 42 - doc/ase/dft/dft.rst | 16 - doc/ase/dft/dos.py | 32 - doc/ase/dft/dos.rst | 42 - doc/ase/dft/kpoints.py | 11 - doc/ase/dft/kpoints.rst | 179 -- doc/ase/dft/stm.rst | 33 - doc/ase/dft/wannier.rst | 104 - doc/ase/dimer.rst | 26 - doc/ase/eos.rst | 17 - doc/ase/filters.rst | 82 - doc/ase/fix_symmetry_example.py | 53 - doc/ase/formats.py | 13 - doc/ase/formula.rst | 19 - doc/ase/ga/ga.rst | 47 - doc/ase/geometry.rst | 53 - doc/ase/gui/basics.rst | 175 -- doc/ase/gui/calculate.rst | 30 - doc/ase/gui/edit.rst | 15 - doc/ase/gui/gui.rst | 28 - doc/ase/gui/setup.rst | 11 - doc/ase/gui/tools.rst | 90 - doc/ase/gui/view.rst | 32 - doc/ase/io/172_ext.xyz | 11 - doc/ase/io/io.rst | 179 -- doc/ase/io/io_csv.py | 16 - doc/ase/io/io_formats.py | 29 - doc/ase/io/iopng.py | 24 - doc/ase/io/opls.py | 4 - doc/ase/io/opls.rst | 39 - doc/ase/io/save_C2H4.py | 18 - doc/ase/io/save_pov.py | 61 - doc/ase/io/trajectory.rst | 164 -- doc/ase/io/ulm.rst | 1 - doc/ase/io/view_172_mod.py | 8 - doc/ase/io/write_lammps.py | 6 - doc/ase/lattice.rst | 274 --- doc/ase/md.rst | 411 ---- doc/ase/mep.rst | 10 - doc/ase/neb.rst | 295 --- doc/ase/neighborlist.rst | 36 - doc/ase/optimize.rst | 540 ----- doc/ase/parallel.rst | 29 - doc/ase/phasediagram/cuau.py | 14 - doc/ase/phasediagram/ktao.py | 15 - doc/ase/phasediagram/phasediagram.rst | 123 - doc/ase/phasediagram/zno.py | 17 - doc/ase/phonons.rst | 47 - doc/ase/phonons_Al_fcc.py | 57 - doc/ase/plot_radii.py | 21 - doc/ase/precon.py | 27 - doc/ase/spacegroup/spacegroup-al.py | 4 - doc/ase/spacegroup/spacegroup-cosb3.py | 37 - doc/ase/spacegroup/spacegroup-diamond.py | 5 - doc/ase/spacegroup/spacegroup-fe.py | 4 - doc/ase/spacegroup/spacegroup-mg.py | 6 - doc/ase/spacegroup/spacegroup-nacl.py | 5 - doc/ase/spacegroup/spacegroup-rutile.py | 6 - doc/ase/spacegroup/spacegroup-skutterudite.py | 7 - doc/ase/spacegroup/spacegroup.py | 21 - doc/ase/spacegroup/spacegroup.rst | 205 -- doc/ase/spectrum/doscollection.rst | 22 - doc/ase/spectrum/dosdata.rst | 35 - doc/ase/spectrum/spectrum.rst | 12 - doc/ase/symbols.rst | 7 - doc/ase/thermochemistry/ethane.py | 47 - doc/ase/thermochemistry/gold.py | 32 - doc/ase/thermochemistry/nitrogen.py | 22 - doc/ase/thermochemistry/thermochemistry.py | 32 - doc/ase/thermochemistry/thermochemistry.rst | 418 ---- doc/ase/transport/transport.rst | 93 - doc/ase/transport/transport_setup.py | 98 - doc/ase/units.rst | 79 - doc/ase/utils.rst | 41 - doc/ase/vibrations/H2Morse_calc_overlap.py | 7 - doc/ase/vibrations/H2O_EMT.py | 13 - doc/ase/vibrations/H2O_EMT_summary.txt | 14 - doc/ase/vibrations/H2_ir.py | 23 - doc/ase/vibrations/H2_optical.py | 21 - doc/ase/vibrations/H2_optical_overlap.py | 23 - doc/ase/vibrations/franck_condon.rst | 76 - doc/ase/vibrations/infrared.rst | 12 - doc/ase/vibrations/modes.rst | 55 - doc/ase/vibrations/raman.rst | 146 -- doc/ase/vibrations/vibrations.rst | 14 - doc/ase/visualize/matplotlib_plot_atoms.py | 43 - doc/ase/visualize/mlab_options.py | 5 - doc/ase/visualize/stem_image.jpg | Bin 24450 -> 0 bytes doc/ase/visualize/visualize.rst | 180 -- doc/ase/xrdebye.py | 18 - doc/ase/xrdebye.rst | 122 - doc/cmdline.rst | 89 - doc/conf.py | 65 - doc/contact.rst | 42 - doc/development/bugs.rst | 39 - doc/development/calculators.rst | 47 - doc/development/contribute.rst | 358 --- doc/development/development.rst | 24 - doc/development/licenseinfo.rst | 97 - doc/development/making_movies.rst | 100 - doc/development/newrelease.rst | 81 - doc/development/proposals/calculators.rst | 186 -- doc/development/proposals/labels.rst | 120 - doc/development/proposals/proposals.rst | 8 - doc/development/python_codingstandard.rst | 125 -- doc/development/tests.rst | 102 - doc/development/translate.rst | 108 - doc/development/writepngs.py | 17 - doc/development/writing_documentation_ase.rst | 148 -- .../ASE-3.14.1-foss-2016b-Python-2.7.12.eb | 27 - .../ASE-3.14.1-foss-2016b-Python-3.5.2.eb | 27 - .../ASE-3.15.0-foss-2016b-Python-2.7.12.eb | 27 - .../ASE-3.15.0-foss-2016b-Python-3.5.2.eb | 27 - .../ASE-3.15.0-foss-2017b-Python-3.6.2.eb | 27 - doc/ecosystem.rst | 131 -- doc/faq.rst | 80 - doc/gallery/gallery.rst | 98 - doc/gallery/o2pt100.py | 70 - doc/gallery/ptable.py | 8 - doc/gallery/render_all_povray_styles.py | 33 - .../tuning_povray_for_high_quality_images.py | 121 - doc/gettingstarted/N2Cu.py | 25 - doc/gettingstarted/cluster/cluster.rst | 131 -- .../cluster/solution/Ag_part1_optimise.py | 8 - .../cluster/solution/Ag_part2_groundstate.py | 13 - .../cluster/solution/Ag_part3_dos.py | 16 - .../external_calculators/ext_intro.rst | 86 - doc/gettingstarted/gettingstarted.rst | 35 - doc/gettingstarted/manipulating_atoms/WL.py | 22 - .../manipulating_atoms/interface-h2o.py | 53 - .../manipulating_atoms/manipulating_atoms.py | 53 - .../manipulating_atoms/manipulating_atoms.rst | 151 -- doc/gettingstarted/surface.py | 10 - doc/gettingstarted/surface.rst | 180 -- .../tut01_molecule/molecule.rst | 215 -- .../tut01_molecule/solution/binding_curve.py | 25 - .../solution/plot_binding_curve.py | 16 - .../tut01_molecule/solution/spinpol.py | 11 - .../tut02_h2o_structure/h2o.rst | 225 -- .../tut02_h2o_structure/solution/optimise.py | 14 - .../solution/optimise_aims.py | 17 - .../solution/optimise_aims_socketio.py | 21 - doc/gettingstarted/tut04_bulk/bulk.rst | 323 --- .../solution/bulk_part1_groundstate.py | 10 - .../tut04_bulk/solution/bulk_part2_dos.py | 17 - .../solution/bulk_part3_bandstructure.py | 11 - .../tut04_bulk/solution/bulk_part4_cellopt.py | 26 - .../solution/bulk_part5_rutile_bands.py | 11 - doc/index.rst | 319 --- doc/install.rst | 199 -- doc/logo.py | 40 - doc/numpy.rst | 84 - doc/python.rst | 255 --- doc/releasenotes.rst | 1991 ----------------- ...black-icon-sports-hobbies-film-clapper.png | Bin 3160 -> 0 bytes doc/static/China.png | Bin 2972 -> 0 bytes doc/static/United_States_of_America.png | Bin 3022 -> 0 bytes doc/static/abacus.png | Bin 26922 -> 0 bytes doc/static/abinit.png | Bin 6200 -> 0 bytes doc/static/asap.png | Bin 6388 -> 0 bytes doc/static/ase.css | 13 - doc/static/ase.ico | Bin 2147 -> 0 bytes doc/static/ase.xpm | 1218 ---------- doc/static/ase256.png | Bin 30890 -> 0 bytes doc/static/ase_trac.png | Bin 1207 -> 0 bytes doc/static/atomistica.png | Bin 8988 -> 0 bytes doc/static/bigdft.png | Bin 6132 -> 0 bytes doc/static/castep.png | Bin 7138 -> 0 bytes doc/static/cp2k.png | Bin 6324 -> 0 bytes doc/static/crystal.png | Bin 7912 -> 0 bytes doc/static/deepmd-kit.png | Bin 12844 -> 0 bytes doc/static/demon.png | Bin 8510 -> 0 bytes doc/static/dftb.png | Bin 4395 -> 0 bytes doc/static/dftd4.png | Bin 3028 -> 0 bytes doc/static/dftk.png | Bin 5244 -> 0 bytes doc/static/elk.png | Bin 2075 -> 0 bytes doc/static/emt.png | Bin 926 -> 0 bytes doc/static/espresso.png | Bin 23742 -> 0 bytes doc/static/exciting.png | Bin 7043 -> 0 bytes doc/static/fhi-aims.png | Bin 2397 -> 0 bytes doc/static/fleur.png | Bin 2052 -> 0 bytes doc/static/gamess_us.png | Bin 4690 -> 0 bytes doc/static/gpaw.png | Bin 3253 -> 0 bytes doc/static/gromacs.png | Bin 5158 -> 0 bytes doc/static/hotbit.png | Bin 7331 -> 0 bytes doc/static/jdftx.png | Bin 6585 -> 0 bytes doc/static/kim.png | Bin 7458 -> 0 bytes doc/static/lammps.png | Bin 7928 -> 0 bytes doc/static/nwchem.png | Bin 10283 -> 0 bytes doc/static/octopus.png | Bin 5361 -> 0 bytes doc/static/onetep.png | Bin 3121 -> 0 bytes doc/static/openmx.png | Bin 8206 -> 0 bytes doc/static/orca_logo_mpi.png | Bin 4665 -> 0 bytes doc/static/plumed.png | Bin 6062 -> 0 bytes doc/static/psi4.png | Bin 3860 -> 0 bytes doc/static/qchem.png | Bin 24937 -> 0 bytes doc/static/siesta.png | Bin 3834 -> 0 bytes doc/static/tm_logo_l.png | Bin 2120 -> 0 bytes doc/static/vasp.png | Bin 3653 -> 0 bytes doc/static/xtb.png | Bin 11017 -> 0 bytes doc/templates/breadcrumbs.html | 8 - doc/tips.rst | 98 - doc/tutorials/N2.py | 17 - doc/tutorials/N2Cu-Dissociation1.py | 43 - doc/tutorials/N2Cu-Dissociation2.py | 35 - doc/tutorials/N2Ru-Dissociation1.py | 47 - doc/tutorials/N2Ru-Dissociation2.py | 30 - doc/tutorials/acn_equil/acn_equil.py | 69 - doc/tutorials/acn_equil/acn_equil.rst | 28 - doc/tutorials/atomization.rst | 25 - doc/tutorials/constraints/diffusion.py | 15 - doc/tutorials/constraints/diffusion.rst | 29 - doc/tutorials/constraints/diffusion4.py | 33 - doc/tutorials/db/ads.py | 31 - doc/tutorials/db/bulk.py | 15 - doc/tutorials/db/db.rst | 201 -- doc/tutorials/db/ea.py | 11 - doc/tutorials/db/refs.py | 32 - doc/tutorials/db/run.py | 36 - doc/tutorials/defects/defects.rst | 244 -- doc/tutorials/defects/periodic-images.py | 102 - doc/tutorials/defects/score-size.py | 27 - doc/tutorials/defects/supercells.py | 132 -- doc/tutorials/deltacodesdft/all.py | 6 - doc/tutorials/deltacodesdft/calculate.py | 12 - doc/tutorials/deltacodesdft/deltacodesdft.rst | 75 - doc/tutorials/deltacodesdft/fit.py | 30 - doc/tutorials/deltacodesdft/tables.py | 66 - .../dimensionality/dimensionality.rst | 43 - doc/tutorials/dimensionality/dimexample.py | 16 - .../dimensionality/isolation_example.py | 26 - doc/tutorials/dissociation.rst | 29 - doc/tutorials/eos/eos.py | 5 - doc/tutorials/eos/eos.rst | 30 - doc/tutorials/eos/eos1.py | 18 - doc/tutorials/eos/eos2.py | 12 - .../ga/basic_example_create_database.py | 51 - doc/tutorials/ga/basic_example_main_run.py | 83 - doc/tutorials/ga/ga_basic_calc.py | 23 - doc/tutorials/ga/ga_basic_parallel_main.py | 89 - doc/tutorials/ga/ga_basic_parameters.py | 155 -- doc/tutorials/ga/ga_basic_pbs_main.py | 87 - doc/tutorials/ga/ga_bulk.rst | 86 - doc/tutorials/ga/ga_bulk_relax.py | 57 - doc/tutorials/ga/ga_bulk_run.py | 139 -- doc/tutorials/ga/ga_bulk_start.py | 61 - doc/tutorials/ga/ga_convex_hull.rst | 146 -- doc/tutorials/ga/ga_convex_run.py | 111 - doc/tutorials/ga/ga_convex_start.py | 79 - doc/tutorials/ga/ga_fcc_alloys.rst | 278 --- doc/tutorials/ga/ga_fcc_alloys_main.py | 60 - doc/tutorials/ga/ga_fcc_alloys_relax.py | 62 - doc/tutorials/ga/ga_fcc_alloys_start.py | 19 - doc/tutorials/ga/ga_fcc_references.py | 32 - doc/tutorials/ga/ga_molecular_crystal.rst | 82 - .../ga/ga_molecular_crystal_relax.py | 119 - doc/tutorials/ga/ga_molecular_crystal_run.py | 114 - .../ga/ga_molecular_crystal_start.py | 54 - doc/tutorials/ga/ga_optimize.rst | 211 -- doc/tutorials/ga/plot_convex_hull.py | 28 - doc/tutorials/ga/run.py | 6 - doc/tutorials/lattice_constant.py | 46 - doc/tutorials/lattice_constant.rst | 98 - doc/tutorials/md/md.rst | 96 - doc/tutorials/md/moldyn1.py | 46 - doc/tutorials/md/moldyn2.py | 45 - doc/tutorials/md/moldyn3.py | 44 - doc/tutorials/md/moldyn4.py | 58 - doc/tutorials/minimahopping/Cu2_Pt110.py | 31 - doc/tutorials/minimahopping/mhsummary.py | 4 - doc/tutorials/minimahopping/minimahopping.py | 5 - doc/tutorials/minimahopping/minimahopping.rst | 30 - doc/tutorials/neb/diffusion.py | 24 - doc/tutorials/neb/diffusion.rst | 79 - doc/tutorials/neb/diffusion1.py | 30 - doc/tutorials/neb/diffusion2.py | 24 - doc/tutorials/neb/diffusion3.py | 26 - doc/tutorials/neb/diffusion4.py | 14 - doc/tutorials/neb/diffusion5.py | 27 - doc/tutorials/neb/idpp.rst | 67 - doc/tutorials/neb/idpp1.py | 34 - doc/tutorials/neb/idpp2.py | 33 - doc/tutorials/neb/idpp3.py | 75 - doc/tutorials/neb/idpp4.py | 76 - doc/tutorials/povray_isosurface_tutorial.py | 90 - doc/tutorials/qmmm/qmmm.rst | 280 --- doc/tutorials/qmmm/water_dimer.py | 27 - doc/tutorials/saving_graphics.py | 62 - doc/tutorials/selfdiffusion/al110.rst | 81 - doc/tutorials/selfdiffusion/dimer_along.py | 69 - doc/tutorials/selfdiffusion/neb1.py | 63 - doc/tutorials/selfdiffusion/neb2.py | 64 - doc/tutorials/selfdiffusion/neb3.py | 68 - doc/tutorials/selfdiffusion/plot.py | 37 - doc/tutorials/test.py | 31 - doc/tutorials/tipnp_equil/tip3p_equil.py | 51 - doc/tutorials/tipnp_equil/tipnp_equil.rst | 47 - doc/tutorials/tut03_vibrations/vibrations.rst | 68 - doc/tutorials/tut06_database/database.rst | 189 -- .../tut06_database/solution/solution.py | 41 - doc/tutorials/tutorials.rst | 125 -- doc/tutorials/wannier/benzene.py | 17 - doc/tutorials/wannier/plot_band_structure.py | 23 - doc/tutorials/wannier/plot_spectral_weight.py | 22 - doc/tutorials/wannier/polyacetylene.py | 23 - doc/tutorials/wannier/wannier.rst | 12 - doc/tutorials/wannier/wannier_benzene.py | 18 - .../wannier/wannier_polyacetylene.py | 30 - doc/workshop/workshop.rst | 31 - .../bandstructure.png | Bin dos.png => figures/dos.png | Bin .../kpoints_convergence_test.png | Bin setup.py | 46 - tools/ase-build | 4 - tools/ase-db | 4 - tools/ase-gui | 4 - tools/ase-info | 4 - tools/ase-run | 4 - 431 files changed, 19 insertions(+), 31544 deletions(-) delete mode 100644 CHANGELOG.rst delete mode 100644 CONTRIBUTING.rst delete mode 100644 appveyor.yml create mode 100644 ase_pwmat/__init__.py rename ase/calculators/pwmat.py => ase_pwmat/calculator.py (100%) rename ase/io/pwmat.py => ase_pwmat/io.py (100%) rename {ase/io/pwmat_namelist => ase_pwmat/namelist}/__init__.py (100%) rename {ase/io/pwmat_namelist => ase_pwmat/namelist}/keys.py (100%) rename {ase/io/pwmat_namelist => ase_pwmat/namelist}/namelist.py (100%) delete mode 100755 bin/ase delete mode 100644 doc/.gitignore delete mode 100644 doc/ASE.bib delete mode 100644 doc/Makefile delete mode 100644 doc/about.rst delete mode 100644 doc/ase-gui.desktop delete mode 100644 doc/ase/ase.rst delete mode 100644 doc/ase/atom.rst delete mode 100644 doc/ase/atoms.py delete mode 100644 doc/ase/atoms.rst delete mode 100644 doc/ase/build/build.rst delete mode 100644 doc/ase/build/connected.rst delete mode 100644 doc/ase/build/general_surface.py delete mode 100644 doc/ase/build/general_surface.tex delete mode 100644 doc/ase/build/structure.py delete mode 100644 doc/ase/build/surface.py delete mode 100644 doc/ase/build/surface.rst delete mode 100644 doc/ase/build/tools.rst delete mode 100644 doc/ase/calculators/FHI-aims.rst delete mode 100644 doc/ase/calculators/INCAR_NaCl delete mode 100644 doc/ase/calculators/NaCl.py delete mode 100644 doc/ase/calculators/abinit.rst delete mode 100644 doc/ase/calculators/ace.rst delete mode 100644 doc/ase/calculators/amber.rst delete mode 100644 doc/ase/calculators/ase_castep_demo.py delete mode 100644 doc/ase/calculators/calculators.rst delete mode 100644 doc/ase/calculators/castep.rst delete mode 100644 doc/ase/calculators/checkpointing.rst delete mode 100644 doc/ase/calculators/cp2k.rst delete mode 100644 doc/ase/calculators/crystal.rst delete mode 100644 doc/ase/calculators/demon.rst delete mode 100644 doc/ase/calculators/demonnano.rst delete mode 100644 doc/ase/calculators/demonnano_ex1_relax.py delete mode 100644 doc/ase/calculators/dftb.rst delete mode 100644 doc/ase/calculators/dftb_ex1_relax.py delete mode 100644 doc/ase/calculators/dftb_ex2_relaxbyDFTB.py delete mode 100644 doc/ase/calculators/dftb_ex3_make_2h2o.py delete mode 100644 doc/ase/calculators/dftd3.rst delete mode 100644 doc/ase/calculators/dftd3_alone.py delete mode 100644 doc/ase/calculators/dftd3_gpaw.py delete mode 100644 doc/ase/calculators/dmol.rst delete mode 100644 doc/ase/calculators/eam.rst delete mode 100644 doc/ase/calculators/emt.rst delete mode 100644 doc/ase/calculators/espresso.rst delete mode 100644 doc/ase/calculators/exciting.py delete mode 100644 doc/ase/calculators/exciting.rst delete mode 100644 doc/ase/calculators/fleur.rst delete mode 100644 doc/ase/calculators/gamess_us.rst delete mode 100644 doc/ase/calculators/gaussian.rst delete mode 100644 doc/ase/calculators/gromacs.rst delete mode 100644 doc/ase/calculators/gromacs_example_mm_relax.py delete mode 100644 doc/ase/calculators/gromacs_example_mm_relax2.py delete mode 100644 doc/ase/calculators/gulp.rst delete mode 100644 doc/ase/calculators/gulp_example.py delete mode 100644 doc/ase/calculators/harmonic.rst delete mode 100644 doc/ase/calculators/his.pdb delete mode 100644 doc/ase/calculators/jacapo.rst delete mode 100644 doc/ase/calculators/kim.rst delete mode 100644 doc/ase/calculators/lammps.rst delete mode 100644 doc/ase/calculators/lammpslib.rst delete mode 100644 doc/ase/calculators/lammpsrun.rst delete mode 100644 doc/ase/calculators/loggingcalc.rst delete mode 100644 doc/ase/calculators/mixing.rst delete mode 100644 doc/ase/calculators/mopac.rst delete mode 100644 doc/ase/calculators/nwchem.rst delete mode 100644 doc/ase/calculators/octopus.rst delete mode 100644 doc/ase/calculators/octopus_h2o.py delete mode 100644 doc/ase/calculators/octopus_silicon.py delete mode 100644 doc/ase/calculators/onetep.rst delete mode 100644 doc/ase/calculators/openmx.rst delete mode 100644 doc/ase/calculators/orca.rst delete mode 100644 doc/ase/calculators/others.rst delete mode 100644 doc/ase/calculators/plumed.rst delete mode 100644 doc/ase/calculators/psi4.rst delete mode 100644 doc/ase/calculators/qchem.rst delete mode 100644 doc/ase/calculators/qmmm.rst delete mode 100644 doc/ase/calculators/siesta.rst delete mode 100644 doc/ase/calculators/socketio/example_abinit.py delete mode 100644 doc/ase/calculators/socketio/example_aims.py delete mode 100644 doc/ase/calculators/socketio/example_client_gpaw.py delete mode 100644 doc/ase/calculators/socketio/example_dftb.py delete mode 100644 doc/ase/calculators/socketio/example_espresso.py delete mode 100644 doc/ase/calculators/socketio/example_nwchem.py delete mode 100644 doc/ase/calculators/socketio/example_server.py delete mode 100644 doc/ase/calculators/socketio/example_siesta.py delete mode 100644 doc/ase/calculators/socketio/socketio.rst delete mode 100644 doc/ase/calculators/spc216.gro delete mode 100644 doc/ase/calculators/test.rst delete mode 100644 doc/ase/calculators/turbomole.rst delete mode 100644 doc/ase/calculators/vasp.rst delete mode 100644 doc/ase/calculators/vasp_si_bandstructure.py delete mode 100644 doc/ase/cell.rst delete mode 100644 doc/ase/cluster/cluster.py delete mode 100644 doc/ase/cluster/cluster.rst delete mode 100644 doc/ase/collections.rst delete mode 100644 doc/ase/constraints.rst delete mode 100644 doc/ase/data.rst delete mode 100644 doc/ase/db/db.py delete mode 100644 doc/ase/db/db.rst delete mode 100644 doc/ase/dft/bader.rst delete mode 100644 doc/ase/dft/bandgap.rst delete mode 100644 doc/ase/dft/bs.py delete mode 100644 doc/ase/dft/bz.py delete mode 100644 doc/ase/dft/dft.rst delete mode 100644 doc/ase/dft/dos.py delete mode 100644 doc/ase/dft/dos.rst delete mode 100644 doc/ase/dft/kpoints.py delete mode 100644 doc/ase/dft/kpoints.rst delete mode 100644 doc/ase/dft/stm.rst delete mode 100644 doc/ase/dft/wannier.rst delete mode 100644 doc/ase/dimer.rst delete mode 100644 doc/ase/eos.rst delete mode 100644 doc/ase/filters.rst delete mode 100644 doc/ase/fix_symmetry_example.py delete mode 100644 doc/ase/formats.py delete mode 100644 doc/ase/formula.rst delete mode 100644 doc/ase/ga/ga.rst delete mode 100644 doc/ase/geometry.rst delete mode 100644 doc/ase/gui/basics.rst delete mode 100644 doc/ase/gui/calculate.rst delete mode 100644 doc/ase/gui/edit.rst delete mode 100644 doc/ase/gui/gui.rst delete mode 100644 doc/ase/gui/setup.rst delete mode 100644 doc/ase/gui/tools.rst delete mode 100644 doc/ase/gui/view.rst delete mode 100644 doc/ase/io/172_ext.xyz delete mode 100644 doc/ase/io/io.rst delete mode 100644 doc/ase/io/io_csv.py delete mode 100644 doc/ase/io/io_formats.py delete mode 100644 doc/ase/io/iopng.py delete mode 100644 doc/ase/io/opls.py delete mode 100644 doc/ase/io/opls.rst delete mode 100644 doc/ase/io/save_C2H4.py delete mode 100644 doc/ase/io/save_pov.py delete mode 100644 doc/ase/io/trajectory.rst delete mode 100644 doc/ase/io/ulm.rst delete mode 100644 doc/ase/io/view_172_mod.py delete mode 100644 doc/ase/io/write_lammps.py delete mode 100644 doc/ase/lattice.rst delete mode 100644 doc/ase/md.rst delete mode 100644 doc/ase/mep.rst delete mode 100644 doc/ase/neb.rst delete mode 100644 doc/ase/neighborlist.rst delete mode 100644 doc/ase/optimize.rst delete mode 100644 doc/ase/parallel.rst delete mode 100644 doc/ase/phasediagram/cuau.py delete mode 100644 doc/ase/phasediagram/ktao.py delete mode 100644 doc/ase/phasediagram/phasediagram.rst delete mode 100644 doc/ase/phasediagram/zno.py delete mode 100644 doc/ase/phonons.rst delete mode 100644 doc/ase/phonons_Al_fcc.py delete mode 100644 doc/ase/plot_radii.py delete mode 100644 doc/ase/precon.py delete mode 100644 doc/ase/spacegroup/spacegroup-al.py delete mode 100644 doc/ase/spacegroup/spacegroup-cosb3.py delete mode 100644 doc/ase/spacegroup/spacegroup-diamond.py delete mode 100644 doc/ase/spacegroup/spacegroup-fe.py delete mode 100644 doc/ase/spacegroup/spacegroup-mg.py delete mode 100644 doc/ase/spacegroup/spacegroup-nacl.py delete mode 100644 doc/ase/spacegroup/spacegroup-rutile.py delete mode 100644 doc/ase/spacegroup/spacegroup-skutterudite.py delete mode 100644 doc/ase/spacegroup/spacegroup.py delete mode 100644 doc/ase/spacegroup/spacegroup.rst delete mode 100644 doc/ase/spectrum/doscollection.rst delete mode 100644 doc/ase/spectrum/dosdata.rst delete mode 100644 doc/ase/spectrum/spectrum.rst delete mode 100644 doc/ase/symbols.rst delete mode 100644 doc/ase/thermochemistry/ethane.py delete mode 100644 doc/ase/thermochemistry/gold.py delete mode 100644 doc/ase/thermochemistry/nitrogen.py delete mode 100644 doc/ase/thermochemistry/thermochemistry.py delete mode 100644 doc/ase/thermochemistry/thermochemistry.rst delete mode 100644 doc/ase/transport/transport.rst delete mode 100644 doc/ase/transport/transport_setup.py delete mode 100644 doc/ase/units.rst delete mode 100644 doc/ase/utils.rst delete mode 100644 doc/ase/vibrations/H2Morse_calc_overlap.py delete mode 100644 doc/ase/vibrations/H2O_EMT.py delete mode 100644 doc/ase/vibrations/H2O_EMT_summary.txt delete mode 100644 doc/ase/vibrations/H2_ir.py delete mode 100644 doc/ase/vibrations/H2_optical.py delete mode 100644 doc/ase/vibrations/H2_optical_overlap.py delete mode 100644 doc/ase/vibrations/franck_condon.rst delete mode 100644 doc/ase/vibrations/infrared.rst delete mode 100644 doc/ase/vibrations/modes.rst delete mode 100644 doc/ase/vibrations/raman.rst delete mode 100644 doc/ase/vibrations/vibrations.rst delete mode 100644 doc/ase/visualize/matplotlib_plot_atoms.py delete mode 100644 doc/ase/visualize/mlab_options.py delete mode 100644 doc/ase/visualize/stem_image.jpg delete mode 100644 doc/ase/visualize/visualize.rst delete mode 100644 doc/ase/xrdebye.py delete mode 100644 doc/ase/xrdebye.rst delete mode 100644 doc/cmdline.rst delete mode 100644 doc/conf.py delete mode 100644 doc/contact.rst delete mode 100644 doc/development/bugs.rst delete mode 100644 doc/development/calculators.rst delete mode 100644 doc/development/contribute.rst delete mode 100644 doc/development/development.rst delete mode 100644 doc/development/licenseinfo.rst delete mode 100644 doc/development/making_movies.rst delete mode 100644 doc/development/newrelease.rst delete mode 100644 doc/development/proposals/calculators.rst delete mode 100644 doc/development/proposals/labels.rst delete mode 100644 doc/development/proposals/proposals.rst delete mode 100644 doc/development/python_codingstandard.rst delete mode 100644 doc/development/tests.rst delete mode 100644 doc/development/translate.rst delete mode 100644 doc/development/writepngs.py delete mode 100644 doc/development/writing_documentation_ase.rst delete mode 100644 doc/easybuild/ASE-3.14.1-foss-2016b-Python-2.7.12.eb delete mode 100644 doc/easybuild/ASE-3.14.1-foss-2016b-Python-3.5.2.eb delete mode 100644 doc/easybuild/ASE-3.15.0-foss-2016b-Python-2.7.12.eb delete mode 100644 doc/easybuild/ASE-3.15.0-foss-2016b-Python-3.5.2.eb delete mode 100644 doc/easybuild/ASE-3.15.0-foss-2017b-Python-3.6.2.eb delete mode 100644 doc/ecosystem.rst delete mode 100644 doc/faq.rst delete mode 100644 doc/gallery/gallery.rst delete mode 100644 doc/gallery/o2pt100.py delete mode 100644 doc/gallery/ptable.py delete mode 100644 doc/gallery/render_all_povray_styles.py delete mode 100644 doc/gallery/tuning_povray_for_high_quality_images.py delete mode 100644 doc/gettingstarted/N2Cu.py delete mode 100644 doc/gettingstarted/cluster/cluster.rst delete mode 100644 doc/gettingstarted/cluster/solution/Ag_part1_optimise.py delete mode 100644 doc/gettingstarted/cluster/solution/Ag_part2_groundstate.py delete mode 100644 doc/gettingstarted/cluster/solution/Ag_part3_dos.py delete mode 100644 doc/gettingstarted/external_calculators/ext_intro.rst delete mode 100644 doc/gettingstarted/gettingstarted.rst delete mode 100644 doc/gettingstarted/manipulating_atoms/WL.py delete mode 100644 doc/gettingstarted/manipulating_atoms/interface-h2o.py delete mode 100644 doc/gettingstarted/manipulating_atoms/manipulating_atoms.py delete mode 100644 doc/gettingstarted/manipulating_atoms/manipulating_atoms.rst delete mode 100644 doc/gettingstarted/surface.py delete mode 100644 doc/gettingstarted/surface.rst delete mode 100644 doc/gettingstarted/tut01_molecule/molecule.rst delete mode 100644 doc/gettingstarted/tut01_molecule/solution/binding_curve.py delete mode 100644 doc/gettingstarted/tut01_molecule/solution/plot_binding_curve.py delete mode 100644 doc/gettingstarted/tut01_molecule/solution/spinpol.py delete mode 100644 doc/gettingstarted/tut02_h2o_structure/h2o.rst delete mode 100644 doc/gettingstarted/tut02_h2o_structure/solution/optimise.py delete mode 100644 doc/gettingstarted/tut02_h2o_structure/solution/optimise_aims.py delete mode 100644 doc/gettingstarted/tut02_h2o_structure/solution/optimise_aims_socketio.py delete mode 100644 doc/gettingstarted/tut04_bulk/bulk.rst delete mode 100644 doc/gettingstarted/tut04_bulk/solution/bulk_part1_groundstate.py delete mode 100644 doc/gettingstarted/tut04_bulk/solution/bulk_part2_dos.py delete mode 100644 doc/gettingstarted/tut04_bulk/solution/bulk_part3_bandstructure.py delete mode 100644 doc/gettingstarted/tut04_bulk/solution/bulk_part4_cellopt.py delete mode 100644 doc/gettingstarted/tut04_bulk/solution/bulk_part5_rutile_bands.py delete mode 100644 doc/index.rst delete mode 100644 doc/install.rst delete mode 100644 doc/logo.py delete mode 100644 doc/numpy.rst delete mode 100644 doc/python.rst delete mode 100644 doc/releasenotes.rst delete mode 100644 doc/static/044482-glossy-black-icon-sports-hobbies-film-clapper.png delete mode 100644 doc/static/China.png delete mode 100644 doc/static/United_States_of_America.png delete mode 100644 doc/static/abacus.png delete mode 100644 doc/static/abinit.png delete mode 100644 doc/static/asap.png delete mode 100644 doc/static/ase.css delete mode 100644 doc/static/ase.ico delete mode 100644 doc/static/ase.xpm delete mode 100644 doc/static/ase256.png delete mode 100644 doc/static/ase_trac.png delete mode 100644 doc/static/atomistica.png delete mode 100644 doc/static/bigdft.png delete mode 100644 doc/static/castep.png delete mode 100644 doc/static/cp2k.png delete mode 100644 doc/static/crystal.png delete mode 100644 doc/static/deepmd-kit.png delete mode 100644 doc/static/demon.png delete mode 100644 doc/static/dftb.png delete mode 100644 doc/static/dftd4.png delete mode 100644 doc/static/dftk.png delete mode 100644 doc/static/elk.png delete mode 100644 doc/static/emt.png delete mode 100644 doc/static/espresso.png delete mode 100644 doc/static/exciting.png delete mode 100644 doc/static/fhi-aims.png delete mode 100644 doc/static/fleur.png delete mode 100644 doc/static/gamess_us.png delete mode 100644 doc/static/gpaw.png delete mode 100644 doc/static/gromacs.png delete mode 100644 doc/static/hotbit.png delete mode 100644 doc/static/jdftx.png delete mode 100644 doc/static/kim.png delete mode 100644 doc/static/lammps.png delete mode 100644 doc/static/nwchem.png delete mode 100644 doc/static/octopus.png delete mode 100644 doc/static/onetep.png delete mode 100644 doc/static/openmx.png delete mode 100644 doc/static/orca_logo_mpi.png delete mode 100644 doc/static/plumed.png delete mode 100644 doc/static/psi4.png delete mode 100644 doc/static/qchem.png delete mode 100644 doc/static/siesta.png delete mode 100644 doc/static/tm_logo_l.png delete mode 100644 doc/static/vasp.png delete mode 100644 doc/static/xtb.png delete mode 100644 doc/templates/breadcrumbs.html delete mode 100644 doc/tips.rst delete mode 100644 doc/tutorials/N2.py delete mode 100644 doc/tutorials/N2Cu-Dissociation1.py delete mode 100644 doc/tutorials/N2Cu-Dissociation2.py delete mode 100644 doc/tutorials/N2Ru-Dissociation1.py delete mode 100644 doc/tutorials/N2Ru-Dissociation2.py delete mode 100644 doc/tutorials/acn_equil/acn_equil.py delete mode 100644 doc/tutorials/acn_equil/acn_equil.rst delete mode 100644 doc/tutorials/atomization.rst delete mode 100644 doc/tutorials/constraints/diffusion.py delete mode 100644 doc/tutorials/constraints/diffusion.rst delete mode 100644 doc/tutorials/constraints/diffusion4.py delete mode 100644 doc/tutorials/db/ads.py delete mode 100644 doc/tutorials/db/bulk.py delete mode 100644 doc/tutorials/db/db.rst delete mode 100644 doc/tutorials/db/ea.py delete mode 100644 doc/tutorials/db/refs.py delete mode 100644 doc/tutorials/db/run.py delete mode 100644 doc/tutorials/defects/defects.rst delete mode 100644 doc/tutorials/defects/periodic-images.py delete mode 100644 doc/tutorials/defects/score-size.py delete mode 100644 doc/tutorials/defects/supercells.py delete mode 100644 doc/tutorials/deltacodesdft/all.py delete mode 100644 doc/tutorials/deltacodesdft/calculate.py delete mode 100644 doc/tutorials/deltacodesdft/deltacodesdft.rst delete mode 100644 doc/tutorials/deltacodesdft/fit.py delete mode 100644 doc/tutorials/deltacodesdft/tables.py delete mode 100644 doc/tutorials/dimensionality/dimensionality.rst delete mode 100644 doc/tutorials/dimensionality/dimexample.py delete mode 100644 doc/tutorials/dimensionality/isolation_example.py delete mode 100644 doc/tutorials/dissociation.rst delete mode 100644 doc/tutorials/eos/eos.py delete mode 100644 doc/tutorials/eos/eos.rst delete mode 100644 doc/tutorials/eos/eos1.py delete mode 100644 doc/tutorials/eos/eos2.py delete mode 100644 doc/tutorials/ga/basic_example_create_database.py delete mode 100644 doc/tutorials/ga/basic_example_main_run.py delete mode 100644 doc/tutorials/ga/ga_basic_calc.py delete mode 100644 doc/tutorials/ga/ga_basic_parallel_main.py delete mode 100644 doc/tutorials/ga/ga_basic_parameters.py delete mode 100644 doc/tutorials/ga/ga_basic_pbs_main.py delete mode 100644 doc/tutorials/ga/ga_bulk.rst delete mode 100644 doc/tutorials/ga/ga_bulk_relax.py delete mode 100644 doc/tutorials/ga/ga_bulk_run.py delete mode 100644 doc/tutorials/ga/ga_bulk_start.py delete mode 100644 doc/tutorials/ga/ga_convex_hull.rst delete mode 100644 doc/tutorials/ga/ga_convex_run.py delete mode 100644 doc/tutorials/ga/ga_convex_start.py delete mode 100644 doc/tutorials/ga/ga_fcc_alloys.rst delete mode 100644 doc/tutorials/ga/ga_fcc_alloys_main.py delete mode 100644 doc/tutorials/ga/ga_fcc_alloys_relax.py delete mode 100644 doc/tutorials/ga/ga_fcc_alloys_start.py delete mode 100644 doc/tutorials/ga/ga_fcc_references.py delete mode 100644 doc/tutorials/ga/ga_molecular_crystal.rst delete mode 100644 doc/tutorials/ga/ga_molecular_crystal_relax.py delete mode 100644 doc/tutorials/ga/ga_molecular_crystal_run.py delete mode 100644 doc/tutorials/ga/ga_molecular_crystal_start.py delete mode 100644 doc/tutorials/ga/ga_optimize.rst delete mode 100644 doc/tutorials/ga/plot_convex_hull.py delete mode 100644 doc/tutorials/ga/run.py delete mode 100644 doc/tutorials/lattice_constant.py delete mode 100644 doc/tutorials/lattice_constant.rst delete mode 100644 doc/tutorials/md/md.rst delete mode 100644 doc/tutorials/md/moldyn1.py delete mode 100644 doc/tutorials/md/moldyn2.py delete mode 100644 doc/tutorials/md/moldyn3.py delete mode 100644 doc/tutorials/md/moldyn4.py delete mode 100644 doc/tutorials/minimahopping/Cu2_Pt110.py delete mode 100644 doc/tutorials/minimahopping/mhsummary.py delete mode 100644 doc/tutorials/minimahopping/minimahopping.py delete mode 100644 doc/tutorials/minimahopping/minimahopping.rst delete mode 100644 doc/tutorials/neb/diffusion.py delete mode 100644 doc/tutorials/neb/diffusion.rst delete mode 100644 doc/tutorials/neb/diffusion1.py delete mode 100644 doc/tutorials/neb/diffusion2.py delete mode 100644 doc/tutorials/neb/diffusion3.py delete mode 100644 doc/tutorials/neb/diffusion4.py delete mode 100644 doc/tutorials/neb/diffusion5.py delete mode 100644 doc/tutorials/neb/idpp.rst delete mode 100644 doc/tutorials/neb/idpp1.py delete mode 100644 doc/tutorials/neb/idpp2.py delete mode 100644 doc/tutorials/neb/idpp3.py delete mode 100644 doc/tutorials/neb/idpp4.py delete mode 100644 doc/tutorials/povray_isosurface_tutorial.py delete mode 100644 doc/tutorials/qmmm/qmmm.rst delete mode 100644 doc/tutorials/qmmm/water_dimer.py delete mode 100644 doc/tutorials/saving_graphics.py delete mode 100644 doc/tutorials/selfdiffusion/al110.rst delete mode 100644 doc/tutorials/selfdiffusion/dimer_along.py delete mode 100644 doc/tutorials/selfdiffusion/neb1.py delete mode 100644 doc/tutorials/selfdiffusion/neb2.py delete mode 100644 doc/tutorials/selfdiffusion/neb3.py delete mode 100644 doc/tutorials/selfdiffusion/plot.py delete mode 100644 doc/tutorials/test.py delete mode 100644 doc/tutorials/tipnp_equil/tip3p_equil.py delete mode 100644 doc/tutorials/tipnp_equil/tipnp_equil.rst delete mode 100644 doc/tutorials/tut03_vibrations/vibrations.rst delete mode 100644 doc/tutorials/tut06_database/database.rst delete mode 100644 doc/tutorials/tut06_database/solution/solution.py delete mode 100644 doc/tutorials/tutorials.rst delete mode 100644 doc/tutorials/wannier/benzene.py delete mode 100644 doc/tutorials/wannier/plot_band_structure.py delete mode 100644 doc/tutorials/wannier/plot_spectral_weight.py delete mode 100644 doc/tutorials/wannier/polyacetylene.py delete mode 100644 doc/tutorials/wannier/wannier.rst delete mode 100644 doc/tutorials/wannier/wannier_benzene.py delete mode 100644 doc/tutorials/wannier/wannier_polyacetylene.py delete mode 100644 doc/workshop/workshop.rst rename bandstructure.png => figures/bandstructure.png (100%) rename dos.png => figures/dos.png (100%) rename kpoints_convergence_test.png => figures/kpoints_convergence_test.png (100%) delete mode 100644 setup.py delete mode 100755 tools/ase-build delete mode 100755 tools/ase-db delete mode 100755 tools/ase-gui delete mode 100755 tools/ase-info delete mode 100755 tools/ase-run diff --git a/CHANGELOG.rst b/CHANGELOG.rst deleted file mode 100644 index e1c801f84d..0000000000 --- a/CHANGELOG.rst +++ /dev/null @@ -1,6 +0,0 @@ -Changelog -========= - -See what's new in ASE here: - - https://wiki.fysik.dtu.dk/ase/releasenotes.html diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index 16feb5594b..0000000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,6 +0,0 @@ -Contributing -============ - -See how to contribute here: - - https://wiki.fysik.dtu.dk/ase/development/contribute.html diff --git a/LICENSE b/LICENSE index d09fccda8a..5ea963333b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,12 +1,12 @@ -ASE is free software: you can redistribute it and/or modify +ASE-PWmat 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. -ASE is distributed in the hope that it will be useful, +ASE-PWmat 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 ASE. If not, see . +along with ASE-PWmat. If not, see . diff --git a/README.rst b/README.rst index a17d4dd1c4..aa2c4b2c36 100644 --- a/README.rst +++ b/README.rst @@ -5,24 +5,19 @@ ASE-PWmat Introduction ------------ -ASE is a set of tools and Python modules for setting up, manipulating, +ASE is a set of tools and Python_ modules for setting up, manipulating, running, visualizing and analyzing atomistic simulations. Webpage: http://wiki.fysik.dtu.dk/ase +This package provides extensions to use ASE_ with the PWmat_ electronic +structure code. + Requirements ------------ -* Python_ 3.9 or later -* NumPy_ (base N-dimensional array package) -* SciPy_ (library for scientific computing) -* Matplotlib_ (2D Plotting) - -Optional: - -* Flask_ (for ase.db web-interface) -* spglib_ (for symmetry operations) +* ASE_ 3.23 Installation ------------ @@ -61,6 +56,9 @@ Install ASE-PWmat from source code using git:: cd ase-pwmat pip install . +This will also install ASE and other dependencies, if they were not +already available. + PWmat IO -------- @@ -254,7 +252,7 @@ Copy the above code to the ``run_pwmat_test.py`` file and run it in the ways men An image named ``kpoints_convergence_test.png`` has been generated. The image displays the energy values associated with different K-point grids. The results indicate that the energy converges at kspacing=0.04 (corresponding to an 8x8x8 grid). -.. image:: kpoints_convergence_test.png +.. image:: figures/kpoints_convergence_test.png :width: 400 :height: 300 :alt: kpoints_convergence_test @@ -361,7 +359,7 @@ Add scripts of utils to environment variables and run the post-processing script Copy the above code to the ``run_pwmat_dos.py`` file and run it in the ways mentioned above. Obtain total DOS of Si as follows: -.. image:: dos.png +.. image:: figures/dos.png :width: 400 :height: 300 :alt: dos @@ -417,22 +415,15 @@ run the post-processing scripts:: Copy the above code to the ``run_pwmat_dos.py`` file and run it in the ways mentioned above. Obtain the band structure of Si as follows: -.. image:: bandstructure.png +.. image:: figures/bandstructure.png :width: 400 :height: 300 :alt: bandstructure More usages of ase-pwmat interface can be found in the https://www.pwmat.com/ and https://wiki.fysik.dtu.dk/ase/. -.. _Python: http://www.python.org/ -.. _NumPy: http://docs.scipy.org/doc/numpy/reference/ -.. _SciPy: http://docs.scipy.org/doc/scipy/reference/ -.. _Matplotlib: http://matplotlib.org/ -.. _flask: https://pypi.org/project/Flask/ -.. _spglib: https://github.com/spglib/spglib -.. _ase-users: https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users -.. _Matrix: https://matrix.to/#/!JEiuNJLuxedbohAOuH:matrix.org -.. _Element: https://app.element.io/#/room/#ase:matrix.org +.. _ASE: http://wiki.fysik.dtu.dk/ase .. _PWmat: https://www.pwmat.com/ .. _Anaconda3: https://www.anaconda.com/ .. _Mcloud: http://doc.lonxun.com/mcloud/ +.. _Python: http://www.python.org/ diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 9169ff6768..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,63 +0,0 @@ -environment: - matrix: - # For Python versions available on Appveyor, see - # http://www.appveyor.com/docs/installed-software#python - # # Python 3.9 - #- PYTHON: "C:\\Python39" - # Python 3.9 - 64-bit - - PYTHON: "C:\\Python39-x64" - # # Conda 3.9 - #- PYTHON: "C:\\Miniconda39" - # # Conda 3.9 64-bit - #- PYTHON: "C:\\Miniconda39-x64" - -install: - # Prepend chosen Python to the PATH of this build - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - # Check that we have the expected version and architecture for Python - - "python --version" - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - # Install the conda supplied packages if using conda, otherwise use pip - # The wheel package is needed for 'pip wheel' - # Turn off progressbars '-q' otherwise PowerShell thinks there are errors - - "echo %PYTHON%" - - ps: | - if($env:PYTHON -match "conda") - { - echo "install with conda" - conda update -yq conda - conda install -yq pip=21.0.1 wheel numpy scipy pyflakes matplotlib flask pytest pytest-mock - } - else - { - echo "install with pip" - #pip install --upgrade pip - python.exe -m pip install --upgrade pip==21.0.1 - pip install wheel pytest --disable-pip-version-check - } - # install ase into the current python - - "echo %cd%" - - "where pip" - - "pip install .[test] --disable-pip-version-check" - -build: off - -test_script: - # run tests from temp dir so source tree doesn't interfere - - "cd %TEMP%" - - "ase info" - - "ase -T test" - -after_test: - # This step builds distribution. - - "cd %APPVEYOR_BUILD_FOLDER%" - - "pip wheel -w dist --no-deps ." - -artifacts: - # bdist_wheel puts your built wheel in the dist directory - - path: dist\* - -#on_success: -# You can use this step to upload your artifacts to a public website. -# See Appveyor's documentation for more details. Or you can simply -# access your wheels from the Appveyor "artifacts" tab for your build. diff --git a/ase_pwmat/__init__.py b/ase_pwmat/__init__.py new file mode 100644 index 0000000000..975741f6eb --- /dev/null +++ b/ase_pwmat/__init__.py @@ -0,0 +1,3 @@ +"""ASE-PWmat interface, providing an ASE Calculator""" + +from .calculator import PWmatProfile, PWmatTemplate, PWmat diff --git a/ase/calculators/pwmat.py b/ase_pwmat/calculator.py similarity index 100% rename from ase/calculators/pwmat.py rename to ase_pwmat/calculator.py diff --git a/ase/io/pwmat.py b/ase_pwmat/io.py similarity index 100% rename from ase/io/pwmat.py rename to ase_pwmat/io.py diff --git a/ase/io/pwmat_namelist/__init__.py b/ase_pwmat/namelist/__init__.py similarity index 100% rename from ase/io/pwmat_namelist/__init__.py rename to ase_pwmat/namelist/__init__.py diff --git a/ase/io/pwmat_namelist/keys.py b/ase_pwmat/namelist/keys.py similarity index 100% rename from ase/io/pwmat_namelist/keys.py rename to ase_pwmat/namelist/keys.py diff --git a/ase/io/pwmat_namelist/namelist.py b/ase_pwmat/namelist/namelist.py similarity index 100% rename from ase/io/pwmat_namelist/namelist.py rename to ase_pwmat/namelist/namelist.py diff --git a/bin/ase b/bin/ase deleted file mode 100755 index c8ab455e8c..0000000000 --- a/bin/ase +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python3 -from ase.cli.main import main - -main() diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index 432be74b12..0000000000 --- a/doc/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# If you build the documentation in the source tree, you will create a -# lot of files that we don't want to see with "git status": -*.png -*.gif -*.pov -*.ini -*.traj -*.pdf -*.csv -*.txt -*.log -*.xyz -*.svg -*.db -*.pckl - -# These are OK (images for the supported calculators): -!/static/*.png diff --git a/doc/ASE.bib b/doc/ASE.bib deleted file mode 100644 index 1b226b278a..0000000000 --- a/doc/ASE.bib +++ /dev/null @@ -1,48 +0,0 @@ -@article{ase-paper, - author={Ask Hjorth Larsen and Jens Jørgen Mortensen and Jakob Blomqvist and Ivano E Castelli and Rune Christensen and Marcin -Dułak and Jesper Friis and Michael N Groves and Bjørk Hammer and Cory Hargus and Eric D Hermes and Paul C Jennings and Peter -Bjerre Jensen and James Kermode and John R Kitchin and Esben Leonhard Kolsbjerg and Joseph Kubal and Kristen -Kaasbjerg and Steen Lysgaard and Jón Bergmann Maronsson and Tristan Maxson and Thomas Olsen and Lars Pastewka and Andrew -Peterson and Carsten Rostgaard and Jakob Schiøtz and Ole Schütt and Mikkel Strange and Kristian S Thygesen and Tejs -Vegge and Lasse Vilhelmsen and Michael Walter and Zhenhua Zeng and Karsten W Jacobsen}, - title={The atomic simulation environment—a Python library for working with atoms}, - journal={Journal of Physics: Condensed Matter}, - volume={29}, - number={27}, - pages={273002}, - url={http://stacks.iop.org/0953-8984/29/i=27/a=273002}, - year={2017}, - abstract={The atomic simulation environment (ASE) is a software package written in the Python programming language with the aim of setting up, steering, and analyzing atomistic simulations. In ASE, tasks are fully scripted in Python. The powerful syntax of Python combined with the NumPy array library make it possible to perform very complex simulation tasks. For example, a sequence of calculations may be performed with the use of a simple ‘for-loop’ construction. Calculations of energy, forces, stresses and other quantities are performed through interfaces to many external electronic structure codes or force fields using a uniform interface. On top of this calculator interface, ASE provides modules for performing many standard simulation tasks such as structure optimization, molecular dynamics, handling of constraints and performing nudged elastic band calculations.} -} - - -@Article{ISI:000175131400009, -Author = {S. R. Bahn and K. W. Jacobsen}, -Title = {An object-oriented scripting interface to a legacy electronic structure code}, -JournalFull = {COMPUTING IN SCIENCE \& ENGINEERING}, -Year = {2002}, -Volume = {4}, -Number = {3}, -Pages = {56-66}, -Month = {MAY-JUN}, -Abstract = {The authors have created an object-oriented scripting interface to a mature density functional theory -code. The interface gives users a high-level, flexible handle on the code without rewriting the -underlying number-crunching code. The authors also discuss the design issues and advantages of -homogeneous interfaces}, -Publisher = {IEEE COMPUTER SOC}, -Address = {10662 LOS VAQUEROS CIRCLE, PO BOX 3014, LOS ALAMITOS, CA 90720-1314 USA}, -Type = {Article}, -Language = {English}, -Affiliation = {Bahn, SR (Reprint Author), Tech Univ Denmark, Dept Phys, CAMP, Bldg 307, DK-2800 Lyngby, Denmark. -Tech Univ Denmark, Dept Phys, CAMP, DK-2800 Lyngby, Denmark.}, -ISSN = {1521-9615}, -Keywords-Plus = {MULTISCALE SIMULATION; GOLD ATOMS}, -Subject-Category = {Computer Science, Interdisciplinary Applications}, -Author-Email = {bahn@fysik.dtu.dk kwj@fysik.dtu.dk}, -Number-of-Cited-References = {19}, -Journal-ISO = {Comput. Sci. Eng.}, -Journal = {Comput. Sci. Eng.}, -Doc-Delivery-Number = {543YL}, -Unique-ID = {ISI:000175131400009}, -DOI = {10.1109/5992.998641}, -} diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index 836b3704b8..0000000000 --- a/doc/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help doctest clean inspect html latex linkcheck browse - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/html - -help: - @echo "Use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " doctest to test code examples" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " linkcheck to check all external links for integrity" - @echo " clean to clean up" - @echo " inspect to check generated images and other stuff" - @echo " browse to open browser" - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -clean: - rm -rf $(BUILDDIR)/* - python3 -m ase.utils.sphinx clean - -inspect: - python3 -m ase.utils.sphinx inspect - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -browse: - firefox build/html/index.html diff --git a/doc/about.rst b/doc/about.rst deleted file mode 100644 index bb6d87ac75..0000000000 --- a/doc/about.rst +++ /dev/null @@ -1,58 +0,0 @@ -.. _about: - -===== -About -===== - -ASE is an Atomic Simulation Environment written in the -Python_ programming language with the aim of setting up, steering, and -analyzing atomistic simulations. The ASE has been constructed with a -number of "design goals" that make it: - - -- **Easy to use**: - - Setting up an atomistic total energy calculation or molecular - dynamics simulation with ASE is simple and straightforward. ASE can - be used via a :mod:`graphical user interface `, :ref:`cli` - and the Python language. Python scripts are - easy to follow (see :ref:`what is python` for a short introduction). - It is simple for new users to get access to all of the functionality - of ASE. - -- **Flexible**: - - Since ASE is based on the Python scripting language it is possible - to perform very complicated simulation tasks without any code modifications. - For example, a sequence of calculations may be performed with - the use of simple "for-loop" constructions. There exist ASE modules for - performing many standard simulation tasks. - -- **Customizable**: - - The Python code in ASE is structured in modules intended for - different purposes. There are :mod:`ase.calculators` for calculating - energies, forces and stresses, :mod:`ase.md` and :mod:`ase.optimize` modules - for controlling the motion of atoms, :mod:`constraints ` - objects and filters for performing :mod:`nudged-elastic-band ` - calculations etc. The modularity of the object-oriented code make it - simple to contribute new functionality to ASE. - -- **Pythonic**: - - It fits nicely into the rest of the Python world with - use of the popular NumPy package for numerical work - (see :ref:`numpy` for a short introduction). The - use of the Python language allows ASE to be used both interactively - as well as in scripts. - -- **Open to participation**: - - The CAMPOS Atomic Simulation Environment is released under the GNU - Lesser General Public License version 2.1 or any later version. See - the files :git:`COPYING` and :git:`COPYING.LESSER` which accompany - the downloaded files, or see the license at GNU's web server at - http://www.gnu.org/licenses/. Everybody is invited to - participate in using and :ref:`developing the code `. - -.. _Python: https://www.python.org/ diff --git a/doc/ase-gui.desktop b/doc/ase-gui.desktop deleted file mode 100644 index d990eef8e6..0000000000 --- a/doc/ase-gui.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=ASE GUI -GenericName=ASE GUI -Comment=Atomic Simulation Environment GUI -Categories=GTK;Science;Chemistry;Physics;Education; -Keywords=Atom;Molecule;Cluster;Surface;Nanotube;Bulk;Crystal; -Exec=ase gui -Icon=ase -Terminal=false -Type=Application -Name[en_US]=ASE GUI -GenericName[en_US]=ASE GUI -Comment[en_US]=Atomic Simulation Environment GUI diff --git a/doc/ase/ase.rst b/doc/ase/ase.rst deleted file mode 100644 index ae817c3faa..0000000000 --- a/doc/ase/ase.rst +++ /dev/null @@ -1,90 +0,0 @@ -.. _ase: - -======= -Modules -======= - -.. hlist:: - :columns: 4 - - * :mod:`ase (Atom) ` - * :mod:`ase (Atoms) ` - * :mod:`~ase.build` - * :mod:`~ase.cell` - * :mod:`~ase.calculators` - * :mod:`~ase.collections` - * :mod:`~ase.constraints` - * :mod:`~ase.db` - * :mod:`~ase.dft` - * :mod:`~ase.data` - * :mod:`~ase.filters` - * :mod:`~ase.formula` - * :mod:`~ase.ga` - * :mod:`~ase.geometry` - * :mod:`~ase.gui` - * :mod:`~ase.io` - * :mod:`~ase.lattice` - * :mod:`~ase.md` - * :mod:`~ase.mep` - * :mod:`~ase.neighborlist` - * :mod:`~ase.optimize` - * :mod:`~ase.parallel` - * :mod:`~ase.phasediagram` - * :mod:`~ase.phonons` - * :mod:`~ase.spacegroup` - * :mod:`~ase.spectrum` - * :mod:`~ase.symbols` - * :mod:`~ase.transport` - * :mod:`~ase.thermochemistry` - * :mod:`~ase.units` - * :mod:`~ase.utils` - * :mod:`~ase.vibrations` - * :mod:`~ase.visualize` - -.. seealso:: - - * :ref:`tutorials` - * :ref:`cli` - * :git:`Source code <>` - * Presentation about ASE: - `ase-talk.pdf `__ - -.. toctree:: - :maxdepth: 2 - - atoms - cell - units - io/io - build/build - eos - formula - symbols - collections - data - optimize - md - constraints - filters - spacegroup/spacegroup - neighborlist - geometry - db/db - mep - ga/ga - gui/gui - lattice - cluster/cluster - visualize/visualize - calculators/calculators - dft/dft - vibrations/vibrations - phonons - phasediagram/phasediagram - spectrum/spectrum - thermochemistry/thermochemistry - utils - parallel - atom - transport/transport - calculators/qmmm diff --git a/doc/ase/atom.rst b/doc/ase/atom.rst deleted file mode 100644 index 9b2bde9239..0000000000 --- a/doc/ase/atom.rst +++ /dev/null @@ -1,117 +0,0 @@ -.. module:: ase.atom - -The Atom object -=============== - -ASE defines a python class called :class:`Atom` to setup and handle atoms -in electronic structure and molecular simulations. From a python -script, atoms can be created like this: - ->>> from ase import Atom ->>> a1 = Atom('Si', (0, 0, 0)) ->>> a2 = Atom('H', (1.3, 0, 0), mass=2) ->>> a3 = Atom(14, position=(0, 0, 0)) # same as a1 - -.. autoclass:: Atom - -The first argument to the constructor of an :class:`Atom` object is -the chemical symbol, and the second argument is the position in Å -units (see :mod:`ase.units`). The position can be any numerical sequence -of length three. The properties of an atom can also be set using -keywords like it is done in the *a2* and *a3* examples above. - -More examples: - ->>> a = Atom('O', charge=-2) ->>> b = Atom(8, charge=-2) ->>> c = Atom('H', (1, 2, 3), magmom=1) ->>> print(a.charge, a.position) --2 [ 0. 0. 0.] ->>> c.x = 0.0 ->>> c.position -array([ 0., 2., 3.]) ->>> b.symbol -'O' ->>> c.tag = 42 ->>> c.number -1 ->>> c.symbol = 'Li' ->>> c.number -3 - -If the atom object belongs to an Atoms object, then assigning -values to the atom attributes will change the corresponding -arrays of the atoms object: - ->>> from ase import Atoms ->>> OH = Atoms('OH') ->>> OH[0].charge = -1 ->>> OH.get_initial_charges() -array([-1., 0.]) - -Another example: - ->>> for atom in bulk: -... if atom.symbol == 'Ni': -... atom.magmom = 0.7 # set initial magnetic moment - - -The different properties of an atom can be obtained and changed via -attributes (``position``, ``number``, ``tag``, ``momentum``, ``mass``, -``magmom``, ``charge``, ``x``, ``y``, ``z``): - ->>> a1.position = [1, 0, 0] ->>> a1.position -[1, 0, 0] ->>> a1.z = 2.5 ->>> a1.position -[1, 0, 2.5] ->>> a2.magmom = 1.0 - -That last line will set the initial magnetic moment that some -calculators use (similar to the -:meth:`~ase.Atoms.set_initial_magnetic_moments` method). - - -.. note:: - - The ``position`` and ``momentum`` attributes refer to mutable - objects, so in some cases, you may want to use - ``a1.position.copy()`` in order to avoid changing the position of - ``a1`` by accident. - - -Getting an Atom from an Atoms object ------------------------------------- - -Indexing an :class:`~ase.Atoms` object returns an :class:`Atom` object -still remembering that it belongs to the collective :class:`~ase.Atoms`: -Modifying it will also change the atoms object: - ->>> from ase.build import molecule ->>> atoms = molecule('CH4') ->>> atoms.get_positions() -array([[ 0. , 0. , 0. ], - [ 0.629118, 0.629118, 0.629118], - [-0.629118, -0.629118, 0.629118], - [ 0.629118, -0.629118, -0.629118], - [-0.629118, 0.629118, -0.629118]]) ->>> a = atoms[2] ->>> a -Atom('H', [-0.62911799999999996, -0.62911799999999996, 0.62911799999999996], index=2) ->>> a.x = 0 ->>> atoms.get_positions() -array([[ 0. , 0. , 0. ], - [ 0.629118, 0.629118, 0.629118], - [ 0. , -0.629118, 0.629118], - [ 0.629118, -0.629118, -0.629118], - [-0.629118, 0.629118, -0.629118]]) - - -.. seealso:: - - :mod:`ase`: - More information about how to use collections of atoms. - - :mod:`ase.calculators`: - Information about how to calculate forces and energies of atoms. diff --git a/doc/ase/atoms.py b/doc/ase/atoms.py deleted file mode 100644 index 0783946ff7..0000000000 --- a/doc/ase/atoms.py +++ /dev/null @@ -1,19 +0,0 @@ -# creates: Au-wire.png - -from ase import Atoms -from ase.io import write - -d = 2.9 -L = 10.0 -wire = Atoms('Au', - positions=[(0, L / 2, L / 2)], - cell=(d, L, L), - pbc=(1, 0, 0)) -wire *= (6, 1, 1) -wire.positions[:, 0] -= 2 * d -wire.cell[0, 0] = d -# view(wire, block=1) -write('Au-wire.pov', wire, - rotation='12x,6y', - povray_settings=dict( - transparent=False)).render() diff --git a/doc/ase/atoms.rst b/doc/ase/atoms.rst deleted file mode 100644 index b4c4b20c80..0000000000 --- a/doc/ase/atoms.rst +++ /dev/null @@ -1,373 +0,0 @@ -.. module:: ase.atoms -.. module:: ase - -================ -The Atoms object -================ - -The :class:`Atoms` object is a collection of atoms. Here -is how to define a CO molecule:: - - from ase import Atoms - d = 1.1 - co = Atoms('CO', positions=[(0, 0, 0), (0, 0, d)]) - -Here, the first argument specifies the type of the atoms and we used -the ``positions`` keywords to specify their positions. Other -possible keywords are: ``numbers``, ``tags``, ``momenta``, ``masses``, -``magmoms`` and ``charges``. - -Here is how you could make an infinite gold wire with a bond length of -2.9 Å:: - - from ase import Atoms - d = 2.9 - L = 10.0 - wire = Atoms('Au', - positions=[[0, L / 2, L / 2]], - cell=[d, L, L], - pbc=[1, 0, 0]) - -.. image:: Au-wire.png - -Here, two more optional keyword arguments were used: - -``cell``: Unit cell size - This can be a sequence of three numbers for - an orthorhombic unit cell or three by three numbers for a general - unit cell (a sequence of three sequences of three numbers) or six numbers - (three legths and three angles in degrees). The default value is - *[0,0,0]* which is the same as - *[[0,0,0],[0,0,0],[0,0,0]]* or *[0,0,0,90,90,90]* meaning that none of the - three lattice vectors are defined. - -``pbc``: Periodic boundary conditions - The default value is *False* - a value of *True* would give - periodic boundary conditions along all three axes. It is possible - to give a sequence of three booleans to specify periodicity along - specific axes. - -You can also use the following methods to work with the unit cell and -the boundary conditions: :meth:`~Atoms.set_pbc`, -:meth:`~Atoms.set_cell`, :meth:`~Atoms.get_cell`, -and :meth:`~Atoms.get_pbc`. - - -Working with the array methods of Atoms objects -=============================================== - -Like with a single :class:`~ase.atom.Atom` the properties of a collection of atoms -can be accessed and changed with get- and set-methods. For example -the positions of the atoms can be addressed as - ->>> from ase import Atoms ->>> atoms = Atoms('N3', [(0, 0, 0), (1, 0, 0), (0, 0, 1)]) ->>> atoms.get_positions() -array([[ 0., 0., 0.], - [ 1., 0., 0.], - [ 0., 0., 1.]]) ->>> atoms.set_positions([(2, 0, 0), (0, 2, 2), (2, 2, 0)]) ->>> atoms.get_positions() -array([[ 2., 0., 0.], - [ 0., 2., 2.], - [ 2., 2., 0.]]) - -Here is the full list of the get/set methods operating on all the -atoms at once. The get methods return an array of quantities, one for -each atom; the set methods take similar arrays. -E.g. :meth:`~Atoms.get_positions` return N * 3 numbers, -:meth:`~Atoms.get_atomic_numbers` return N integers. - -*These methods return copies of the internal arrays. It is thus safe -to modify the returned arrays.* - -.. list-table:: - - * - :meth:`~Atoms.get_atomic_numbers` - - :meth:`~Atoms.set_atomic_numbers` - * - :meth:`~Atoms.get_initial_charges` - - :meth:`~Atoms.set_initial_charges` - * - :meth:`~Atoms.get_charges` - - - * - :meth:`~Atoms.get_chemical_symbols` - - :meth:`~Atoms.set_chemical_symbols` - * - :meth:`~Atoms.get_initial_magnetic_moments` - - :meth:`~Atoms.set_initial_magnetic_moments` - * - :meth:`~Atoms.get_magnetic_moments` - - - * - :meth:`~Atoms.get_masses` - - :meth:`~Atoms.set_masses` - * - :meth:`~Atoms.get_momenta` - - :meth:`~Atoms.set_momenta` - * - :meth:`~Atoms.get_forces` - - - * - :meth:`~Atoms.get_positions` - - :meth:`~Atoms.set_positions` - * - :meth:`~Atoms.get_potential_energies` - - - * - :meth:`~Atoms.get_scaled_positions` - - :meth:`~Atoms.set_scaled_positions` - * - :meth:`~Atoms.get_stresses` - - - * - :meth:`~Atoms.get_tags` - - :meth:`~Atoms.set_tags` - * - :meth:`~Atoms.get_velocities` - - :meth:`~Atoms.set_velocities` - -There are also a number of get/set methods that operate on quantities -common to all the atoms or defined for the collection of atoms: - -.. list-table:: - - * - :meth:`~Atoms.get_calculator` - - :meth:`~Atoms.set_calculator` - * - :meth:`~Atoms.get_cell` - - :meth:`~Atoms.set_cell` - * - :meth:`~Atoms.get_cell_lengths_and_angles` - - - * - :meth:`~Atoms.get_center_of_mass` - - - * - :meth:`~Atoms.get_kinetic_energy` - - - * - :meth:`~Atoms.get_magnetic_moment` - - - * - :meth:`~Atoms.get_global_number_of_atoms` - - - * - :meth:`~Atoms.get_pbc` - - :meth:`~Atoms.set_pbc` - * - :meth:`~Atoms.get_potential_energy` - - - * - :meth:`~Atoms.get_stress` - - - * - :meth:`~Atoms.get_total_energy` - - - * - :meth:`~Atoms.get_volume` - - - - -Unit cell and boundary conditions -================================= - -The :class:`Atoms` object holds a unit cell. The unit cell -is a :class:`~ase.cell.Cell` object which resembles a 3x3 matrix -when used with numpy, arithmetic operations, or indexing: - ->>> atoms.cell -Cell([0.0, 0.0, 0.0], pbc=False) ->>> atoms.cell[:] -array([[0., 0., 0.], - [0., 0., 0.], - [0., 0., 0.]]) - -The cell can be defined or changed using the -:meth:`~Atoms.set_cell` method. Changing the unit cell -does per default not move the atoms: - ->>> import numpy as np ->>> atoms.set_cell(2 * np.identity(3)) ->>> atoms.get_cell() -Cell([2.0, 2.0, 2.0], pbc=False) ->>> atoms.set_positions([(2, 0, 0), (1, 1, 0), (2, 2, 0)]) ->>> atoms.get_positions() -array([[ 2., 0., 0.], - [ 1., 1., 0.], - [ 2., 2., 0.]]) - -However if we set ``scale_atoms=True`` the atomic positions are scaled with -the unit cell: - ->>> atoms.set_cell(np.identity(3), scale_atoms=True) ->>> atoms.get_positions() -array([[ 1. , 0. , 0. ], - [ 0.5, 0.5, 0. ], - [ 1. , 1. , 0. ]]) - -The :meth:`~Atoms.set_pbc` method specifies whether -periodic boundary conditions are to be used in the directions of the -three vectors of the unit cell. A slab calculation with periodic -boundary conditions in *x* and *y* directions and free boundary -conditions in the *z* direction is obtained through - ->>> atoms.set_pbc((True, True, False)) - -or - ->>> atoms.pbc = (True, True, False) - -.. _atoms_special_attributes: - -Special attributes -================== - -It is also possible to work directly with the attributes -:attr:`~Atoms.positions`, :attr:`~Atoms.numbers`, -:attr:`~Atoms.pbc` and :attr:`~Atoms.cell`. Here -we change the position of the 2nd atom (which has count number 1 -because Python starts counting at zero) and the type of the first -atom: - ->>> atoms.positions *= 2 ->>> atoms.positions[1] = (1, 1, 0) ->>> atoms.get_positions() -array([[ 2., 0., 0.], - [ 1., 1., 0.], - [ 2., 2., 0.]]) ->>> atoms.positions -array([[ 2., 0., 0.], - [ 1., 1., 0.], - [ 2., 2., 0.]]) ->>> atoms.numbers -array([7, 7, 7]) ->>> atoms.numbers[0] = 13 ->>> atoms.get_chemical_symbols() -['Al', 'N', 'N'] - -The atomic numbers can also be edited using the :attr:`~Atoms.symbols` -shortcut (see also :class:`ase.symbols.Symbols`): - ->>> atoms.symbols -Symbols('AlN2') ->>> atoms.symbols[2] = 'Cu' ->>> atoms.symbols -Symbols('AlNCu') ->>> atoms.numbers -array([13, 7, 29]) - -Check for periodic boundary conditions: - ->>> atoms.pbc # equivalent to atoms.get_pbc() -array([ True, True, False], dtype=bool) ->>> atoms.pbc.any() -True ->>> atoms.pbc[2] = 1 ->>> atoms.pbc -array([ True, True, True], dtype=bool) - -Hexagonal unit cell: - ->>> atoms.cell = [2.5, 2.5, 15, 90, 90, 120] - -Attributes that can be edited directly are: - -* :meth:`~Atoms.numbers` -* :meth:`~Atoms.symbols` -* :meth:`~Atoms.positions` -* :meth:`~Atoms.cell` -* :meth:`~Atoms.pbc` -* :meth:`~Atoms.constraints` - - - -Adding a calculator -=================== - -A calculator can be attached to the atoms with the purpose -of calculating energies and forces on the atoms. ASE works with many -different :mod:`ase.calculators`. - -A calculator object *calc* is attached to the atoms like this: - ->>> atoms.calc = calc - -After the calculator has been appropriately setup the energy of the -atoms can be obtained through - ->>> atoms.get_potential_energy() - -The term "potential energy" here means for example the total energy of -a DFT calculation, which includes both kinetic, electrostatic, and -exchange-correlation energy for the electrons. The reason it is called -potential energy is that the atoms might also have a kinetic energy -(from the moving nuclei) and that is obtained with - ->>> atoms.get_kinetic_energy() - -In case of a DFT calculator, it is up to the user to check exactly what -the :meth:`~Atoms.get_potential_energy` method returns. For -example it may be the result of a calculation with a finite -temperature smearing of the occupation numbers extrapolated to zero -temperature. More about this can be found for the different -:mod:`ase.calculators`. - -The following methods can only be called if a calculator is present: - -* :meth:`~Atoms.get_potential_energy` -* :meth:`~Atoms.get_potential_energies` -* :meth:`~Atoms.get_forces` -* :meth:`~Atoms.get_stress` -* :meth:`~Atoms.get_stresses` -* :meth:`~Atoms.get_total_energy` -* :meth:`~Atoms.get_magnetic_moments` -* :meth:`~Atoms.get_magnetic_moment` - -Not all of these methods are supported by all calculators. - - -List-methods -============ - -.. list-table:: - - * - method - - example - * - ``+`` - - ``wire2 = wire + co`` - * - ``+=``, :meth:`~Atoms.extend` - - ``wire += co`` - - ``wire.extend(co)`` - * - :meth:`~Atoms.append` - - ``wire.append(Atom('H'))`` - * - ``*`` - - ``wire3 = wire * (3, 1, 1)`` - * - ``*=``, :meth:`~Atoms.repeat` - - ``wire *= (3, 1, 1)`` - - ``wire.repeat((3, 1, 1))`` - * - ``len`` - - ``len(co)`` - * - ``del`` - - ``del wire3[0]`` - - ``del wire3[[1,3]]`` - * - :meth:`~Atoms.pop` - - ``oxygen = wire2.pop()`` - - -Note that the ``del`` method can be used with the more powerful numpy-style indexing, as in the second example above. This can be combined with python list comprehension in order to selectively delete atoms within an ASE Atoms object. For example, the below code creates an ethanol molecule and subsequently strips all the hydrogen atoms from it:: - - from ase.build import molecule - atoms = molecule('CH3CH2OH') - del atoms[[atom.index for atom in atoms if atom.symbol=='H']] - - -Other methods -============= - -* :meth:`~Atoms.center` -* :meth:`~Atoms.wrap` -* :meth:`~Atoms.translate` -* :meth:`~Atoms.rotate` -* :meth:`~Atoms.euler_rotate` -* :meth:`~Atoms.get_dihedral` -* :meth:`~Atoms.set_dihedral` -* :meth:`~Atoms.rotate_dihedral` -* :meth:`~Atoms.rattle` -* :meth:`~Atoms.set_constraint` -* :meth:`~Atoms.set_distance` -* :meth:`~Atoms.copy` -* :meth:`~Atoms.get_center_of_mass` -* :meth:`~Atoms.get_distance` -* :meth:`~Atoms.get_distances` -* :meth:`~Atoms.get_all_distances` -* :meth:`~Atoms.get_volume` -* :meth:`~Atoms.has` -* :meth:`~Atoms.edit` - - - -List of all Methods -=================== - -.. autoclass:: Atoms - :members: diff --git a/doc/ase/build/build.rst b/doc/ase/build/build.rst deleted file mode 100644 index 676d8c9aa5..0000000000 --- a/doc/ase/build/build.rst +++ /dev/null @@ -1,206 +0,0 @@ -.. module:: ase.build - -================ -Building things -================ - -Quick links: - -* Simple bulk crystals: :func:`~ase.build.bulk` - -* Simple molecules: :func:`~ase.build.molecule` - -* Special surfaces: - - * fcc: :func:`~ase.build.fcc100`, :func:`~ase.build.fcc110`, - :func:`~ase.build.fcc111`, :func:`~ase.build.fcc211`, - :func:`~ase.build.fcc111_root` - - * bcc: :func:`~ase.build.bcc100`, :func:`~ase.build.bcc110`, - :func:`~ase.build.bcc111` - * - :func:`~ase.build.bcc111_root` - - * hcp: :func:`~ase.build.hcp0001`, :func:`~ase.build.hcp10m10`, - :func:`~ase.build.hcp0001_root` - - * diamond: :func:`~ase.build.diamond100`, :func:`~ase.build.diamond111` - -* `MX_2` (2H or 1T): :func:`~ase.build.mx2` - -* Other surface tools: :func:`~ase.build.surface`, - :func:`~ase.build.add_adsorbate`, :func:`~ase.build.add_vacuum`, - :func:`~ase.build.root_surface` - -* 1D: :func:`~ase.build.nanotube`, :func:`~ase.build.graphene_nanoribbon` - -* Other tools: :func:`~ase.build.cut`, :func:`~ase.build.stack`, - :func:`~ase.build.sort`, :func:`~ase.build.minimize_tilt`, - :func:`~ase.build.niggli_reduce`, :func:`~ase.build.rotate`, - :func:`~ase.build.minimize_rotation_and_translation`, - :func:`~ase.build.get_deviation_from_optimal_cell_shape`, - :func:`~ase.build.find_optimal_cell_shape`, - :func:`~ase.build.make_supercell` - -* Separation: :func:`~ase.build.connected_indices`, - :func:`~ase.build.connected_atoms`, :func:`~ase.build.separate`, - :func:`~ase.build.split_bond` - -.. toctree:: - :maxdepth: 2 - - surface - tools - connected - -.. seealso:: - - * The :mod:`ase.lattice` module. The module contains functions for - creating most common crystal structures with arbitrary orientation. - The user can specify the desired Miller index along the three axes - of the simulation, and the smallest periodic structure fulfilling - this specification is created. Both bulk crystals and surfaces can - be created. - - * The :mod:`ase.cluster` module. Useful for creating nanoparticles - and clusters. - - * The :mod:`ase.spacegroup` module - - * The :mod:`ase.geometry` module - - - -Molecules -========= - -The G2-database of common molecules is available: - -.. autofunction:: molecule - -Example:: - ->>> from ase.build import molecule ->>> atoms = molecule('H2O') - -The list of available molecules is those from the :data:`ase.collections.g2` -database: - ->>> from ase.collections import g2 ->>> g2.names -['PH3', 'P2', 'CH3CHO', 'H2COH', 'CS', 'OCHCHO', 'C3H9C', 'CH3COF', - 'CH3CH2OCH3', 'HCOOH', 'HCCl3', 'HOCl', 'H2', 'SH2', 'C2H2', - 'C4H4NH', 'CH3SCH3', 'SiH2_s3B1d', 'CH3SH', 'CH3CO', 'CO', 'ClF3', - 'SiH4', 'C2H6CHOH', 'CH2NHCH2', 'isobutene', 'HCO', 'bicyclobutane', - 'LiF', 'Si', 'C2H6', 'CN', 'ClNO', 'S', 'SiF4', 'H3CNH2', - 'methylenecyclopropane', 'CH3CH2OH', 'F', 'NaCl', 'CH3Cl', - 'CH3SiH3', 'AlF3', 'C2H3', 'ClF', 'PF3', 'PH2', 'CH3CN', - 'cyclobutene', 'CH3ONO', 'SiH3', 'C3H6_D3h', 'CO2', 'NO', - 'trans-butane', 'H2CCHCl', 'LiH', 'NH2', 'CH', 'CH2OCH2', - 'C6H6', 'CH3CONH2', 'cyclobutane', 'H2CCHCN', 'butadiene', 'C', - 'H2CO', 'CH3COOH', 'HCF3', 'CH3S', 'CS2', 'SiH2_s1A1d', 'C4H4S', - 'N2H4', 'OH', 'CH3OCH3', 'C5H5N', 'H2O', 'HCl', 'CH2_s1A1d', - 'CH3CH2SH', 'CH3NO2', 'Cl', 'Be', 'BCl3', 'C4H4O', 'Al', 'CH3O', - 'CH3OH', 'C3H7Cl', 'isobutane', 'Na', 'CCl4', 'CH3CH2O', 'H2CCHF', - 'C3H7', 'CH3', 'O3', 'P', 'C2H4', 'NCCN', 'S2', 'AlCl3', 'SiCl4', - 'SiO', 'C3H4_D2d', 'H', 'COF2', '2-butyne', 'C2H5', 'BF3', 'N2O', - 'F2O', 'SO2', 'H2CCl2', 'CF3CN', 'HCN', 'C2H6NH', 'OCS', 'B', 'ClO', - 'C3H8', 'HF', 'O2', 'SO', 'NH', 'C2F4', 'NF3', 'CH2_s3B1d', 'CH3CH2Cl', - 'CH3COCl', 'NH3', 'C3H9N', 'CF4', 'C3H6_Cs', 'Si2H6', 'HCOOCH3', 'O', - 'CCH', 'N', 'Si2', 'C2H6SO', 'C5H8', 'H2CF2', 'Li2', 'CH2SCH2', 'C2Cl4', - 'C3H4_C3v', 'CH3COCH3', 'F2', 'CH4', 'SH', 'H2CCO', 'CH3CH2NH2', 'Li', - 'N2', 'Cl2', 'H2O2', 'Na2', 'BeH', 'C3H4_C2v', 'NO2'] - -plus ``Be2``, ``C7NH5``, ``BDA``, ``biphenyl`` and ``C60`` (for historical -reasons). - -More complicated molecules may be obtained using the PubChem API integration in -the :func:`~ase.data.pubchem.pubchem_atoms_search` and :func:`~ase.data.pubchem.pubchem_atoms_conformer_search` -functions. You may search based on common name, chemical identification number -(cid), smiles string, or conformer identification number. - -.. _bulk-crystal-section: - -Common bulk crystals -==================== - -.. autofunction:: bulk - -examples: - ->>> from ase.build import bulk ->>> a1 = bulk('Cu', 'fcc', a=3.6) ->>> a2 = bulk('Cu', 'fcc', a=3.6, orthorhombic=True) ->>> a3 = bulk('Cu', 'fcc', a=3.6, cubic=True) ->>> a1.cell -array([[ 0. , 1.8, 1.8], - [ 1.8, 0. , 1.8], - [ 1.8, 1.8, 0. ]]) ->>> a2.cell -array([[ 2.546, 0. , 0. ], - [ 0. , 2.546, 0. ], - [ 0. , 0. , 3.6 ]]) ->>> a3.cell -array([[ 3.6, 0. , 0. ], - [ 0. , 3.6, 0. ], - [ 0. , 0. , 3.6]]) - -|a1| |a2| |a3| - -.. |a1| image:: a1.png -.. |a2| image:: a2.png -.. |a3| image:: a3.png - - -.. _nanotubes-section: - -Nanotubes -========= - -.. autofunction:: nanotube - -examples: - ->>> from ase.build import nanotube ->>> cnt1 = nanotube(6, 0, length=4) ->>> cnt2 = nanotube(3, 3, length=6, bond=1.4, symbol='Si') - -|cnt1| |cnt2| - -.. |cnt1| image:: cnt1.png -.. |cnt2| image:: cnt2.png - - -.. _nanoribbons-section: - -Graphene nanoribbons -==================== - -.. autofunction:: graphene_nanoribbon - -examples: - ->>> from ase.build import graphene_nanoribbon ->>> gnr1 = graphene_nanoribbon(3, 4, type='armchair', saturated=True, - vacuum=3.5) ->>> gnr2 = graphene_nanoribbon(2, 6, type='zigzag', saturated=True, -... C_H=1.1, C_C=1.4, vacuum=3.0, -... magnetic=True, initial_mag=1.12) - -|gnr1| |gnr2| - -.. |gnr1| image:: gnr1.png -.. |gnr2| image:: gnr2.png - -ASE contains a number of modules for setting up atomic structures, -mainly molecules, bulk crystals and surfaces. Some of these modules -have overlapping functionality, but strike a different balance between -flexibility and ease-of-use. - -.. _attaching-section: - -Attaching structures -==================== - -.. autofunction:: ase.build.attach.attach -.. autofunction:: ase.build.attach.attach_randomly -.. autofunction:: ase.build.attach.attach_randomly_and_broadcast diff --git a/doc/ase/build/connected.rst b/doc/ase/build/connected.rst deleted file mode 100644 index e61c35657a..0000000000 --- a/doc/ase/build/connected.rst +++ /dev/null @@ -1,8 +0,0 @@ -======================== -Separation of structures -======================== - -.. autofunction:: ase.build.connected_indices -.. autofunction:: ase.build.connected_atoms -.. autofunction:: ase.build.separate -.. autofunction:: ase.build.split_bond diff --git a/doc/ase/build/general_surface.py b/doc/ase/build/general_surface.py deleted file mode 100644 index fe91b31ca5..0000000000 --- a/doc/ase/build/general_surface.py +++ /dev/null @@ -1,54 +0,0 @@ -# creates: s1.png s2.png s3.png s4.png general_surface.pdf -import os -import shutil -from pathlib import Path - -from ase import Atoms -from ase.build import bulk, surface -from ase.io import write - -# Au example: -s1 = surface('Au', (2, 1, 1), 9) -s1.center(vacuum=10, axis=2) -# Mo example: -Mobulk = bulk('Mo', 'bcc', a=3.16, cubic=True) -s2 = surface(Mobulk, (3, 2, 1), 9) -s2.center(vacuum=10, axis=2) -# Pt3Rh example: -a = 4.0 -Pt3Rh = Atoms('Pt3Rh', - scaled_positions=[(0, 0, 0), - (0.5, 0.5, 0), - (0.5, 0, 0.5), - (0, 0.5, 0.5)], - cell=[a, a, a], - pbc=True) -s3 = surface(Pt3Rh, (2, 1, 1), 9) -s3.center(vacuum=10, axis=2) - -Pt3Rh.set_chemical_symbols('PtRhPt2') -s4 = surface(Pt3Rh, (2, 1, 1), 9) -s4.center(vacuum=10, axis=2) -# Done - -for atoms, name in [(s1, 's1'), (s2, 's2'), (s3, 's3'), (s4, 's4')]: - write(name + '.pov', atoms, - rotation='-90x', - povray_settings=dict( - transparent=False)).render() - - -dir = os.environ.get('PDF_FILE_DIR') -if dir: - shutil.copyfile(Path(dir) / 'general_surface.pdf', - 'general_surface.pdf') -else: - for i in range(2): - error = os.system( - 'pdflatex -interaction=nonstopmode general_surface > /dev/null') - if error: - with open('general_surface.pdf', 'w') as fd: - fd.write('pdflatex not found\n') - break - os.remove('general_surface.aux') - os.remove('general_surface.log') diff --git a/doc/ase/build/general_surface.tex b/doc/ase/build/general_surface.tex deleted file mode 100644 index 1677849e90..0000000000 --- a/doc/ase/build/general_surface.tex +++ /dev/null @@ -1,295 +0,0 @@ -\documentclass[11pt]{article} % use larger type; default would be 10pt -\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX) -\usepackage{graphicx} % support the \includegraphics command and options -\usepackage{color} -\usepackage{array} % for better arrays (eg matrices) in maths -\usepackage{verbatim} % adds environment for commenting out blocks of text & fo -\title{Theory and implementation behind: \\Universal surface creation - smallest unitcell} -\author{Bjarke Brink Buus, Jakob Howalt \& Thomas Bligaard} -\begin{document} -\maketitle -\section{Construction of surface slabs} -The aim for this part of the project is to create all possible surfaces with a given Miller Indice and the conventional bulk structure. In this section, the theory behind the construction of surface slabs will be outlined and from this fundament an implementation has been developed in Python. This implementation, will be able to create any surface for any type of structure including following common bulk structures - the simple cubic unit cell, the body centered cubic unit cell, the face centered cubic unit cell and the hexagonal close packed unit cell. -%TODO skal dette med: The theory and implementation, however, should work for any unit cell. -%In this implementation, we will consider all three cases of bulk structures - the body centered cubic unit cell (bcc), the face centered cubic unit cell (ffc) and the hexagonal close packed unit cell (hcp). -\subsection{Theory} -By introducing both the real and the reciprocal lattice spaces most pieces of the puzzle of creating any surface is derived. In addition some integer mathmatics will be used. -\subsubsection{Real lattice space} -First, we will start by defining the system in real space. We have three basis vectors that span the crystal lattice in the conventional unit cell ($\vec{a}_1,\vec{a}_2,\vec{a}_3$). These three vectors do not have to be orthogonal and the procedure will therefore also work for hcp structures. Additionally, the lengths of the vectors will not in all cases be the same, so the theoretical approach to this problem, will involve three independent lengths. For most bulk structures there will only be one or two different lattice constants determining the unit cell due to symmetry, for instance the L10 and L12 alloys as mentioned in section XXX method XXX. The unit cell can be seen in drawing 1 with the lengths and directions. - -\setlength{\unitlength}{2.5cm} -\begin{picture}(1,1)(-0.65,0.05) -\thicklines -\put(0.1,0.1){\line(0,1){0.7}} -\put(0.1,0.1){\line(1,0){0.7}} -\put(0.1,0.8){\line(1,0){0.7}} -\put(0.8,0.1){\line(0,1){0.7}} -\put(0.8,0.1){\line(4,1){0.4}} -\put(0.1,0.8){\line(4,1){0.4}} -\put(0.8,0.8){\line(4,1){0.4}} -\put(0.5,0.9){\line(1,0){0.7}} -\put(1.2,0.2){\line(0,1){0.7}} -\put(2.45,0.4){\vector(0,1){0.3}} -\put(2.45,0.4){\vector(1,0){0.3}} -\put(2.45,0.4){\vector(-4,-1){0.2}} -\put(2.4,0.75){$\vec{a}_3$} -\put(2.1,0.32){$\vec{a}_1$} -\put(2.8,0.35){$\vec{a}_2$} -\thinlines -\put(1.235,0.5){$a_3$} -\put(0.45,0.0){$a_2$} -\put(1.02,0.06){$a_1$} -\put(0.5,0.2){\line(1,0){0.7}} -\put(0.5,0.2){\line(0,1){0.7}} -\put(0.1,0.1){\line(4,1){0.4}} -\end{picture}\\ -Drawing 1: \textit{This drawing shows the basis vectors and sizes for the system.}\\ - - -A surface is defined by its Miller Indice (h,k,l), where $h$, $k$ and $l$ all are integers, which in real space can be described by the crystal planes that are parallel to the plane that intersects the basis vectors ($\vec{a}_1,\vec{a}_2,\vec{a}_3$) at -\begin{eqnarray} -\frac{1}{h}\vec{a}_1, \ \frac{1}{k}\vec{a}_2, \ \frac{1}{l}\vec{a}_3. \nonumber -\end{eqnarray} -The Miller Indices are used for all four types of structures sc, bcc, fcc and hcp. -In case of one or more of the Miller Indice (h,k,l) is zero, the plane does not intersect with the corresponding axis. For instance, if k is equal to zero, the normal vector to the plane, defined by (h,0,l), will be orthogonal to $\vec{a}_2$. A (0,0,0) Miller Indice is unphysical and hence will not be included in the theory section, however a part of the implementation code will notify the user that the chosen surface is not possible to create. \\ -%Normally, a plane can be defined as $b_1 x + b_2 y + b_3 z = d$. Here the normal vector will be ($b_1,b_2,b_3$) and $d$ will be a constant. If a point ($x_0,y_0,z_0$) in the plane is known, $d$ will equal to -%\begin{eqnarray} -%d = b_1 x_0 + b_2 y_0 + b_3 z_0 \nonumber -%\end{eqnarray} - -\subsubsection{Reciprocal lattice space} -For the full understanding of the lattice construction, it is very useful to introduce the reciprocal vector space. The basis vectors in the reciprocal lattice space are given by, -\begin{eqnarray} -\vec{b}_1 = \frac{\vec{a}_2 \times \vec{a}_3}{\vec{a}_1 \cdot (\vec{a}_2 \times \vec{a}_3)}, \ \vec{b}_2 = \frac{\vec{a}_3 \times \vec{a}_1}{\vec{a}_2 \cdot (\vec{a}_3 \times \vec{a}_1)}, \ \vec{b}_3 = \frac{\vec{a}_1 \times \vec{a}_2}{\vec{a}_3 \cdot (\vec{a}_1 \times \vec{a}_2)} -\end{eqnarray} -% The geometry of the three reciprocal lattice vectors is as follows, $\vec{b}_1$ is orthogonal with both $\vec{a}_2$ and $\vec{a}_3$, because of the cross product in the construction of $\vec{b}_1$. The same follows for the other reciprocal lattice vectors, $\vec{b}_2 \ \perp \ (\vec{a}_1, \ \vec{a}_3)$ and $\vec{b}_3 \ \perp \ (\vec{a}_1, \ \vec{a}_2)$. In a more compact form, this can be written as -\begin{eqnarray} -\vec{a}_i \cdot \vec{b}_j = \delta_{ij} \label{orthogonality} -\end{eqnarray} -When introducing the reciprocal lattice vectors, the normal vector for a given surface plane with the Miller Indices (hkl) is given by -\begin{eqnarray} -\vec{n} = h \vec{b}_1 + k \vec{b}_2 + l \vec{b}_3 \label{hklnormalvector} -\end{eqnarray} - - -\setlength{\unitlength}{4.4cm} -\begin{picture}(2,1.2) -\thicklines -\put(0.04,0.04){\line(0,1){0.64}} \put(0.04,0.04){\line(1,0){0.765}} -\put(0.805,0.04){\line(0,1){0.64}} \put(0.04,0.68){\line(1,0){0.765}} - -\put(0.04,0.36){\line(1,0){0.765}} - -\put(0.4225,0.04){\line(0,1){0.64}} \put(1.002,0.2){\line(0,1){0.64}} - -\put(0.24,0.84){\line(1,0){0.765}} - -\put(0.805,0.04){\line(5,4){0.195}} \put(0.805,0.68){\line(5,4){0.195}} -\put(0.805,0.36){\line(5,4){0.195}} \put(0.04,0.68){\line(5,4){0.195}} -\put(0.4225,0.68){\line(5,4){0.195}} - -\thinlines -\put(0.24,0.52){\line(1,0){0.765}} \put(0.04,0.36){\line(5,4){0.2}} -\put(0.4225,0.36){\line(5,4){0.2}} \put(0.4225,0.04){\line(5,4){0.2}} -\put(0.24,0.2){\line(1,0){0.765}} \put(0.24,0.2){\line(0,1){0.64}} -\put(0.04,0.04){\line(5,4){0.2}} \put(0.6175,0.20){\line(0,1){0.64}} -\thicklines -\color{red} -\put(0.04,0.04){\line(1,4){0.2}} \put(0.24,0.84){\line(6,-5){0.762}} -\put(0.04,0.04){\line(6,1){0.962}} -\color{black} -\put(0.085,0.535){$\vec{t}_3$} -\put(0.70,0.07){$\vec{t}_1$} -\put(0.55,0.6){$\vec{t}_2$} - -\thinlines -\put(1.2,0.68){\line(1,0){0.765}} \put(1.002,0.52){\line(5,4){0.2}} -\put(1.3845,0.52){\line(5,4){0.2}} \put(1.3845,0.2){\line(5,4){0.2}} -\put(1.202,0.36){\line(1,0){0.765}} \put(1.2,0.36){\line(0,1){0.64}} -\put(1.002,0.2){\line(5,4){0.2}} \put(1.5852,0.360){\line(0,1){0.64}} -\thicklines -\color{red} -\thinlines -\put(0.24,0.84){\line(6,1){0.962}} -\put(1.002,0.2){\line(1,4){0.2}} -\put(1.202,1){\line(6,-5){0.762}} -\put(1.002,0.2){\line(6,1){0.962}} -\color{black} -\thicklines - -\thinlines -\put(0.44,0.68){\line(1,0){0.765}} \put(0.24,0.52){\line(5,4){0.195}} -\put(0.6225,0.52){\line(5,4){0.195}} \put(0.6225,0.2){\line(5,4){0.195}} -\put(0.44,0.36){\line(1,0){0.765}} \put(0.44,0.36){\line(0,1){0.64}} -\put(0.24,0.2){\line(5,4){0.195}} \put(0.8175,0.36){\line(0,1){0.64}} -\thicklines -\put(0.04,0.04){\line(0,1){0.64}} \put(0.04,0.04){\line(1,0){0.765}} -\put(0.805,0.04){\line(0,1){0.64}} \put(0.04,0.68){\line(1,0){0.765}} - -\put(1.002,0.2){\line(1,0){0.765}} -\put(1.765,0.2){\line(0,1){0.64}} \put(1.002,0.84){\line(1,0){0.765}} -\put(1.002,0.52){\line(1,0){0.765}} -\put(1.3845,0.2){\line(0,1){0.64}} \put(1.964,0.36){\line(0,1){0.64}} -\put(1.2,1.0){\line(1,0){0.765}} -\put(1.765,0.2){\line(5,4){0.195}} \put(1.765,0.84){\line(5,4){0.195}} -\put(1.765,0.52){\line(5,4){0.195}} \put(1.002,0.84){\line(5,4){0.195}} -\put(1.3845,0.84){\line(5,4){0.195}} -\put(0.04,0.36){\line(1,0){0.765}} - -\put(0.4225,0.04){\line(0,1){0.64}} \put(1.002,0.2){\line(0,1){0.64}} -\put(0.44,1){\line(1,0){0.765}} -\put(0.805,0.04){\line(5,4){0.195}} \put(0.805,0.68){\line(5,4){0.195}} -\put(0.805,0.36){\line(5,4){0.195}} \put(0.24,0.84){\line(5,4){0.195}} -\put(0.6225,0.84){\line(5,4){0.195}} - -\put(2.3,0.4){\vector(0,1){0.3}} -\put(2.3,0.4){\vector(1,0){0.3}} -\put(2.3,0.4){\line(-5,-4){0.15}} -\put(2.155,0.2847){\vector(-1,-1){0.025}} -\put(2.25,0.75){$\vec{a}_3$} -\put(2.05,0.26){$\vec{a}_1$} -\put(2.63,0.35){$\vec{a}_2$} -\label{unik} -\end{picture} -\setlength{\unitlength}{4cm} -\begin{picture}(2,1.2)(-0.65,0.05) -\put(1.5,0.4){\vector(0,1){0.3}} -\put(1.5,0.4){\vector(1,0){0.3}} -\put(1.5,0.4){\line(-5,-4){0.15}} -\put(1.355,0.2847){\vector(-1,-1){0.025}} -\put(1.45,0.75){$\vec{a}_3$} -\put(1.2,0.32){$\vec{a}_1$} -\put(1.9,0.35){$\vec{a}_2$} -\end{picture} -Drawing 2: \textit{This drawing shows a surface with Miller Indices (2,1,1). The repetition of a lattice point is shown, and the vectors spanning this surface can be found. }\\ - -Furthermore, a desired surface with a normal vector $\vec{n}$, drawing 2 shows that for a set of non-zero Miller indices, three vectors, will be noted $\vec{t}_{1,2,3}$, in the plane can easily be found. Two vectors, linearly independent ofcourse, created by a linear combination of the vectors $\vec{t}_{1,2,3}$, can span the desired surface. -These vectors are given by -\begin{eqnarray} -\vec{t}_1 = -\frac{1}{h}\vec{a}_1+\frac{1}{k}\vec{a}_2 ,\vec{t}_2 = \frac{1}{k}\vec{a}_2 - \frac{1}{l}\vec{a}_3, \vec{t}_3 = \frac{1}{h}\vec{a}_1 - \frac{1}{l}\vec{a}_3 \nonumber -\end{eqnarray} -but it should be noted that the anti-parallel versions of $\vec{t}_{1,2,3}$ also can be used. Since $h$, $k$ and $l$ all are integers, we can multiply with the product $hkl$ and divide with the indice, which will be common for each of the lattice vectors, $\vec{a}_i$, with respect to both of the lattice vectors $\vec{a}_i$, so a new set of vectors end up being, -\begin{eqnarray} -\vec{t}_1 = k\vec{a}_1-h\vec{a}_2 ,\ \vec{t}_2 = l\vec{a}_1 - h\vec{a}_3, \ \vec{t}_3 = l\vec{a}_2 - k\vec{a}_3 -\end{eqnarray} -For the special cases of two of the Miller Indices being zero, it is a very straightforward, to see that the appropriate vectors to span the normal vector, will be the corresponding basis vectors in real space. If for instance, h and k both are zero, it will result in a choice of $\vec{v}_1$ $=$ $\vec{a}_1$ and $\vec{v}_2$ $=$ $\vec{a}_2$. - - -\subsubsection{Determination of the two surface vectors} -Having introduced the real space and the reciprocal space, most of the theory is available and hence the determination of the two vectors that span the surface with respect to a given Miller Indice is possible. - -The simple lattice points $r_{i,j,m}$ are placed at $\vec{r}_{i,j,m} = i\vec{a}_1+j\vec{a}_2+k\vec{a}_3$ where $\ i,j,m$ all are integers. Because of the arrangement of the lattice points, not all surface planes will go through these points. The dot product between the normal vector $\vec{n}$ and the lattice points $\vec{r}_{i,j,m}$ gives, -\begin{eqnarray} -hi+kj+lm = d \nonumber -\end{eqnarray} -and since all constants are integers, $d$ must also be an integer and therefore the values of $d$ has been quantized. This equation is a 'Linear Diophantine Equation' and the smallest $d$ for which there exist an non-zero solution ($i,j,m$) when ($h,k,l$) are non-zero is, accordingly to 'Bezouts Identity', when $d$ is the smallest common divisor of $h$, $k$, and $l$. If one or two of the Miller Indices is zero, the identity is true, but only when choosing the largest common divisor for the non-zero parts of ($h,k,l$). If a Miller indice has a common divisor $e >$ 1, the non-zero components of the Miller Indice can then be reduced with $\frac{1}{e}(h,k,l)$, and still define the same surface. \\ -A solution will therefore exist for -\begin{eqnarray} -hi+kj+lm = d -\end{eqnarray} -and because of the reduction of the normal vector, the value for $d$ will be $\pm$1. The two surface vectors, must obey the fact that they are orthogonal with respect to the normal vector $\vec{n}$, -\begin{eqnarray} -\vec{v}_{1,2} \cdot \vec{n} = 0. \label{skalarnul} -\end{eqnarray} -Because of this, the cross product between the two surface vectors $\vec{v}_1$ and $\vec{v}_2$ must give a constant times the normal vector $\vec{n}$. The constant must be as small as possible, still non zero, because the area spanned by $\vec{v}_1$ and $\vec{v}_2$ is equal to the length of the cross product. And since the new normal vector is the smallest possible, the constant must be $\pm 1$. \\ -Consider a choice of the two surface vectors, $\vec{t}_1$ and $\vec{t}_3$. They will both fullfil equation \ref{skalarnul}, however the crossproduct between $\vec{t}_1$ and $\vec{t}_3$ will be, -\begin{eqnarray} -\vec{t}_1 \times \vec{t}_3 = \left( \begin{array}{c} k \\ - h \\ 0 \end{array} \right) \times \left( \begin{array}{c} 0 \\ l \\ -k \end{array} \right) = \left( \begin{array}{c} kh \\ k^2 \\ kl \end{array} \right) = k \left( \begin{array}{c} h \\ k \\ l \end{array} \right).\nonumber -\end{eqnarray} -Unless the size of $k$ is $\pm 1$, the size of the surface area spanned by $\vec{t}_1$ and $\vec{t}_3$ will be too big. It is therefore crucial to introduce a completely new linear combination of the three vectors $\vec{t}_1$, $\vec{t}_2$ and $\vec{t}_3$. A linear combination of $\vec{t}_1$ and $\vec{t}_2$ fulfill the same requirements when $p$ and $q$ are integers in -%new way of combining these vectors is presented and it is also shown that this combination fullfil the previous requirements. -\begin{eqnarray} -\left( p \left( \begin{array}{c} k \\ -h \\ 0 \end{array} \right) + q \left( \begin{array}{c} l \\ 0 \\ -h \end{array} \right) \right) \times \left( \begin{array}{c} 0 \\ l \\ -k \end{array} \right) \Rightarrow (pk + ql) \left( \begin{array}{c} h \\ k \\ l \end{array} \right) = \left( \begin{array}{c} h \\ k \\ l \end{array} \right) \label{hkldependency} -\end{eqnarray} -This leaves a more simple equation to solve, -\begin{eqnarray} -(pk + ql) = 1 \label{EquationFromTheory} -\end{eqnarray} -The solution to this equation can be found using the Extended Euclidean Algorithm to determine the unknowns integers, $p$ and $q$. The two new vectors, which span the surface are described -\begin{eqnarray} -\vec{v}_1 = p \left( \begin{array}{c} k\vec{a}_1 \\ - h \vec{a}_2 \\ 0 \end{array} \right) + q \left( \begin{array}{c} l \vec{a}_1 \\ 0 \\ - h \vec{a}_3 \end{array} \right), \ \vec{v}_2 = \left( \begin{array}{c} 0 \\ l\vec{a}_2 \\ -k\vec{a}_3 \end{array} \right) \label{v2formalism} -\end{eqnarray} -However, there are infinite possible solutions for $p$ and $q$ but some of the solutions are better than others, in relation to visualizing the surface. Therefore another criteria is implemented. The closer to being orthogonal the surface vectors are, the easier it becomes to apply adsorbates onto the the surface. The procedure for this will be explained in section \ref{implementation}, but the theory will be explained here. The solution for $p$ and $q$ can be chosen to accommodate this with respect to an integer, $c$, by -\begin{eqnarray} -\vec{v}_1 = (p+cl)\left( \begin{array}{c} k\vec{a}_1 \\ - h \vec{a}_2 \\ 0 \end{array} \right) + (q-ck)\left( \begin{array}{c} l \vec{a}_1 \\ 0 \\ - h \vec{a}_3 \end{array} \right) \label{v1formalism} -\end{eqnarray} -This change of vector $\vec{v}_1$, does not change the crossproduct between $\vec{v}_1$ and $\vec{v}_2$, as shown in equation \ref{hkldependency}, because the cross product between the changes and $\vec{v}_2$ is zero. This is shown below -\begin{eqnarray} -\left(cl \left( \begin{array}{c} k\vec{a}_1 \\ - h \vec{a}_2 \\ 0 \end{array} \right) - ck\left( \begin{array}{c} l \vec{a}_1 \\ 0 \\ - h \vec{a}_3 \end{array} \right) \right) \times \left( \begin{array}{c} 0 \\ l\vec{a}_2 \\ -k\vec{a}_3 \end{array} \right) & = & \nonumber \\ - \left( ckl \left( \begin{array}{c} h \\ k \\ l \end{array} \right) - ckl\left( \begin{array}{c} h \\ k \\ l \end{array} \right) \right) & = & 0 -\end{eqnarray} -This change of $\vec{v}_1$ results in an algorithm, which will be presented later, to determine the most appropriate choice of vectors. - -\subsubsection{Finding the 3$^{rd}$ vector for the new unit cell} -After determining the two vectors spanning the surface ($\vec{v}_1,\vec{v}_2$), the third basis vector($\vec{v}_3$) of the surface slab can be found. This vector does not need to be orthogonal to the two surface vectors. The vector will go from one lattice point to its repeated lattice point another place in the structure. This means that the same contraints apply to this vector as for $\vec{v}_1$ and $\vec{v}_2$, but some additional constraints will be added. The vector will have to be an integer linear combination of the three original lattice vectors ($\vec{a}_1, \vec{a}_2, \vec{a}_3$) and have the coordinates ($i_3\vec{a}_1,j_3\vec{a}_2,m_3\vec{a}_3$). In addition $\vec{v}_3$ cannot be orthogonal to the surface normal, so $\vec{v}_3\cdot\vec{n}\neq 0$. \\ -To find the integers $i_3, j_3$ and $m_3$ by calculating the dot product using normalvector of the surface from equation \ref{hklnormalvector}, and the definitions of the reciprocal vectors ($\vec{b}_1,\vec{b}_2,\vec{b}_3$): -\begin{eqnarray} - \vec{n} \cdot \vec{v}_3 & = (h \vec{b}_1 + k \vec{b}_2 + l \vec{b}_3 ) \cdot (i_3\vec{a}_1 + j_3\vec{a}_2 + m_3\vec{a}_3) \nonumber \\ - & = hi_3+kj_3+lm_3 = d \label{vdotn}, -\end{eqnarray} -where d must be a non-zero integer because all of $h,k,l,i_3,j_3$ and $m_3$ are integers. It will now be shown that $d = 1$.\\ -Defining the volume of the conventional unit cell to be V spanned by the conventional basis $\vec{a}_1, \vec{a}_2$ and $\vec{a}_3$. -\begin{eqnarray} - V = (\vec{a}_1 \times \vec{a}_2) \cdot \vec{a}_3 -\end{eqnarray} -and rewriting of the three reciprocal vectors to the following form -\begin{eqnarray} -V\vec{b}_1 = \vec{a}_2 \times \vec{a}_3, \ V\vec{b}_2 = \vec{a}_3 \times \vec{a}_1, \ V\vec{b}_3 = \vec{a}_1 \times \vec{a}_2. -\end{eqnarray} -will ease the calculations, and with all the pieces set, a determination of the value of $d$ is possible. The volume of the cell spanned by ($\vec{v}_1,\vec{v}_2,\vec{v}_3$) is presented below, where the constants ($i$,$j$,$m$)$_{1,2}$ refer to the constants defined by the formalism used for $\vec{v}_1$, equation \ref{v1formalism}, and for $\vec{v}_2$, equation \ref{v2formalism}. -\begin{eqnarray} -V = & \vec{v}_3 \cdot (\vec{v}_1 \times \vec{v}_2) = \vec{v}_3 \cdot \left\lbrace ( i_1\vec{a}_1+j_1\vec{a}_2+m_1\vec{a}_3) \times ( i_2\vec{a}_1+j_2\vec{a}_2+m_2\vec{a}_3) \right\rbrace \nonumber \\ -= & \vec{v}_3 \cdot \left\lbrace i_1 j_2 \vec{a}_1 \times \vec{a}_2 + i_1 m_2 \vec{a}_1 \times \vec{a}_3 + j_1 i_2 \vec{a}_2 \times \vec{a}_1 + j_1 m_2 \vec{a}_2 \times \vec{a}_3 \right\rbrace \nonumber \\ & + \vec{v}_3 \cdot \left\lbrace m_1 i_2 \vec{a}_3 \times \vec{a}_1 + m_1 j_2 \vec{a}_3 \times \vec{a}_2 \right\rbrace \nonumber \\ -= & V\vec{v}_3 \cdot \left\lbrace i_1 j_2 \vec{b}_3 - i_1 m_2 \vec{b}_2 - j_1 i_2 \vec{b}_3 + j_1 m_2 \vec{b}_1 + m_1 i_2 \vec{b}_2 - m_1 j_2 \vec{b}_1 \right\rbrace \nonumber \\ -= & V \vec{v}_3 \cdot \left\lbrace \left(\begin{array}{c} i_1 \\ j_1 \\ m_1 \end{array}\right) \times \left(\begin{array}{c} i_2 \\ j_2 \\ m_2 \end{array}\right) \right\rbrace \cdot \left(\begin{array}{c} \vec{b}_1 \\ \vec{b}_2 \\ \vec{b}_3 \end{array} \right) -\end{eqnarray} -The cross product between ($i_1, j_1, m_1$) and ($i_2, j_2, m_2$) has been found previously in equation \ref{hkldependency} using the Extended Euclidean Algorithm as ($h,k,l$). Inserting this into the equation -\begin{eqnarray} -V = V \vec{v}_3 \cdot (h\vec{b}_1+k\vec{b}_2+l\vec{b}_3) = Vd. -\end{eqnarray} -$d$ is therefore equal to 1. The knowledge of $d$ in equation \ref{vdotn} leads to a new equation to solve, to determine the third vector $\vec{v}_3$. -\begin{eqnarray} -\vec{n} \cdot \vec{v}_3 & = (h \vec{b}_1 + k \vec{b}_2 + l \vec{b}_3 ) \cdot (i_3\vec{a}_1,j_3\vec{a}_2,m_3\vec{a}_3) \nonumber \\ - & = hi_3+kj_3+lm_3 = 1 \label{eq:ext_gcd} -\end{eqnarray} -This equation can be solved using the Extended Euclidean Algorithm for three variables and therefore the third vector $\vec{v}_3$ is determined. With these three vectors, ($\vec{v}_1, \vec{v}_2, \vec{v}_3$), a basis for the new unit cell is created. The implementation of this will be described in the following section, along with some ways to get around the numerical issues in Python. - -\subsection{Implementation in Python}\label{implementation} -Based on the theory derived above an arbitrary surface can be created using the procedure found on the DTU niflheim cluster. To create a surface using the procedure described in this section a conventional bulk cell of the surface material is needed along with the Miller indices and the depth of the slab. \\ -The implementation in Python using ASE to setup the atoms consists of three parts. First, a new basis is derived from the Miller indices with two of the basis vectors lying in the surface plane. Secondly, the atoms in the conventional bulk cell are expressed in the terms of the new basis in a slab with the selected depth. Finally, the unit cell of the slab is modified so the third cell vector points perpendicular to the surface and all atoms are moved into the unit cell. - -\subsubsection{Surface basis}\begin{small} \end{small} -For any surface type described by a Miller indice $(h,k,l)$ the surface basis $(\vec{v}_1,\vec{v}_2,\vec{v}_3)$ is found relative to the conventional bulk unit cell. $\vec{v}_1$ and $\vec{v}_2$ are chosen to be in the surface plane.\\ -In the special case where only one of the Miller indices is non-zero $\vec{v}_1$ and $\vec{v}_2$ are simply the unit vectors in the directions where the Miller indices are zero, respectively and $\vec{v}_3$ is the direction where the Miller indice is non-zero.\\\\ -For all other situations $\vec{v}_1$ and $\vec{v}_2$ are found by solving the linear equation \ref{EquationFromTheory} using the Extended Euclidean Algorithm - in the script defined as \verb#ext_gcd()#. -This yields an infinite set of solutions all of which can be used. However, the optimal structure is found when the angle between the two base vectors are as close to $90^o$ as possible, as the structure will be as compact as possible and specific sites are easier to identify. This solution is found by minimizing the scalar product of the two base vectors by $c \in \textbf{Z}$. -\begin{eqnarray} -\left|\left(\left(p+cl\right)\left(\begin{array}{c} k\vec{a}_1 \\ -h\vec{a}_2\\0\end{array}\right) -+\left(q-ck\right)\left(\begin{array}{c} l\vec{a}_1 \\ 0\\-h\vec{a}_3\end{array}\right)\right) -\cdot\left(\begin{array}{c} 0 \\ l\vec{a}_2\\-k\vec{a}_3\end{array}\right)\right|_{min(c)} \nonumber -\end{eqnarray} -This can be expressed as $\left| k_1+ck_2 \right|_{min(c)}$ and the solution is found when $c$ is equal to the fraction $-\frac{k_1}{k_2}$ rounded to the nearest integer. Because of numerical errors a tolerance is used. In python this is expressed as follows. -\begin{verbatim} - p,q = ext_gcd(k,l) - k1 = dot( p*(k*a1-h*a2)+q*(l*a1-h*a3) , l*a2-k*a3) - k2 = dot( l*(k*a1-h*a2)-k*(l*a1-h*a3) , l*a2-k*a3) - if abs(k2)>tol: - c = -int(round(k1/k2)) - p,q = p+c*l, q-c*k - v1 = p*array((k,-h,0))+q*array((l,0,-h)) - v2 = reduce(array((0,l,-k))) - a,b = ext_gcd(p*k+q*l,h) - v3 = array((b,a*p,a*q)) -\end{verbatim} -The last four lines define the base vectors for the surface using the Extended Euclidean Algorithm for two variables to find $\vec{v}_1$ and $\vec{v}_2$ and three variables to find $\vec{v}_3$. - -\subsubsection{Atom positions} -When the basis have been found the atoms in the conventional cell are base-changed to the new basis using \begin{verbatim} - for i in range(len(bulk)): - newpos = linalg.solve(basis.T,bulk.get_scaled_positions()[i]) - scaled += [newpos-floor(newpos+tol)] -\end{verbatim} -and then moved so the scaled positions in the new basis are within the box spanned by the basis. The tolerance is needed so atoms positioned exactly on the boundary are treated consistently despite numerical errors. The cell in the new basis is then repeated in the $\vec{v}_3$ direction to create the required slap depth. \\ -For many applications it is useful to have the $z$-direction pointing perpendicular to the surface to enable electrostatic decoupling and to make vacuum height and adsorbate distance well defined. The next step in the procedure is therefore to align the $z$-direction with the cross product of $\vec{v}_1$ and $\vec{v}_2$ with a length so the cell volume is preserved. The final step before the slab is created is then to move the atoms so the scaled coordinates are between 0 and 1 in the $\vec{v}_1$ and $\vec{v}_2$ directions making it obvious how the atoms are located relative to each other when the structure is visualized. - -\end{document} diff --git a/doc/ase/build/structure.py b/doc/ase/build/structure.py deleted file mode 100644 index e7a2e630e6..0000000000 --- a/doc/ase/build/structure.py +++ /dev/null @@ -1,26 +0,0 @@ -# creates: a1.png, a2.png, a3.png, cnt1.png, cnt2.png, gnr1.png, gnr2.png -from ase.build import bulk, graphene_nanoribbon, nanotube -from ase.io import write - -for i, a in enumerate( - [bulk('Cu', 'fcc', a=3.6), - bulk('Cu', 'fcc', a=3.6, orthorhombic=True), - bulk('Cu', 'fcc', a=3.6, cubic=True)]): - write('a%d.pov' % (i + 1), a).render() - -cnt1 = nanotube(6, 0, length=4, vacuum=2.5) -cnt1.rotate('x', 'z', rotate_cell=True) -cnt2 = nanotube(3, 3, length=6, bond=1.4, symbol='Si', vacuum=2.5) -cnt2.rotate('x', 'z', rotate_cell=True) - -for i, a in enumerate([cnt1, cnt2]): - write('cnt%d.pov' % (i + 1), a).render() - -gnr1 = graphene_nanoribbon(3, 4, type='armchair', saturated=True, vacuum=2.5) -gnr2 = graphene_nanoribbon(2, 6, type='zigzag', saturated=True, - C_H=1.1, C_C=1.4, vacuum=3.0, - magnetic=True, initial_mag=1.12) - -for i, a in enumerate([gnr1, gnr2]): - write('gnr%d.pov' % (i + 1), a, - rotation='90x').render() diff --git a/doc/ase/build/surface.py b/doc/ase/build/surface.py deleted file mode 100644 index 31de5ace11..0000000000 --- a/doc/ase/build/surface.py +++ /dev/null @@ -1,67 +0,0 @@ -# creates: fcc100.png, fcc110.png, bcc100.png, fcc111.png, bcc110.png -# creates: bcc111.png, hcp0001.png, fcc111o.png, fcc211o.png, bcc110o.png -# creates: bcc111o.png, hcp0001o.png, ontop-site.png, hollow-site.png -# creates: fcc-site.png, hcp-site.png, bridge-site.png, diamond100.png -# creates: diamond111.png, hcp10m10.png, mx2.png, fcc111_root.png -# creates: graphene.png - -import ase.build as surface -from ase import Atoms -from ase.build import fcc111, root_surface -from ase.io import write - -surfaces = ['fcc100', 'fcc110', 'bcc100', 'hcp10m10', 'diamond100', - 'fcc111', 'bcc110', 'bcc111', 'hcp0001', 'diamond111', 'fcc211', - 'mx2', 'graphene'] - -symbols = { - 'fcc': 'Cu', - 'bcc': 'Fe', - 'hcp': 'Ru', - 'dia': 'C', - 'mx2': 'MoS2', - 'gra': 'C2'} -radii = { - 'fcc': 1.1, - 'bcc': 1.06, - 'hcp': 1.08, - 'dia': 0.5, - 'mx2': 1.0, - 'gra': 1.0} -adsorbates = {'ontop': 'H', 'hollow': 'O', 'fcc': 'N', 'hcp': 'C', - 'bridge': 'F'} - - -def save(name, slab): - print('save %s' % name) - write(name + '.png', slab, radii=radii[name[:3]], - scale=10) - - -for name in surfaces: - f = getattr(surface, name) - for kwargs in [{}, {'orthogonal': False}, {'orthogonal': True}]: - print(name, kwargs) - try: - slab = f(symbols[name[:3]], size=(3, 4, 5), vacuum=4, **kwargs) - except (TypeError, NotImplementedError): - continue - try: - for site in slab.info['adsorbate_info']['sites']: - if site.endswith('bridge'): - h = 1.5 - else: - h = 1.2 - surface.add_adsorbate(slab, adsorbates.get(site, 'F'), h, site) - except KeyError: - pass - if kwargs.get('orthogonal', None): - name += 'o' - save(name, slab) - -for site, symbol in adsorbates.items(): - write('%s-site.png' % site, Atoms(symbol), radii=1.08, scale=10) - -fcc111_primitive = fcc111('Ag', (1, 1, 3)) -fcc111_root = root_surface(fcc111_primitive, 27) -save('fcc111_root', fcc111_root) diff --git a/doc/ase/build/surface.rst b/doc/ase/build/surface.rst deleted file mode 100644 index 1a7f5c33ce..0000000000 --- a/doc/ase/build/surface.rst +++ /dev/null @@ -1,281 +0,0 @@ -======== -Surfaces -======== - -.. currentmodule:: ase.build - -.. _surfaces: - -Common surfaces -=============== - -A number of utility functions are provided to set up -the most common surfaces, to add vacuum layers, and to add adsorbates -to a surface. In general, all surfaces can be set up with -the modules described in the section :ref:`general-crystal-section`, but these -utility functions make common tasks easier. - - -Example -------- - -To setup an Al(111) surface with a hydrogen atom adsorbed in an on-top -position:: - - from ase.build import fcc111 - slab = fcc111('Al', size=(2,2,3), vacuum=10.0) - -This will produce a slab 2x2x3 times the minimal possible size, with a -(111) surface in the z direction. A 10 Å vacuum layer is added on -each side. - -To set up the same surface with with a hydrogen atom adsorbed in an on-top -position 1.5 Å above the top layer:: - - from ase.build import fcc111, add_adsorbate - slab = fcc111('Al', size=(2,2,3)) - add_adsorbate(slab, 'H', 1.5, 'ontop') - slab.center(vacuum=10.0, axis=2) - -Note that in this case it is probably not meaningful to use the vacuum -keyword to fcc111, as we want to leave 10 Å of vacuum *after* the -adsorbate has been added. Instead, the :meth:`~ase.Atoms.center` method -of the :class:`~ase.Atoms` is used -to add the vacuum and center the system. - -The atoms in the slab will have tags set to the layer number: First layer -atoms will have tag=1, second layer atoms will have tag=2, and so on. -Adsorbates get tag=0: - ->>> print(atoms.get_tags()) -[3 3 3 3 2 2 2 2 1 1 1 1 0] - -This can be useful for setting up :mod:`ase.constraints` (see -:ref:`diffusion tutorial`). - - -Utility functions for setting up surfaces ------------------------------------------ - -All the functions setting up surfaces take the same arguments. - -*symbol*: - The chemical symbol of the element to use. - -*size*: - A tuple giving the system size in units of the minimal unit cell. - -*a*: - (optional) The lattice constant. If specified, it overrides the - expermental lattice constant of the element. Must be specified if - setting up a crystal structure different from the one found in - nature. - -*c*: - (optional) Extra HCP lattice constant. If specified, it overrides the - expermental lattice constant of the element. Can be specified if - setting up a crystal structure different from the one found in - nature and an ideal `c/a` ratio is not wanted (`c/a=(8/3)^{1/2}`). - -*vacuum*: - The thickness of the vacuum layer. The specified amount of - vacuum appears on both sides of the slab. Default value is None, - meaning not to add any vacuum. In that case the third axis perpendicular to - the surface will be undefined (``[0, 0, 0]``) or left at its intrinsic - bulk value if requested (see *periodic*). Some calculators can work - with undefined axes as long as the :attr:`~ase.Atoms.pbc` flag is set to - ``False`` along that direction. - -*orthogonal*: - (optional, not supported by all functions). If specified and true, - forces the creation of a unit cell with orthogonal basis vectors. - If the default is such a unit cell, this argument is not supported. - -*periodic*: - (optional) Produce a bulk system. Defaults to False. If true, sets - boundary conditions and cell constantly with the corresponding bulk - structure. Useful for stacking multiple different surfaces. The - system will be fully equivalent to the bulk material only if the - number of layers is consistent with the crystal stacking. - -Each function defines a number of standard adsorption sites that can -later be used when adding an adsorbate with -:func:`ase.build.add_adsorbate`. - - -The following functions are provided -```````````````````````````````````` - -.. autofunction:: fcc100 -.. autofunction:: fcc110 -.. autofunction:: bcc100 -.. autofunction:: hcp10m10 -.. autofunction:: diamond100 - -These always give orthorhombic cells: - -========== ============ -fcc100 |fcc100| -fcc110 |fcc110| -bcc100 |bcc100| -hcp10m10 |hcp10m10| -diamond100 |diamond100| -========== ============ - - -.. autofunction:: fcc111 -.. autofunction:: fcc211 -.. autofunction:: bcc110 -.. autofunction:: bcc111 -.. autofunction:: hcp0001 -.. autofunction:: diamond111 - -These can give both non-orthorhombic and orthorhombic cells: - -=========== =============== =============== -fcc111 |fcc111| |fcc111o| -fcc211 not implemented |fcc211o| -bcc110 |bcc110| |bcc110o| -bcc111 |bcc111| |bcc111o| -hcp0001 |hcp0001| |hcp0001o| -diamond111 |diamond111| not implemented -=========== =============== =============== - -The adsorption sites are marked with: - -======= ======== ===== ===== ======== =========== ========== -ontop hollow fcc hcp bridge shortbridge longbridge -|ontop| |hollow| |fcc| |hcp| |bridge| |bridge| |bridge| -======= ======== ===== ===== ======== =========== ========== - -.. |ontop| image:: ontop-site.png -.. |hollow| image:: hollow-site.png -.. |fcc| image:: fcc-site.png -.. |hcp| image:: hcp-site.png -.. |bridge| image:: bridge-site.png -.. |fcc100| image:: fcc100.png -.. |fcc110| image:: fcc110.png -.. |bcc100| image:: bcc100.png -.. |fcc111| image:: fcc111.png -.. |bcc110| image:: bcc110.png -.. |bcc111| image:: bcc111.png -.. |hcp0001| image:: hcp0001.png -.. |fcc111o| image:: fcc111o.png -.. |fcc211o| image:: fcc211o.png -.. |bcc110o| image:: bcc110o.png -.. |bcc111o| image:: bcc111o.png -.. |hcp0001o| image:: hcp0001o.png -.. |hcp10m10| image:: hcp10m10.png -.. |diamond100| image:: diamond100.png -.. |diamond111| image:: diamond111.png - -.. autofunction:: mx2 - -.. image:: mx2.png - -.. autofunction:: graphene - -.. image:: graphene.png - -Create root cuts of surfaces -```````````````````````````` - -To create some more complicated cuts of a standard surface, a root cell -generator has been created. While it can be used for arbitrary cells, -some more common functions have been provided. - -.. autofunction:: fcc111_root - -.. autofunction:: hcp0001_root - -.. autofunction:: bcc111_root - -If you need to make a root cell for a different cell type, you can simply -supply a primitive cell of the correct height. This primitive cell can be -any 2D surface whose normal points along the Z axis. The cell's contents -can also vary, such as in the creation of an alloy or deformation. - -.. autofunction:: ase.build.root_surface - -The difficulty with using these functions is the requirement to know the -valid roots in advance, but a function has also been supplied to help with -this. It is helpful to note that any primitive cell with the same cell -shape, such as the case with the fcc111 and bcc111 functions, will have the -same valid roots. - -.. autofunction:: ase.build.root_surface_analysis - -An example of using your own primitive cell:: - - from ase.build import fcc111, root_surface - atoms = fcc111('Ag', (1, 1, 3)) - atoms = root_surface(atoms, 27) - -.. image:: fcc111_root.png - - -Adding adsorbates ------------------ - -After a slab has been created, a vacuum layer can be added. It is -also possible to add one or more adsorbates. - -.. autofunction:: ase.build.add_adsorbate -.. autofunction:: ase.build.add_vacuum - - -.. _general-surface-section: - -Create specific non-common surfaces -=================================== - -In addition to the most normal surfaces, a function has been -constructed to create more uncommon surfaces that one could be -interested in. It is constructed upon the Miller Indices defining the -surface and can be used for both fcc, bcc and hcp structures. The -theory behind the implementation can be found here: -:download:`general_surface.pdf`. - -.. autofunction:: ase.build.surface - - -Example -------- - -To setup a Au(211) surface with 9 layers and 10 Å of vacuum: - -.. literalinclude:: general_surface.py - :start-after: Au example - :end-before: Mo example - -This is the easy way, where you use the experimental lattice constant -for gold bulk structure. You can write:: - - from ase.visualize import view - view(s1) - -or simply ``s1.edit()`` if you want to see and rotate the structure. - -.. image:: s1.png - -Next example is a molybdenum bcc(321) surface where we decide what -lattice constant to use: - -.. literalinclude:: general_surface.py - :start-after: Mo example - :end-before: Pt3Rh example - -.. image:: s2.png - -As the last example, creation of alloy surfaces is also very easily -carried out with this module. In this example, two :mol:`Pt_3Rh` -fcc(211) surfaces will be created: - -.. literalinclude:: general_surface.py - :start-after: Pt3Rh example - :end-before: Done - -|s3| |s4| - -.. |s3| image:: s3.png -.. |s4| image:: s4.png diff --git a/doc/ase/build/tools.rst b/doc/ase/build/tools.rst deleted file mode 100644 index df192b3fa1..0000000000 --- a/doc/ase/build/tools.rst +++ /dev/null @@ -1,14 +0,0 @@ -========================= -Tools for building things -========================= - -.. autofunction:: ase.build.cut -.. autofunction:: ase.build.stack -.. autofunction:: ase.build.sort -.. autofunction:: ase.build.rotate -.. autofunction:: ase.build.niggli_reduce -.. autofunction:: ase.build.minimize_tilt -.. autofunction:: ase.build.minimize_rotation_and_translation -.. autofunction:: ase.build.find_optimal_cell_shape -.. autofunction:: ase.build.get_deviation_from_optimal_cell_shape -.. autofunction:: ase.build.make_supercell diff --git a/doc/ase/calculators/FHI-aims.rst b/doc/ase/calculators/FHI-aims.rst deleted file mode 100644 index 07cbe0923c..0000000000 --- a/doc/ase/calculators/FHI-aims.rst +++ /dev/null @@ -1,114 +0,0 @@ -.. module:: ase.calculators.aims - -======== -FHI-aims -======== - -Introduction -============ - -FHI-aims_ is a all-electron full-potential density functional theory -code using a numeric local orbital basis set. - -.. _FHI-aims: https://aimsclub.fhi-berlin.mpg.de - -Running the Calculator -====================== - -The default initialization command for the FHI-aims calculator is - -.. autoclass:: Aims - -In order to run a calculation, you have to ensure that at least the -following ``str`` variables are specified, either in the initialization -or as shell environment variables: - -=============== ==================================================== -keyword description -=============== ==================================================== -``run_command`` The full command required to run FHI-aims from - a shell, including anything to do with an MPI - wrapper script and the number of tasks, e.g.: - ``mpiexec aims.081213.scalapack.mpi.x > aims.out``. - An alternative way to set this command is via the - ``ASE_AIMS_COMMAND`` environment variable. -``species_dir`` Directory where the species are located, e.g.: - ``/opt/fhi-aims-081213/species_defaults/light``. - Can also be specified with the ``AIMS_SPECIES_DIR`` - environment variable. -``xc`` which exchange-correlation functional is used. -=============== ==================================================== - - -List of keywords -================ - -This is a non-exclusive list of keywords for the ``control.in`` file -that can be addresses from within ASE. The meaning for these keywords is -exactly the same as in FHI-aims, please refer to its manual for help on -their use. - -One thing that should be mentioned is that keywords with more than -one option have been implemented as tuples/lists, eg. -``k_grid=(12,12,12)`` or ``relativistic=('atomic_zora','scalar')``. -In those cases, specifying a single string containing all the options is also possible. - -None of the keywords have any default within ASE, but do check the defaults -set by FHI-aims. - -Example keywords describing the computational method used: - -============================ ====== -keyword type -============================ ====== -``xc`` str -``charge`` float -``spin`` str -``relativistic`` list -``use_dipole_correction`` bool -``vdw_correction_hirshfeld`` str -``k_grid`` list -============================ ====== - -.. note:: - - Any argument can be changed after the initial construction of the - calculator, simply by setting it with the method - - >>> calc.set(keyword=value) - - -Volumetric Data Output -====================== - -The class - -.. autoclass:: AimsCube - -describes an object that takes care of the volumetric -output requests within FHI-aims. An object of this type can -be attached to the main Aims() object as an option. - -The possible arguments for AimsCube are: - -============================ ======== -keyword type -============================ ======== -``origin`` list -``edges`` 3x3-array -``points`` list -``plots`` list -============================ ======== - -The possible values for the entry of plots -are discussed in detail in the FHI-aims manual, -see below for an example. - -Example -======= - -Here is an example of how to obtain the geometry of a water molecule, -assuming ``ASE_AIMS_COMMAND`` and ``AIMS_SPECIES_DIR`` are set: -:git:`ase/test/calculator/aims/test_H2O_aims.py`. - -.. literalinclude:: ../../../ase/test/calculator/aims/test_H2O_aims.py diff --git a/doc/ase/calculators/INCAR_NaCl b/doc/ase/calculators/INCAR_NaCl deleted file mode 100644 index 71efbfc51f..0000000000 --- a/doc/ase/calculators/INCAR_NaCl +++ /dev/null @@ -1,5 +0,0 @@ -INCAR created by Atomic Simulation Environment - PREC = Accurate - LREAL = .FALSE. - ISPIN = 2 - MAGMOM = 1*1.9280 1*0.7500 diff --git a/doc/ase/calculators/NaCl.py b/doc/ase/calculators/NaCl.py deleted file mode 100644 index 0470eab54b..0000000000 --- a/doc/ase/calculators/NaCl.py +++ /dev/null @@ -1,15 +0,0 @@ -from ase import Atom, Atoms -from ase.calculators.vasp import Vasp - -a = [6.5, 6.5, 7.7] -d = 2.3608 -NaCl = Atoms([Atom('Na', [0, 0, 0], magmom=1.928), - Atom('Cl', [0, 0, d], magmom=0.75)], - cell=a) - -calc = Vasp(prec='Accurate', - xc='PBE', - lreal=False) -NaCl.calc = calc - -print(NaCl.get_magnetic_moment()) diff --git a/doc/ase/calculators/abinit.rst b/doc/ase/calculators/abinit.rst deleted file mode 100644 index 731aa08471..0000000000 --- a/doc/ase/calculators/abinit.rst +++ /dev/null @@ -1,87 +0,0 @@ -.. module:: ase.calculators.abinit - -====== -ABINIT -====== - -Introduction -============ - -ABINIT_ is a density-functional theory code based on pseudopotentials -and a planewave basis. - - -.. _ABINIT: https://www.abinit.org - - - -Environment variables -===================== - -.. highlight:: bash - -.. envvar:: ASE_ABINIT_COMMAND - - Must be set to something like this:: - - abinit < PREFIX.files > PREFIX.log - - where ``abinit`` is the executable (``abinis`` for version prior to 6). - -.. envvar:: ABINIT_PP_PATH - - A directory containing the pseudopotential files (at least of - :file:`.fhi` type). - -Abinit does not provide tarballs of pseudopotentials so the easiest way is to -download and unpack -https://wiki.fysik.dtu.dk/abinit-files/abinit-pseudopotentials-2.tar.gz - -Set the environment variables in your in your shell configuration file:: - - export ASE_ABINIT_COMMAND="abinit < PREFIX.files > PREFIX.log" - PP=${HOME}/abinit-pseudopotentials-2 - export ABINIT_PP_PATH=$PP/LDA_FHI - export ABINIT_PP_PATH=$PP/GGA_FHI:$ABINIT_PP_PATH - export ABINIT_PP_PATH=$PP/LDA_HGH:$ABINIT_PP_PATH - export ABINIT_PP_PATH=$PP/LDA_PAW:$ABINIT_PP_PATH - export ABINIT_PP_PATH=$PP/LDA_TM:$ABINIT_PP_PATH - export ABINIT_PP_PATH=$PP/GGA_FHI:$ABINIT_PP_PATH - export ABINIT_PP_PATH=$PP/GGA_HGHK:$ABINIT_PP_PATH - export ABINIT_PP_PATH=$PP/GGA_PAW:$ABINIT_PP_PATH - - -ABINIT Calculator -================= - -Abinit does not specify a default value for the plane-wave cutoff -energy. You need to set them as in the example at the bottom of the -page, otherwise calculations will fail. Calculations wihout k-points -are not parallelized by default and will fail! To enable band -paralellization specify ``Number of BanDs in a BLOCK`` (``nbdblock``). - -In Abinit version 7 and above, the ``autoparal=1`` argument sets the best -parallelization options, but the command line for execution should include the -``mpirun`` command, e.g.:: - - ASE_ABINIT_COMMAND="mpirun -np 4 abinit < PREFIX.files > PREFIX.log" - - -Pseudopotentials -================ - -Pseudopotentials in the ABINIT format are available on the -`pseudopotentials`_ website. A database of user contributed -pseudopotentials is also available there. - -.. _pseudopotentials: http://www.abinit.org/downloads/atomic-data-files - -The best potentials are gathered into the so called JTH archive, in the -PAW/XML format, specified by GPAW. You should then add the correct path to -ABINIT_PP_PATH:: - - ABINIT_PP_PATH=$PP/GGA_PBE:$ABINIT_PP_PATH - ABINIT_PP_PATH=$PP/LDA_PW:$ABINIT_PP_PATH - -At execution, you can select the potential database to use with the ``pps`` -argument, as one of 'fhi', 'hgh', 'hgh.sc', 'hgh.k', 'tm', 'paw', 'pawxml'. diff --git a/doc/ase/calculators/ace.rst b/doc/ase/calculators/ace.rst deleted file mode 100644 index 77d4a78c63..0000000000 --- a/doc/ase/calculators/ace.rst +++ /dev/null @@ -1,101 +0,0 @@ -.. module:: ase.calculators.acemolecule - -============ -ACE-Molecule -============ - -`ACE-Molecule `_ ACE-Molecule, whitch -stands for Advanced Computational Engine for Molecule, is a quantum chemistry package based on a -real-space numerical grid. The package aims to carry out accurate and fast electronic structure -calculations for large molecular systems. The present main features include ground-state DFT -calculations using LDA, GGA, and hybrid functionals with an exact-exchange potential under the KLI -approximation, atomic force calculations, and excited state calculations using -linear-response TD-DFT, CIS, and CISD methods. - -The ASE calculator is an interface to the ``ace`` executable. - -Setup -===== - -A simple calculation can be set up:: - - import sys - from ase.io import read - from ase.calculators.acemolecule import ACE - - label = sys.argv[1] - mol= read('H2.xyz') - basic_list = {'Cell' : 12.0} - ace = ACE(label=label, BasicInformation = basic_list) - mol.calc = ace - print (mol.get_potential_energy()) - -A Force calculation can be set up:: - - import sys - from ase.io import read - from ase.calculators.acemolecule import ACE - - basic_list = {'Cell' : 12.0 ,'Pseudopotential' : {'Pseudopotential' : 1, 'Format' : 'upf', 'PSFilePath' : '/PATH/TO/UPF/FILES', 'PSFileSuffix' : '.pbe-theos.UPF'} } - label = sys.argv[1] - mol= read('H2.xyz') - order_list = ["BasicInformation", "Guess", "Scf", "Force"] - ace = ACE(label=label, BasicInformation = basic_list, order = order_list) - mol.calc = ace - print (mol.get_forces()) - - -A Geometry optimization calculation can be set up:: - - import sys - from ase.io import read - from ase.calculators.acemolecule import ACE - from ase.optimize import BFGS - - basic_list = {'Cell' : 12.0, 'Pseudopotential' : {'Pseudopotential' : 1, 'Format' : 'upf', 'PSFilePath' : '/PATH/TO/UPF/FILES', 'PSFileSuffix' : '.pbe-theos.UPF'} } - label = sys.argv[1] - mol= read('H2.xyz') - order_list = ["BasicInformation", "Guess", "Scf", "Force"] - ace = ACE(label=label, BasicInformation = basic_list, order = order_list) - mol.calc = ace - g_opt = BFGS(mol) - g_opt.run(fmax=0.05) - print ("OPT is end") - -A TDDFT calculation can be set up:: - - import sys - from ase.io import read - from ase.calculators.acemolecule import ACE - from ase.optimize import BFGS - - label = sys.argv[1] - mol= read('H2.xyz') - basic_list = {'Cell' : 12.0} - order_list = ["BasicInformation", "Guess", "Scf", "TDDFT"] - scf_list = [dict(FinalDiagonalize = dict(NumberOfEigenvalues= 12))] - ace = ACE(label=label, BasicInformation = basic_list, Scf= scf_list, order = order_list) - mol.calc = ace - print (ace.get_property('excitation-energy', mol)) - - -Parameters -========== - -The calculator will interpret any of the documented options for ``ace``: -https://gitlab.com/aceteam.kaist/ACE-Molecule/tree/master/vars - -By default, this calculator sets simple SCF calculations (Including BasicInformation, Guess, and Scf section). -If you want to do force or excited state calculations, or change exchange-correlation functionals, you need to change input parameters. -Parameters can be given as keywords and the calculator will put them into the corresponding section of the input file. -Each (sub)section is represented as dictionary. - -An example for updating parameters:: - - basic = dict(Cell = 12.0, VerboseLevel = 2) - ace.set(BasicInformation = basic) - -An example for updating subsection parameters:: - - ace.set(Scf = {"ExchangeCorrelation": {"XFunctional": "LDA_X", "CFunctional": "LDA_C_PZ"}}) - diff --git a/doc/ase/calculators/amber.rst b/doc/ase/calculators/amber.rst deleted file mode 100644 index c9969fca7a..0000000000 --- a/doc/ase/calculators/amber.rst +++ /dev/null @@ -1,63 +0,0 @@ -.. module:: ase.calculators.amber - -Amber -===== - -Introduction ------------- - -Amber_ is a powerful classical simulations package. It is not free, academic -license costs $500. Ase-Amber has been tested only for amber16 (2016). It can -bee useful as MM part of QM/MM calculations since amber supports fast netCDF -fileIO. - -.. _Amber: http://ambermd.org - - -Water example -------------- - -Generate topology file:: - - $ tleap -f tleap.in - -where the ``tleap.in`` file contains:: - - source leaprc.protein.ff14SB - source leaprc.gaff - source leaprc.water.tip3p - mol = loadpdb 2h2o.pdb - saveamberparm mol 2h2o.top h2o.inpcrd - quit - -You need a file ``mm.in`` with instructions for the simulation:: - - zero step md to get energy and force - &cntrl - imin=0, nstlim=0, ntx=1 !0 step md - cut=100, ntb=0, !non-periodic - ntpr=1,ntwf=1,ntwe=1,ntwx=1 ! (output frequencies) - &end - END - -Here is your example Python script:: - - from ase import Atoms - from ase.calculators.amber import Amber - - atoms = Atoms('OH2OH2', - [[-0.956, -0.121, 0], - [-1.308, 0.770, 0], - [0.000, 0.000, 0], - [3.903, 0.000, 0], - [4.215, -0.497, -0.759], - [4.215, -0.497, 0.759]]) - - calc = Amber(amber_exe='sander -O ', - infile='mm.in', - outfile='mm.out', - topologyfile='2h2o.top', - incoordfile='mm.crd') - calc.write_coordinates(atoms, 'mm.crd') - atoms.calc = calc - f = atoms.get_forces() diff --git a/doc/ase/calculators/ase_castep_demo.py b/doc/ase/calculators/ase_castep_demo.py deleted file mode 100644 index 5c8c81258c..0000000000 --- a/doc/ase/calculators/ase_castep_demo.py +++ /dev/null @@ -1,71 +0,0 @@ -"""This simple demo calculates the total energy of CO molecules -using once LDA and once PBE as xc-functional. Obviously -some parts in this scripts are longer than necessary, but are shown -to demonstrate some more features.""" - -import ase -import ase.calculators.castep -import ase.io.castep - -calc = ase.calculators.castep.Castep() -directory = 'CASTEP_ASE_DEMO' - -# include interface settings in .param file -calc._export_settings = True - -# reuse the same directory -calc._directory = directory -calc._rename_existing_dir = False -calc._label = 'CO_LDA' - -# necessary for tasks with changing positions -# such as GeometryOptimization or MolecularDynamics -calc._set_atoms = True - -# Param settings -calc.param.xc_functional = 'LDA' -calc.param.cut_off_energy = 400 -# Prevent CASTEP from writing *wvfn* files -calc.param.num_dump_cycles = 0 - -# Cell settings -calc.cell.kpoint_mp_grid = '1 1 1' -calc.cell.fix_com = False -calc.cell.fix_all_cell = True - -# Set and clear and reset settings (just for shows) -calc.param.task = 'SinglePoint' -# Reset to CASTEP default -calc.param.task.clear() - -# all of the following are identical -calc.param.task = 'GeometryOptimization' -calc.task = 'GeometryOptimization' -calc.TASK = 'GeometryOptimization' -calc.Task = 'GeometryOptimization' - - -# Prepare atoms -mol = ase.atoms.Atoms('CO', [[0, 0, 0], [0, 0, 1.2]], cell=[10, 10, 10]) -mol.calc = calc - -# Check for correct input -if calc.dryrun_ok(): - print(f'{mol.calc._label} : {mol.get_potential_energy()} ') -else: - print("Found error in input") - print(calc._error) - - -# Read all settings from previous calculation -mol = ase.io.castep.read_seed('%s/CO_LDA' % directory) - -# Use the OTF pseudo-potential we have just generated -mol.calc.set_pspot('OTF') - -# Change some settings -mol.calc.param.xc_functional = 'PBE' -# don't forget to set an appropriate label -mol.calc._label = 'CO_PBE' -# Recalculate the potential energy -print(f'{mol.calc._label} : {mol.get_potential_energy()} ') diff --git a/doc/ase/calculators/calculators.rst b/doc/ase/calculators/calculators.rst deleted file mode 100644 index 7fe28a9101..0000000000 --- a/doc/ase/calculators/calculators.rst +++ /dev/null @@ -1,263 +0,0 @@ -.. module:: ase.calculators - :synopsis: Energy, force and stress calculators. - -.. _calculators: - -=========== -Calculators -=========== - -For ASE, a calculator is a black box that can take atomic numbers and -atomic positions from an :class:`~ase.Atoms` object and calculate the -energy and forces and sometimes also stresses. - -In order to calculate forces and energies, you need to attach a -calculator object to your atoms object: - ->>> atoms = read('molecule.xyz') ->>> e = atoms.get_potential_energy() # doctest: IGNORE_EXCEPTION_DETAIL -Traceback (most recent call last): - File "", line 1, in - File "/home/jjmo/ase/atoms/ase.py", line 399, in get_potential_energy - raise RuntimeError('Atoms object has no calculator.') -RuntimeError: Atoms object has no calculator. ->>> from ase.calculators.abinit import Abinit ->>> calc = Abinit(...) ->>> atoms.calc = calc ->>> e = atoms.get_potential_energy() ->>> print(e) --42.0 - -Here we attached -an instance of the :mod:`ase.calculators.abinit` class and then -we asked for the energy. - - -.. _supported calculators: - -Supported calculators -===================== - -The calculators can be divided in four groups: - -1) Abacus_, ALIGNN_, AMS_, Asap_, BigDFT_, CHGNet_, DeePMD-kit_, DFTD3_, DFTD4_, DFTK_, FLEUR_, GPAW_, Hotbit_, M3GNet_, MACE_, TBLite_, and XTB_ - have their own native or external ASE interfaces. - -2) ABINIT, AMBER, CP2K, CASTEP, deMon2k, DFTB+, ELK, EXCITING, FHI-aims, GAUSSIAN, - Gromacs, LAMMPS, MOPAC, NWChem, Octopus, ONETEP, PLUMED, psi4, Q-Chem, Quantum ESPRESSO, SIESTA, - TURBOMOLE and VASP, have Python wrappers in the ASE package, but the actual - FORTRAN/C/C++ codes are not part of ASE. - -3) Pure python implementations included in the ASE package: EMT, EAM, - Lennard-Jones, Morse and HarmonicCalculator. - -4) Calculators that wrap others, included in the ASE package: - :class:`ase.calculators.checkpoint.CheckpointCalculator`, - the :class:`ase.calculators.loggingcalc.LoggingCalculator`, - the :class:`ase.calculators.mixing.LinearCombinationCalculator`, - the :class:`ase.calculators.mixing.MixedCalculator`, - the :class:`ase.calculators.mixing.SumCalculator`, - the :class:`ase.calculators.mixing.AverageCalculator`, - the :class:`ase.calculators.socketio.SocketIOCalculator`, - the :ref:`Grimme-D3 ` potential, and the qmmm calculators - :class:`~ase.calculators.qmmm.EIQMMM`, and :class:`~ase.calculators.qmmm.SimpleQMMM`. - -========================================= =========================================== -name description -========================================= =========================================== -Abacus_ DFT supporting both pw and lcao basis -ALIGNN_ Atomistic Line Graph Neural Network force field -AMS_ Amsterdam Modeling Suite -Asap_ Highly efficient EMT code -BigDFT_ Wavelet based code for DFT -CHGNet_ Universal neural network potential for charge-informed atomistics -DeePMD-kit_ A deep learning package for many-body potential energy representation -DFTD3_ London-dispersion correction -DFTD4_ Charge-dependent London-dispersion correction -DFTK_ Plane-wave code for DFT and related models -FLEUR_ Full Potential LAPW code -GPAW_ Real-space/plane-wave/LCAO PAW code -Hotbit_ DFT based tight binding -M3GNet_ Materials 3-body Graph Network universal potential -MACE_ Many-body potential using higher-order equivariant message passing -TBLite_ Light-weight tight-binding framework -XTB_ Semiemprical extended tight-binding program package -:mod:`~ase.calculators.abinit` Plane-wave pseudopotential code -:mod:`~ase.calculators.amber` Classical molecular dynamics code -:mod:`~ase.calculators.castep` Plane-wave pseudopotential code -:mod:`~ase.calculators.cp2k` DFT and classical potentials -:mod:`~ase.calculators.demon` Gaussian based DFT code -:mod:`~ase.calculators.demonnano` DFT based tight binding code -:mod:`~ase.calculators.dftb` DFT based tight binding -:mod:`~ase.calculators.dmol` Atomic orbital DFT code -:mod:`~ase.calculators.eam` Embedded Atom Method -elk Full Potential LAPW code -:mod:`~ase.calculators.espresso` Plane-wave pseudopotential code -:mod:`~ase.calculators.exciting` Full Potential LAPW code -:mod:`~ase.calculators.aims` Numeric atomic orbital, full potential code -:mod:`~ase.calculators.gamess_us` Gaussian based electronic structure code -:mod:`~ase.calculators.gaussian` Gaussian based electronic structure code -:mod:`~ase.calculators.gromacs` Classical molecular dynamics code -:mod:`~ase.calculators.gulp` Interatomic potential code -:mod:`~ase.calculators.harmonic` Hessian based harmonic force-field code -:mod:`~ase.calculators.kim` Classical MD with standardized models -:mod:`~ase.calculators.lammps` Classical molecular dynamics code -:mod:`~ase.calculators.mixing` Combination of multiple calculators -:mod:`~ase.calculators.mopac` Semiempirical molecular orbital code -:mod:`~ase.calculators.nwchem` Gaussian based electronic structure code -:mod:`~ase.calculators.octopus` Real-space pseudopotential code -:mod:`~ase.calculators.onetep` Linear-scaling pseudopotential code -:mod:`~ase.calculators.openmx` LCAO pseudopotential code -:mod:`~ase.calculators.orca` Gaussian based electronic structure code -:mod:`~ase.calculators.plumed` Enhanced sampling method library -:mod:`~ase.calculators.psi4` Gaussian based electronic structure code -:mod:`~ase.calculators.qchem` Gaussian based electronic structure code -:mod:`~ase.calculators.siesta` LCAO pseudopotential code -:mod:`~ase.calculators.turbomole` Fast atom orbital code -:mod:`~ase.calculators.vasp` Plane-wave PAW code -:mod:`~ase.calculators.emt` Effective Medium Theory calculator -lj Lennard-Jones potential -morse Morse potential -:mod:`~ase.calculators.checkpoint` Checkpoint calculator -:mod:`~ase.calculators.socketio` Socket-based interface to calculators -:mod:`~ase.calculators.loggingcalc` Logging calculator -:mod:`~ase.calculators.dftd3` DFT-D3 dispersion correction calculator -:class:`~ase.calculators.qmmm.EIQMMM` Explicit Interaction QM/MM -:class:`~ase.calculators.qmmm.SimpleQMMM` Subtractive (ONIOM style) QM/MM -========================================= =========================================== - -.. index:: D3, Grimme -.. _grimme: - -.. note:: - - A Fortran implemetation of the Grimme-D3 potential, that can be used as - an add-on to any ASE calculator, can be found here: - https://gitlab.com/ehermes/ased3/tree/master. - -The calculators included in ASE are used like this: - ->>> from ase.calculators.abc import ABC ->>> calc = ABC(...) - -where ``abc`` is the module name and ``ABC`` is the class name. - -.. _Abacus: https://gitlab.com/1041176461/ase-abacus -.. _ALIGNN: https://github.com/usnistgov/alignn?tab=readme-ov-file#alignnff -.. _AMS: https://www.scm.com/doc/plams/examples/AMSCalculator/ASECalculator.html#asecalculatorexample -.. _Asap: https://wiki.fysik.dtu.dk/asap -.. _BigDFT: https://l_sim.gitlab.io/bigdft-suite/tutorials/Interoperability-Simulation.html#ASE-Interoperability -.. _CHGNet: https://github.com/CederGroupHub/chgnet/blob/e2a2b82bf2c64e5a3d39cd75d0addfa864a2771a/chgnet/model/dynamics.py#L63 -.. _GPAW: https://gpaw.readthedocs.io -.. _Hotbit: https://github.com/pekkosk/hotbit -.. _DFTK: https://dftk.org -.. _DeePMD-kit: https://github.com/deepmodeling/deepmd-kit -.. _DFTD4: https://github.com/dftd4/dftd4/tree/main/python -.. _DFTD3: https://dftd3.readthedocs.io/en/latest/api/python.html#module-dftd3.ase -.. _FLEUR: https://github.com/JuDFTteam/ase-fleur -.. _M3GNet: https://matgl.ai/matgl.ext.html#class-matglextasem3gnetcalculatorpotential-potential-state_attr-torchtensor--none--none-stress_weight-float--10-kwargs -.. _MACE: https://mace-docs.readthedocs.io/en/latest/guide/ase.html -.. _TBLite: https://tblite.readthedocs.io/en/latest/users/ase.html -.. _XTB: https://xtb-python.readthedocs.io/en/latest/ase-calculator.html - -Calculator configuration -======================== - -Calculators that depend on external codes or files are generally -configurable. ASE loads the configuration from a configfile located -at ``~/.config/ase/config.ini``. The default path can be overriden by -setting the environment variable ``ASE_CONFIG_PATH`` to another path -or paths separated by colon. - -To see the full configuration on a given machine, run -:command:`ase info --calculators`. - -An example of a config file is as follows:: - - [abinit] - command = mpiexec /usr/bin/abinit - pp_paths = /usr/share/abinit/pseudopotentials - - [espresso] - command = mpiexec pw.x - pseudo_path = /home/ase/upf_pseudos - -Calculators build a full command by appending command-line arguments -to the configured command. Therefore, the command should normally consist -of any parallel arguments followed by the binary, but should not -include further flags unless desired for a specific reason. -The command is also used to build a full command for e.g. -socket I/O calculators. - -The Espresso calculator can then invoked in the following way:: - - >>> from ase.build import bulk - >>> from ase.calculators.espresso import Espresso - >>> espresso = Espresso( - input_data = { - 'system': { - 'ecutwfc': 60, - }}, - pseudopotentials = {'Si': 'si_lda_v1.uspp.F.UPF'}, - ) - >>> si = bulk('Si') - >>> si.calc = espresso - >>> si.get_potential_energy() - -244.76638508140397 - -It can be useful for software libraries to override the local -configuration. To do so, the code should supply the configurable -information by instantiating a “profile”, e.g., -``Abinit(profile=AbinitProfile(command=command))``. The profile -encloses the configurable information specific to a particular code, -so this may differ depending on which code. It can also be -useful for software libraries that manage their own configuration -to set the ``ASE_CONFIG_PATH`` to an empty string. - - -.. toctree:: - - eam - emt - abinit - amber - castep - cp2k - crystal - demon - demonnano - dftb - dmol - espresso - exciting - FHI-aims - fleur - gamess_us - gaussian - gromacs - gulp - harmonic - socketio/socketio - jacapo - kim - lammps - mopac - nwchem - octopus - onetep - openmx - orca - plumed - psi4 - qchem - siesta - turbomole - vasp - qmmm - checkpointing - mixing - loggingcalc - dftd3 - others - test - ace diff --git a/doc/ase/calculators/castep.rst b/doc/ase/calculators/castep.rst deleted file mode 100644 index 60ca1e3042..0000000000 --- a/doc/ase/calculators/castep.rst +++ /dev/null @@ -1,18 +0,0 @@ -.. module:: ase.calculators.castep - -======== -CASTEP -======== - - - -.. include:: ../../../ase/calculators/castep.py - :encoding: utf-8 - :start-after: CASTEP Interface Documentation - :end-before: End CASTEP Interface Documentation - - -Example: -======== - -.. literalinclude:: ase_castep_demo.py diff --git a/doc/ase/calculators/checkpointing.rst b/doc/ase/calculators/checkpointing.rst deleted file mode 100644 index 57836d1573..0000000000 --- a/doc/ase/calculators/checkpointing.rst +++ /dev/null @@ -1,124 +0,0 @@ -.. module:: ase.calculators.checkpoint - -============= -Checkpointing -============= - -Checkpointing adds restart and rollback capabilities to ASE scripts. It stores -the current state of the simulation (and its history) into an :mod:`ase.db`. -Something like what follows is found in many ASE scripts:: - - if os.path.exists('atoms_after_relax.traj'): - a = ase.io.read('atoms_after_relax.traj') - else: - ase.optimize.FIRE(a).run(fmax=0.01) - ase.io.write('atoms_after_relax.traj') - -The idea behind checkpointing is to replace this manual checkpointing -capability with a unified infrastructure. - - -Manual checkpointing -==================== - -The class :class:`Checkpoint` takes care of storing and retrieving -information from the database. This information *always* includes an -:class:`~ase.Atoms` object, and it can include attached information on -the internal state of the script. - -.. autoclass:: ase.calculators.checkpoint.Checkpoint - :members: - :member-order: bysource - -In order to use checkpointing, first create a Checkpoint object:: - - from ase.calculators.checkpoint import Checkpoint - CP = Checkpoint() - -You can optionally choose a database filename. Default is ``checkpoints.db``. - -Code blocks are wrapped into checkpointed regions:: - - try: - a = CP.load() - except NoCheckpoint: - ase.optimize.FIRE(a).run(fmax=0.01) - CP.save(a) - -The code block in the ``except`` statement is executed only if it has not yet -been executed in a previous run of the script. The :meth:`~Checkpoint.save` -statement stores all of its parameters to the database. - -This is not yet much shorter than the above example. The checkpointing object -can, however, store arbitrary information along the :class:`~ase.Atoms` -object. Imagine we have computed elastic constants and don't want to recompute -them. We can then use:: - - try: - a, C = CP.load() - except NoCheckpoint: - C = fit_elastic_constants(a) - CP.save(a, C) - -Note that one parameter to :meth:`~Checkpoint.save` needs to be an -:class:`~ase.Atoms` object, the others can be arbitrary. The -:meth:`~Checkpoint.load` statement returns these parameters in the order they -were stored upon save. In the above example, the elastic constants are stored -attached to the atomic configuration. If the script is executed again after the -elastic constants have already been computed, it will skip that computation and -just use the stored value. - -If the checkpointed region contains a single statement, such as the above, -there is a shorthand notation available:: - - C = CP(fit_elastic_constants)(a) - -Sometimes it is necessary to checkpoint an iterative loop. If the script -terminates within that loop, it is useful to resume calculation from the same -loop position:: - - try: - a, converged, tip_x, tip_y = CP.load() - except NoCheckpoint: - converged = False - tip_x = tip_x0 - tip_y = tip_y0 - while not converged: - ... do something to find better crack tip position ... - converged = ... - CP.flush(a, converged, tip_x, tip_y) - -The above code block is an example of an iterative search for a crack tip -position. Note that the convergence criteria needs to be stored to the database -so the loop is not executed if convergence has been reached. The -:meth:`~Checkpoint.flush` statement overrides the last value stored to the -database. - -As a rule :meth:`~Checkpoint.save` has to be used inside an -``except NoCheckpoint`` statement and :meth:`~Checkpoint.flush` outside. - - -Automatic checkpointing with the checkpoint calculator -====================================================== - -The :class:`CheckpointCalculator` is a shorthand for wrapping every single -energy/force evaluation in a checkpointed region. It wraps the actual -calculator. - -.. autoclass:: ase.calculators.checkpoint.CheckpointCalculator - :members: - :member-order: bysource - -Example usage:: - - calc = ... - cp_calc = CheckpointCalculator(calc) - atoms.calc = cp_calc - e = atoms.get_potential_energy() - -The first call to :meth:`~ase.Atoms.get_potential_energy` does the actual -calculation, a rerun of the script will load energies and force from the -database. Note that this is useful for calculation where each energy evaluation -is slow (e.g. DFT), but not recommended for molecular dynamics with classical -potentials since every single time step will be dumped to the database. This -will generate huge files. diff --git a/doc/ase/calculators/cp2k.rst b/doc/ase/calculators/cp2k.rst deleted file mode 100644 index 75a4ffc8ed..0000000000 --- a/doc/ase/calculators/cp2k.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. module:: ase.calculators.cp2k - -CP2K -==== - -.. autoclass:: CP2K diff --git a/doc/ase/calculators/crystal.rst b/doc/ase/calculators/crystal.rst deleted file mode 100644 index 8110d4fcdd..0000000000 --- a/doc/ase/calculators/crystal.rst +++ /dev/null @@ -1,180 +0,0 @@ -.. module:: ase.calculators.crystal - -========= -CRYSTAL14 -========= - -Introduction -============ - -The CRYSTAL_ simulation package is a Hartree-Fock and density -functional theory code using Gaussian localized basis functions. -CRYSTAL_ can handle systems periodic in 0 (molecules, 0D), 1 (polymers, 1D), -2 (slabs, 2D), and 3 dimensions (crystals, 3D). -This interface makes possible to use CRYSTAL_ as a calculator -in ASE. - -.. _CRYSTAL: http://www.crystal.unito.it/ - - -Environment variables -===================== - -Set environment variables in your configuration file (what is the name -of the command to be run). It is mandatory to set the input file as -"INPUT" and the standard output as "OUTPUT". - -- bash:: - - $ export ASE_CRYSTAL_COMMAND="/bin/CRY14/crystal < INPUT > OUTPUT 2>&1" (an example) - -- csh/tcsh:: - - $ setenv ASE_CRYSTAL_COMMAND "/my_disk/my_name/bin/crystal < INPUT > OUTPUT 2>&1" (an example) - - -CRYSTAL Calculator (a FileIOCalculator) -======================================= - -The calculator calls the CRYSTAL_ code only -to perform single point and gradient calculations. -The file 'fort.34' contains the input geometry and -the 'fort.20' contains the wave function in a binary -format. - -Below follows a list with a selection of parameters. - -============== ========= =============== ============================ -keyword type default value description -============== ========= =============== ============================ -``restart`` ``bool`` None Restart old calculation -``xc`` various 'HF' Hamiltonian. HF, MP2 or DFT - methods available -``spinpol`` ``bool`` False Spin polarization -``guess`` ``bool`` True Read wf from fort.20 file - when present -``basis`` ``str`` 'custom' Read basis set from - basis file -``kpts`` various None or (1,1,1) **k**-point sampling if - calculation is periodic -``isp`` ``int`` 1 Density of the Gilat net - with respect to Monkhorst- - Pack -``smearing`` ``float`` None Smearing. Only Fermi-Dirac - available -``otherkeys`` ``list`` [] All other CRYSTAL keywords -============== ========= =============== ============================ - -For parameters not set in ``otherkeys`` CRYSTAL_ will set the default value. -See the official `CRYSTAL manual`_ for more details. - -.. _CRYSTAL manual: http://www.crystal.unito.it/Manuals/crystal14.pdf - - -Exchange-correlation functionals -================================ - -The ``xc`` parameter is used to define the method used for the -calculation. Available options are Hartree-Fock ('HF'), second order -perturbation theory ('MP2') and the density-functional theory where ``xc`` -defines the exchange and correlation functional. In the latter case -a single string defines a standalone functional (see `CRYSTAL manual`_), -a tuple of strings set the first string as EXCHANGE and the second -string as 'CORRELAT' (see `CRYSTAL manual`_ for more details). - -.. code-block:: python - - calc = CRYSTAL(xc=('PBE','LYP')) - - -Setups -====== - -The CRYSTAL_ simulation package has few built-in basis sets, which -can be set in the calculation using the ``basis`` parameter, e. g.: - -.. code-block:: python - - calc = CRYSTAL(xc='PBE', basis='sto-3g') - -The default is to read from an external basis set. A library of -basis sets in CRYSTAL_ format can be found on the -website `CRYSTAL basis sets`_. - -.. _CRYSTAL basis sets: http://www.crystal.unito.it/basis-sets.php - -In this case a file named 'basis' must be present in the working directory -and must contain the basis sets for all the atom species. - -.. note:: - - The CRYSTAL_ simulation package allows to set up to three different - all electron basis sets and/or two valence electron basis sets for - the same atomic species (see `CRYSTAL manual`_ page 21 for more details). - - The number to be added to the atomic number reported in the 'basis' - file must be specified as an ``Atoms()`` class tag: - - >>> geom[0].tag = 100 - - In this case '100' will be summed to the atomic number of the first atom - in the 'fort.34' geometry file (e. g. '6', Carbon, becomes '106'). - - -Spin-polarized calculation -========================== - -If the atoms object has non-zero magnetic moments, a spin-polarized -calculation will be performed by default. -It is also possible to manually tell the calculator to perform a -spin-polarized calculation through the parameter ``spinpol``: - -.. code-block:: python - - calc = CRYSTAL(xc='PBE', spinpol=True) - - -Brillouin-zone sampling -======================= - -Brillouin-zone sampling is controlled by ``kpts``. This parameter -can be set to a sequence of three int values, e.g. (2, 2, 3), -which define a regular Monkhorst-Pack grid. If it is not defined a -``gamma`` calculation will be performed. -For 2D calculations ``kpts[2]`` will be to set to one, for 1D ones -also ``kpts[1]`` will be set to unity. -For molecular calculations (0D) any definition of the ``kpts`` -parameter will be ignored. - -The ``isp`` parameter can be used to define the relative -density of the auxiliary Gilat net (see `CRYSTAL manual`_): - -.. code-block:: python - - calc = CRYSTAL(xc='PBE', kpts=(2, 2, 2), isp=2) - -In this example the resulting Gilat net would be (4, 4, 4). - - -Reading an external wave function -================================= - -The calculator reads by default the wave function stored in -the 'fort.20' file if present (``guess=True``). -If this parameter is set to False the code will calculate the -wave function from scratch at any step, slowing down the performances. - - -Code related keywords -===================== - -The CRYSTAL_ simulation package allows for many other keywords. -Most of them can be specified through the ``otherkeys`` parameter. - -.. code-block:: python - - calc = CRYSTAL(xc='PBE', otherkeys=['scfdir', 'anderson', - ['maxcycles', '500'], - ['toldee', '6'], - ['tolinteg', '7 7 7 7 14'], - ['fmixing', '90']]) diff --git a/doc/ase/calculators/demon.rst b/doc/ase/calculators/demon.rst deleted file mode 100644 index f2e5928a28..0000000000 --- a/doc/ase/calculators/demon.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. module:: ase.calculators.demon - -Demon -===== - -http://www.demon-software.com/public_html/index.html - -.. autoclass:: Demon diff --git a/doc/ase/calculators/demonnano.rst b/doc/ase/calculators/demonnano.rst deleted file mode 100644 index e27109bc18..0000000000 --- a/doc/ase/calculators/demonnano.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. module:: ase.calculators.demonnano - -========== -deMon-Nano -========== - -deMon-Nano_ is a density-functional based tight-binding (DFTB) code using atom centered orbitals. This -interface makes it possible to use deMon-Nano_ as a calculator in ASE. -You need Slater-Koster files for the combination of -atom types of your system. These can be obtained at dftb.org_. - -.. _deMon-Nano: http://demon-nano.ups-tlse.fr/ -.. _dftb.org: http://www.dftb.org/ - -Environment variables -===================== - -Set environment variables in your configuration file (what is the directory -for the Slater-Koster files and what is the name of the executable): - -- bash:: - - $ DEMONNANO_BASIS_PATH="/path/to/basis/" (an example) - $ ASE_DEMONNANO_COMMAND="/path/to/bin/deMon.username.x (an example) - -deMon-Nano Calculator (a FileIOCalculator) -========================================== - -.. autoclass:: DemonNano - -Example: Geometry Optimization with ASE -======================================= - -.. literalinclude:: demonnano_ex1_relax.py - diff --git a/doc/ase/calculators/demonnano_ex1_relax.py b/doc/ase/calculators/demonnano_ex1_relax.py deleted file mode 100644 index 2645a5379c..0000000000 --- a/doc/ase/calculators/demonnano_ex1_relax.py +++ /dev/null @@ -1,26 +0,0 @@ -import numpy as np - -from ase import Atoms -from ase.calculators.demonnano import DemonNano -from ase.io import write -from ase.optimize import BFGS - -d = 0.9775 -t = np.pi / 180 * 110.51 -mol = Atoms('H2O', - positions=[(d, 0, 0), - (d * np.cos(t), d * np.sin(t), 0), - (0, 0, 0)]) - -input_arguments = {'DFTB': 'SCC', - 'CHARGE': '0.0', - 'PARAM': 'PTYPE=BIO'} - -calc = DemonNano(label='rundir/', input_arguments=input_arguments) -mol.calc = calc - -# optimize geometry -dyn = BFGS(mol, trajectory='test.traj') -dyn.run(fmax=0.01) - -write('h2o_optimized.xyz', mol) diff --git a/doc/ase/calculators/dftb.rst b/doc/ase/calculators/dftb.rst deleted file mode 100644 index dde798c3a8..0000000000 --- a/doc/ase/calculators/dftb.rst +++ /dev/null @@ -1,142 +0,0 @@ -.. module:: ase.calculators.dftb - -===== -DFTB+ -===== - -Introduction -============ - -`DFTB+`_ is a density-functional based tight-binding code using -atom-centered orbitals. This interface makes it possible to use `DFTB+`_ -as a calculator in ASE. You need Slater-Koster files for the combination -of atom types of your system. These can be obtained at dftb.org_. - -.. _DFTB+: https://www.dftbplus.org/ -.. _dftb.org: http://www.dftb.org/ - - -Environment variables -===================== - -.. highlight:: bash - -The default command that ASE will use to start DFTB+ is -``dftb+ > PREFIX.out``. You can change this command by setting the -:envvar:`ASE_DFTB_COMMAND` environment variable, e.g.:: - - $ export ASE_DFTB_COMMAND="/path/to/dftb+ > PREFIX.out" - -For compatibility, also the old :envvar:`DFTB_COMMAND` variable can -be used, and the resulting command will be ``$DFTB_COMMAND > PREFIX.out``. -Before each DFTB+ calculation, also make sure that the -:envvar:`DFTB_PREFIX` variable points to the directory where -the Slater-Koster files are kept, e.g.:: - - $ export DFTB_PREFIX=/path/to/mio-0-1/ - - -Parameters -========== - -As a FileIOCalculator, ``ase.calculators.dftb.Dftb`` writes input files, -runs DFTB+, and extracts the required information from the resulting output. -The input files are :file:`dftb_in.hsd` (the calculation settings), -:file:`geo_end.gen` (the initial geometry) and -:file:`dftb_external_charges.dat` (the external point charges -in case of electrostatic QM/MM embedding). - -.. highlight:: none - -All keywords for the :file:`dftb_in.hsd` input file (see the DFTB+ manual) -can be set by ASE. Consider the following input file block:: - - Hamiltonian = DFTB { - SCC = Yes - SCCTolerance = 1e-8 - MaxAngularMomentum = { - H = s - O = p - } - } - -.. highlight:: python - -This can be generated by the DFTB+ calculator by using the -following settings:: - - calc = Dftb(Hamiltonian_='DFTB', # this line is included by default - Hamiltonian_SCC='Yes', - Hamiltonian_SCCTolerance=1e-8, - Hamiltonian_MaxAngularMomentum_='', - Hamiltonian_MaxAngularMomentum_H='s', - Hamiltonian_MaxAngularMomentum_O='p') - -In addition to keywords specific to DFTB+, also the following keywords -arguments can be used: - - restart: str - Prefix for restart file. May contain a directory. - Default is None: don't restart. - ignore_bad_restart_file: bool - Ignore broken or missing restart file. By default, it is an - error if the restart file is missing or broken. - label: str (default 'dftb') - Prefix used for the main output file (