-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a02066c
commit 9fc6c12
Showing
4 changed files
with
62 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Traceback (most recent call last): | ||
File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/jupyter_cache/executors/utils.py", line 58, in single_nb_execution | ||
executenb( | ||
File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/nbclient/client.py", line 1319, in execute | ||
return NotebookClient(nb=nb, resources=resources, km=km, **kwargs).execute() | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 165, in wrapped | ||
return loop.run_until_complete(inner) | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete | ||
return future.result() | ||
^^^^^^^^^^^^^^^ | ||
File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/nbclient/client.py", line 709, in async_execute | ||
await self.async_execute_cell( | ||
File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/nbclient/client.py", line 1062, in async_execute_cell | ||
await self._check_raise_for_error(cell, cell_index, exec_reply) | ||
File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/nbclient/client.py", line 918, in _check_raise_for_error | ||
raise CellExecutionError.from_cell_and_msg(cell, exec_reply_content) | ||
nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell: | ||
------------------ | ||
# Define a function for the energy (in a.u.) of a particle in a circular disk | ||
# with length a, principle quantum number n, and angular quantum number l | ||
# The length is input in Bohr (atomic units). | ||
def compute_energy_disk(n, l, a): | ||
"Compute 1-dimensional particle-in-a-spherical-ball energy." | ||
#Compute the first n zeros of the Bessel function | ||
zeros = special.jn_zeros(l,n) | ||
#Compute the energy from the n-th zero. | ||
return (zeros[-1])**2/ (2 * a**2) | ||
|
||
#This next bit of code just prints out the energy in atomic units | ||
def print_energy_disk(a, n, l): | ||
print(f'The energy of an electron confined to a disk with radius {a:.2f} a.u.,' | ||
f' principle quantum number {n}, and angular quantum number {l}' | ||
f' is {compute_energy_disk(n, l, a):.3f} a.u..') | ||
|
||
print_energy_disk(a, n, l) | ||
------------------ | ||
|
||
|
||
[0;31m---------------------------------------------------------------------------[0m | ||
[0;31mNameError[0m Traceback (most recent call last) | ||
Cell [0;32mIn[2], line 17[0m | ||
[1;32m 12[0m [38;5;28;01mdef[39;00m[38;5;250m [39m[38;5;21mprint_energy_disk[39m(a, n, l): | ||
[1;32m 13[0m [38;5;28mprint[39m([38;5;124mf[39m[38;5;124m'[39m[38;5;124mThe energy of an electron confined to a disk with radius [39m[38;5;132;01m{[39;00ma[38;5;132;01m:[39;00m[38;5;124m.2f[39m[38;5;132;01m}[39;00m[38;5;124m a.u.,[39m[38;5;124m'[39m | ||
[1;32m 14[0m [38;5;124mf[39m[38;5;124m'[39m[38;5;124m principle quantum number [39m[38;5;132;01m{[39;00mn[38;5;132;01m}[39;00m[38;5;124m, and angular quantum number [39m[38;5;132;01m{[39;00ml[38;5;132;01m}[39;00m[38;5;124m'[39m | ||
[1;32m 15[0m [38;5;124mf[39m[38;5;124m'[39m[38;5;124m is [39m[38;5;132;01m{[39;00mcompute_energy_disk(n,[38;5;250m [39ml,[38;5;250m [39ma)[38;5;132;01m:[39;00m[38;5;124m.3f[39m[38;5;132;01m}[39;00m[38;5;124m a.u..[39m[38;5;124m'[39m) | ||
[0;32m---> 17[0m print_energy_disk([43ma[49m, n, l) | ||
|
||
[0;31mNameError[0m: name 'a' is not defined | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.