Question
For python: The energy levels for a quantum particle in a three-dimensional rectangular box of dimensions {1,2, and 3}{L1,L2, and L3} are given by 1,2,3=222[2121+2222+2323]En1,n2,n3=222m[n12L12+n22L22+n32L32]
For python: The energy levels for a quantum particle in a three-dimensional rectangular box of dimensions {1,2, and 3}{L1,L2, and L3} are given by
1,2,3=222[2121+2222+2323]En1,n2,n3=222m[n12L12+n22L22+n32L32]
where the n's are integers greater than or equal to one. Your goal is to write a program that will calculate, and list in order of increasing energy, the values of the n's for the 10 lowest different energy levels, given a box for which 2=21L2=2L1 and 3=41L3=4L1.
Your program should include two user-defined functions that you may find helpful in accomplishing your goal:
-
A function energy(n1, n2, n3) that takes integer values 1n1, 2n2, and 3n3, and computes the corresponding energy level in units of 22/22122/2mL12.
-
A function lowest_unique_K(K, List) which takes a positive integer K and a list of real numbers List, and returns an ordered (ascending) list of the lowest K unique numbers in the list List. For instance, lowest_unique_K(3, [-0.5, 3, 3, 2, 6, 7, 7]) would return [-0.5, 2, 3]. The function should not modify the original list List.
- As with most programming puzzles, there are several ways to write this function. Depending on how you do it, you may or may not find it helpful to recall "Program 9" in the Workshop's "Debugging Practice" (about copying lists), or to Google how to "sort" lists, or how to "del" or "pop" items out of lists.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started