Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
237 views

Python Program To Generate Spherical Harmonic

A generalized Python program has been developed to show pictorial form of wave function of hydrogen and hydrogen like atoms. This program will be helpful to teach solution of Schrodinger equation for hydrogen and hydrogen like atoms to undergraduate students. The python program not only shows pictorial form of the wave function but it also gives analytical form of the wave function. The wave- functions and the orbital from 1s (1,0,0) to 9f (9,3,0) are pr

Uploaded by

WARSE Journals
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
237 views

Python Program To Generate Spherical Harmonic

A generalized Python program has been developed to show pictorial form of wave function of hydrogen and hydrogen like atoms. This program will be helpful to teach solution of Schrodinger equation for hydrogen and hydrogen like atoms to undergraduate students. The python program not only shows pictorial form of the wave function but it also gives analytical form of the wave function. The wave- functions and the orbital from 1s (1,0,0) to 9f (9,3,0) are pr

Uploaded by

WARSE Journals
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

ISSN 2278-3091

Volume 10, No.3, May - June 2021


Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523
International Journal of Advanced Trends in Computer Science and Engineering
Available Online at http://www.warse.org/IJATCSE/static/pdf/file/ijatcse1421032021.pdf
https://doi.org/10.30534/ijatcse/2021/1431032021

Python program to generate spherical harmonic


Kousar Shaheen1, Roohi Zafar1, Saba Javaid1
1
Department of Physics, NED University of Engineering and Technology, Pakistan
kousarshaheen416@gmail.com
roohizj@neduet.edu.pk
hars4@yahoo.com ,
ABSTRACT

and making assumption that a wave function depends


A generalized Python program has been developed to
upon four variables x, y, z, r [5]. The Mathematica
show pictorial form of wave function of hydrogen
software program offers a variety of tools for
and hydrogen like atoms. This program will be
understanding, manipulate and visualize atomic and
helpful to teach solution of Schrodinger equation for
Molecular systems, in which, orthogonal polynomials
hydrogen and hydrogen like atoms to undergraduate
and Clebsch- Gordan Coefficients, polar plots,
students. The python program not only shows
spherical plots, density plots, Contour plots and
pictorial form of the wave function but it also gives
animation are included [6-7]. In 2013, Chung et.al
analytical form of the wave function. The wave-
described that how Winplot software programs can
functions and the orbital from 1s (1,0,0) to 9f (9,3,0)
be used to understand and visualize micorbitals and
are presented in this article.
wave functions of a hydrogen like atom [8]. In this
Key words: Probability Distribution Function, work, we transformed probability distribution
Associated Laguerre Polynomials, Associated function from Polar coordinate system to cartesian
Legendre Polynomials, Hyper geometric function. coordinate system by modifying spherical harmonics
and radial distribution function. [9-11]
1. INTRODUCTION
2.THEORY
Hydrogen atom is of fundamental important, as it is
the only atom for which Schrödinger’s equation can Schrodinger equation for hydrogen and hydrogen like
be solved exactly and the wave function of this atom atom is a fundamental equation in quantum
provides the basis for many approximate methods to mechanics to solve wave functions for these atoms,
solve many electron atoms. It has been found that which describes the state of the system. The wave
students, which are studied in introduction of equation for one electron system in the field of a
Quantum Physics, misinterpret polar graphs and nucleus of charge Ze is given by equation
hydrogen eigen state probability distribution plots. In
ћ 1
2002, Budde et.al investigated that according to their = − ∇ − =
research, experience, gaining knowledge of quantum 2
atomic model increases many problems. Detailed
Where E is the total energy of the system, is the
survey of various college students’ preconceptions
total wavefunction and Z is the atomic number. Since
problems may be found [1,2]. In 2002, Müller et.al
coulomb potential energy and the boundary
found that many college students believe that in atom
conditions are spherically symmetric,solutions
just like the Bohr’s model, electrons orbiting around
to Schrödinger's equation may be solved by using
the nucleus. Although a number of them recognize
separation of variable method and the wavefunction
that it’s not correct, this idea appears to be very
can be written as the product of a radial and an
resistant [3]. There are new approaches to solve these
angular part
troubles and lead college students to better
understanding [2-4]. In 1962, Fowles et.al generated 1 2
a general equation of Cartesian coordinate with ( , , )= ( , ) ( , )
modification of Schrodinger’s equation by separable
variable method Where ( , )a spherical harmonics with l is
orbital quantum number, an integer with values ≥ 0.

2513
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

3
2 + 1 ( − | |)!
( , )= (cos ) ( ≥ 0)
4 ( + | |)!

Where is a Legendre polynomial and can be calculated by using equation 4

| |
( + | |)! (1 − ) 1 − cos 4
(cos ) = | |
| | − , | | + + 1; | | + 1;
( − | |)! 2 | |! 2
| |
(| | − )( ) (| | + + 1)(
5
1 − cos )
| | − , | | + + 1; | | + 1; =  
2 (| | + 1)( ) !

The radial part of equation 2 , ( , ) is a solution of the differential equation

2 ( + 1) 1 6
+ − − ( , )=0

With boundary conditions ( , 0) = 0 and ( , 0) = ∞ . For these boundary conditions only integer values of n,
principle quantum number, are allowed. Furthermore, the value of orbital quantum number l must be less than
principle quantum number n. Number of nodes in the solution other than origin is n-l-1.We can calculate the radial
function for the state with quantum number n,l by using equation 7.

7
2 ( − − 1)! 2 2
( , )=
2 [( + )!]

In which is an associated Laguerre polynomial of degree n-l-1.

2 ( + )! 2 8
= ( + )!   (−1)
( − − 1 − )! (2 + 1 + )! !

Now by using equation 3-8, total wave function can be written as [11-13].

9
2 ( − − 1)! 2 ( + )! 2
=   (−1)
2 [( + )!] ( − − 1 − )! (2 + 1 + )! !

| |/
2 + 1 ( − | |)! ( + | |)! 1 −
( + )!
4 ( + | |)! ( − | |)! 2| | | |!

| |
(| | − )( ) (| | + + 1)( )
×  
(| | + 1)( ) !

3.METHODOLOGY

In this work by using transformation equation


= + + 10

= arccos 11
+ +

= tan 12

2514
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

We can determine the explicit forms of associated Laguerre Polynomials, radial probability distribution and
Hypergeometric function for Associated Legendre Polynomials into Cartesian coordinates and with the help of
them; we can transform total wave function into Cartesian coordinate [14]

13
( )! ( )( | |)!
( , , )= )!]
× × × × ×
[( ( | |)!

| |
( | |)! ( ) ( )!
( + )! × | |( | |)!| |!
× × ∑ ( )!( )! !
×

| | (| | )( ) ×(| | )( )
×∑ ×
(| | )( )× !×

ℎ , 14
| |
+ | |/
× = 1− ×
+ +
| | | |
− | |
= + × + +
| | | |

15
( )! ( )( | |)!
Ψ ( , , )= )!]
× × × × ( + )! ×
[( ( | |)!

( | |)! | | ( ) ( )!
| |( | |)!| |!
× + | |
× ∑ ( )!( )! !
× ×

| | | |
| | (| | )( ) ×(| | )( )
∑ × × + +
(| | )( )× !× | |

The notations in lower subscript are pochhammer symbols e.g. (m-n) (k) etc.

4.RESULT AND DISCUSSION


The general form of total wave function in Cartesian coordinate, equation (15), helps us to understand visualize the
behavior of orbitals and probability distribution functions. In this work forty Wave functions from (1,0,0) to (9,3,0)
are generated and are given in table 1. Some wave functions in Cartesian coordinates have also been plotted by
using different tools of python plotting in python program which we have code see appendix[15].

Table 1: Wave functions from (1,0,0) to (9,3,0) in Cartesian coordinate

16
Ψ (1,0,0) =0.707106781186548√2 ÷√
17
Ψ (2,0,0) = √2 0.25 − 0.125 + + ÷ (√ )
18
Ψ (2,1,0) = 0.125√2 ÷ (√ )
Ψ (3,0,0) = 19

√2 0.136 − 0.09072 + + +0.01008 + 0.01008 + 0.01008 ) ÷


(√ )
20
Ψ (3,1,0) = 0.61237√2 0.12096 − 0.02016 + + ÷(√ )

2515
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

21
Ψ (3,2,0) = √2(−0.00356389 − 0.00356389 + 0.00712778 ) ÷ (√ )
Ψ(4,0,0) = √2 0.0884 − 0.06629 + + + 0.0110485 ( + + ) − 0.00046 ( + 22

+ ) ÷ (√ )
Ψ(4,1,0) = 0.61237√2 0.080687 − 0.02017 + + +0.0010086 + 0.0010086 + 23

0.0010086 ) ÷(√ )

Ψ(4,2,0) = 0.790569√2 0.0069877 − 0.00058 + + 3.0 ( + + ) + 1.5 − 24

+ + + + − 2.0( + + ) ÷(√ + + )

Ψ(4,3,0) = √2 0.001235 ( + + ) + 0.0005147 − + + ( + + ) + 25

0.0015441 − + + ( + + ) − 0.0010294( + + ) ) ÷

(√ ( + + ))
Ψ(5,0,0) = √2 0.063246 − 0.050596 + + + 0.0101193 ( + + )− 26

0.0006746 ( + + ) + 1.349 × 10 ( + + ) ) ÷ (√ )
Ψ(5,1,0) =0.61237√2 0.0584 − 0.01753 + + + 0.0014 ( + + ) − 27

3.1159 × 10 ( + + ) ÷ (√ )

Ψ(5,2,0) = 0.79057√2 3.0 ( + + ) + 1.5 − + + + + − 2 . 0 ( + 28

+ ) 0.005355 − 0.00071395 + + +2.03986 ⋅ 10 + 2.03986 ⋅ 10 +

2.03986 ⋅ 10 ) ÷ (√ + + )

Ψ(5,3,0) = 0.9354√2 0.000204 − 1.01993 ⋅ 10 + + 6.0 ( + + ) + 29

2.5 − + + ( + + ) + 7.5 − + + ( + + ) −

5.0 ( + + ) ÷ (√ ( + + ))

( ) + 1.5776 ⋅ 10 ( 30
Ψ(5,4,0)= √2 3.60599 ⋅ 10 + + − + + + +
) + 6.310485 ⋅ 10 − + + ( + + ) + 8.11348 ×

( ) − 3.24539 ⋅ 10 (
10 − + + + + + + ) ÷
(√ ( + + ) )
Ψ(6,0,0) = 31
√2 0.04811 − 0.040094 + + + 0.00891 ( + + ) − 0.0007425 ( +

+ ) + 2.474924 ⋅ 10 ( + + ) − 2.74992 ⋅ 10 ( + + ) ÷
(√ )
Ψ(6,1,0) = 0.61237√2 0.04473 − 0.01491 + + + 0.001491 ( + + )− 32

5.522 ⋅ 10 ( + + ) + 6.574 ⋅ 10 ( + + ) ÷ (√ )

2516
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

Ψ(6,2,0)=0.7905√2 3.0 ( + + ) + 1.5 − + + + + − 2.0 ( + 33

+ ) 0.00421685 − 0.00070281 + + + 3.3467 ⋅ 10 ( + + )−

4.6482 ⋅ 10 ( + + ) ÷(√ + + )

Ψ(6,3,0) = 0.9354√2 6.0 ( + + ) + 2.5 − + + ( + + ) + 7.5 − 34

+ + ( + + ) − 5.0( + + ) ) 0.0001739 − 1.4492 ⋅


10 + + +2.68364

× 10 + 2.68364 ⋅ 10 + 2.68364 ⋅ 10 ) ÷ (√ ( + + ))
Ψ(6,4,0) = 1.061 35
√2 3.6005 ⋅ 10 − 1.20016 ⋅ 10 + + 10.0 ( + + ) + 4.375 −
+ + ( + + ) + 17.5 − + + ( + + ) + 22.5 ( −

+ + ( 36 + + ) − 9.0( + + ) ÷ (√ ( + +
) )
Ψ(6,5,0) = √2 6.36482 ⋅ 10 ( + + ) + 3.34153 ⋅ 10 − + + ( + + 36

) + 1.670765 ⋅ 10 − + + ( + + ) + 2.97025 × 10 −
+ + ( + + ) + 2.2277 ⋅ 10 − + + ( + + ) −

5.940496 ⋅ 10 ( + + ) ÷ (√ ( + + ) )

Ψ(7,0,0) = 37
√2 0.0382 − 0.032726 + + + 0.007792 ( + + ) − 0.0007421 ( +
+ ) + 3.180356 ⋅ 10 ( + + ) − 6.05782× 10 ( + + ) + 4.120967 ⋅

10 ( + + ) ÷ (√ )
Ψ(7,1,0)=0.61237√2 0.035627 − 0.0127241 + + + 0.001454 ( + + )− 38
6.9247 ⋅ 10 ( + + ) + 1.413197 ⋅ 10 ( + + ) − 1.00943 ⋅ 10 ( + +

) ÷ (√ )

Ψ(7,2,0) = 0.790569√2 3.0 ( + + ) + 1.5 − + + + + − 2.0( + 39

+ ) (0.0034 − 0.00065 + + + 3.98161 ⋅ 10 ( + + )−

9.4800157 ⋅ 10 ( + + ) + 7.52382 ⋅ 10 ( + + ) ÷
(√ + + )
Ψ(7,2,0)0.790569√2 3.0 ( + + ) + 1.5 − + + + + − 2.0( + + 40

) (0.0034 − 0.00065 + + + 3.98161 ⋅ 10 ( + + ) − 9.4800157 ⋅

10 ( + + ) + 7.52382 ⋅ 10 ( + + ) ÷ (√ + + )
Ψ(7,3,0)= 0.9354√2 0.00014689 − 1.573868 ⋅ 10 + + + 4.99641 ⋅ 10 ( + 41
+ ) − 4.7584828 ⋅ 10 ( + + ) 6.0 ( + + ) +
2.5( − + + ( + + ) + 7.5 − + + ( + + ) −

2517
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

5.0 ( + + ) ÷ (√ ( + + ))
Ψ(7,4,0)=1.06066√2 3.34859 ⋅ 10 − 1.913478 ⋅ 10 + + + 2.48504 ⋅ 10 + 42
2.48504 ⋅ 10 + 2.48504 ⋅ 10 ) 10.0 ( + + ) +
4.375( − + + ( + + ) + 17.5 − + + ( + + ) +

22.5 − + + ( + + ) − 9.0( + + ) ) ÷ (√ ( +
+ ) )
Ψ(7,5,0) =1.1726√2 4.26095 ⋅ 10 − 1.014512 ⋅ 10 + + (15.0 ( + + 43
) +7.875 − + + ( + + ) + 39.375 − + + ( + +
) + 70.0( − + + ( + + ) + 52.5 − + + ( + + ) −

14.0( + + ) ÷ (√ ( + + ) )

Ψ(7,6,0)=√2 7.5323669 ⋅ 10 ( + + ) + 5.1785023 ⋅ 10 − + + ( + 44

+ ) + 3.1071014 ⋅ 10 − + + ( + + ) + 7.061594 ⋅ 10 −
+ + ( + + ) + 7.532367 ⋅ 10 − + + ( + + ) +
3.7662 ⋅ 10 − + + ( + + ) − 7.173683 ⋅

( + + ) ÷ (√ ( + + ) )

Ψ(8,0,0) =√2 0.03125 − 0.02734375 + + + 0.006836 ( + + )− 45


0.0007120768 ( + + ) + 3.56038411458333 ⋅ 10 ( + + ) −
8.90096028645833 ⋅ 10 ( + + ) + 1.05963812934028 ⋅ 10 ( + + ) −

4.73052736312624 ⋅ 10 ( + + ) ÷ (√ )
Ψ(8,1,0)= 46
0.61237√2 0.0292316983341714 − 0.0109618868753143 + +
+ 0.00137023585941429 ( + + ) − 7.61242144119047
⋅ 10 ( + + ) + 2.03904145746173 ⋅ 10 ( + + )
− 2.54880182182717 ⋅ 10 ( + + ) + 1.1800008434385
1
⋅ 10 ( + + ) ÷ (√ )

Ψ(8,2,0)=0.790569415042095√2 3.0 ( + + ) + 1.5 − + + + + − 47

2.0( + + )
0.00283034702074012 − 0.000589655629320859 + + +
4.21182592372042 × 10 ( + + ) − 1.31619560116263 ⋅ × 10 ( + +
) + 1.82804944605921 ⋅ 10 ( + + ) − 9.14024723029606 ⋅ 10 ( + +

) ÷ (√ + + )

Ψ(8,3,0)= 0.935414346693485√2 6.0 ( + + ) + 2.5 − + + ( + + ) + 48

7.5( − + + ( + + ) − 5.0( + + ) (0.000124942948173623 −


1.5617868 × 10 + + + 6.50744521737619 ⋅ 10 ( + + )−
1.08457420289603 ⋅ 10 ( + + ) + 6.16235342554563 ⋅ 10 ( + +

2518
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

) ÷ (√ ( + + ))
Ψ(8,4,0)= 49
1.06066017177982√2 3.00566019839111 ⋅ 10 − 2.25424514879333 ⋅
10 + + + 5.12328442907575 ⋅ 10 ( + + ) − 3.55783640908038 ⋅
10 ( + + ) (10.0 ( + + ) + 4.375 − + + ( + + ) +
17.5 − + + ( + + ) + 22.5 − + + ( + + ) −

9.0( + + ) ÷ (√ ( + + ) )
Ψ(8,5,0)= 50
1.17260393995586√2 4.2659868006405 ⋅ 10 − 1.77749450026687 ⋅
10 + + +1.70912932717969 ⋅ 10 + 1.70912932717969 ⋅ 10 +
1.70912932717969 ⋅ 10 )(15.0 ( + + ) + 7.875 − + + ( + +
) + 39.375 − + + ( + + ) + 70.0 − + + ( + +

) + 52.5 − + + ( + + ) − 14.0 14.0( + + ) ÷


(√ ( + + ) )
Ψ(8,6,0)= 51
1.2747548783982√2 3.61754492653168 ⋅ 10 − 6.45990165452086 ⋅
10 + + 21.0 ( + + ) + 14.4375 − + + ( + + ) +
86.625 − + + ( + + ) + 196.875 − + + ( + + ) +
210.0 − + + ( + + ) + 105.0 − + + ( + + ) −

20.0( + + ) ÷ (√ ( + + ) )

Ψ(8,7,0) =√2 6.39497637199385 ⋅ 10 ( + + ) − 2.79907421453732 ⋅ 10 − 52

+ + ( + + ) + 1.33001057808236 ⋅ 10 − + + ( + +
) + 1.18706748905136 ⋅ 10 − + + ( + + ) + 1.6487×10 −
+ + ( + + ) + 1.19905806974885 ⋅ 10 − + + ( + +
) + 4.31660905109585 ⋅ 10 − + + ( + + ) − 6.16658435870836 ⋅

10 ( + + ) ) ÷ (√ ( + + ) )
Ψ(9,0,0) = 53
√2 0.0261891400439462 − 0.0232792355946188 + + +
0.00603535737638266 ( + + )−
0.000670595264042518 ( + + ) + 3.72552924468066 ⋅ 10 ( + + ) −
1.10386051694242 ⋅ 10 ( + + ) + 1.75215955070225 ⋅ 10 ( + + ) −
1.39060281801766 ⋅ 10 ( + + ) + 4.29198400622734 ⋅ 10 ( +

+ ) ÷ (√ )
Ψ(9,1,0)= 54
0.612372435695794√2 0.0245384688888866 − 0.00954273790123367 + + +
0.00127236505349782 ( + + ) − 7.85410526850508 ⋅ 10 ( + + ) +
2.49336675190637 ⋅ 10 ( + + ) − 4.15561125317729 ⋅ 10 ( + + ) +
3.42025617545456 ⋅ 10 ( + + ) − 1.08579561125542 ⋅ 10 ( + +

2519
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

) ÷ (√ )

Ψ(9,2,0)=0.790569415042095√2 3.0 ( + + ) + 1.5 − + + + + − 55

2.0 ( + + ) (0.00239249100690121 − 0.00053166466820027 + + +


4.2195608587323 ⋅ 10 ( + + ) − 1.562800318049 ⋅ 10 ( + + ) +
2.8940746630537 ⋅ 10 ( + + ) − 2.57251081160329 ⋅ 10 ( + + ) +

8.66165256432085 ⋅ 10 ( + + ) ÷ (√ + + )

Ψ(9,3,0)=0.935414346693485√2 6.0 ( + + ) + 2.5 − + + ( + + ) + 56

7.5 − + + ( + + ) − 5.0( + + ) 0.000107412483486202 −


1.49184004841947 ⋅ 10 + + + 7.36711135021961 ⋅ 10 ( + + ) −
1.63713585560436 ⋅ 10 ( + + ) + 1.65367258141854 ⋅ 10 ( + + ) −

6.12471326451312 ⋅ 10 ( + + ) ÷ (√ ( + + )

2520
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

Figure 1: Few wave-functions plotting in Cartesian co-ordinate

5. CONCLUSION Collection of papers presented. Disponible en internet: www. phys.


ksu. edu/perg/papers/narst. March 1999.
Pictorial and analytical form of Hydrogen wave function in 5.Fowles, G. R. Solution of the Schrödinger equation for the
Cartesian coordinate is a base to calculate wave function, hydrogen atom in rectangular coordinates. American Journal of
probability density, total energy etc of many theoretical methods to Physics, 30(4), 308-309,1962.
6.Wang, J. B., Abbott, P. C., & Williams, J. F.. Visualizing atomic
solve many electrons atoms. reported python code can be used to
orbitals. Computers in Physics, 10(1), 69-82,1996.
calculate many properties like size, energies with growing atomic 7. Chung, W. C.Three-dimensional atomic orbital plots in the
size, orbit number of orbital etc. we can also use wave functions in classroom using Winplot 2013
Cartesian coordinates to visualized and understand behavior of 8. Chung, W. C. Three-dimensional atomic orbital plots in the
orbitals. In this work 40 wave function in analytical and 20 classroom using Winplot.2013.
probability distribution, functions in pictorial form in Cartesian 9. Griffiths, D. J. Introduction to quantum mechanics. Prentice
coordinates are reported. Hall, second edi.2010.
10. Liboff, R. L. Introductory quantum mechanics. Pearson
REFERENCES Education India.2003.
1. Budde, M., Niedderer, H., Scott, P., & Leach, J.. 'Electronium': a 11. Zettili, N. (2003). Quantum mechanics: concepts and
quantum atomic teaching model. Physics Education, 37(3), applications.
197,2002. 12. Condon, E. U., & Odabasi, H. Atomic structure. CUP
2.Budde, M., Niedderer, H., Scott, P., & Leach, J. . The quantum Archive1980.
atomic model ‘Electronium': a successful teaching tool. Physics 13. Fischer, C. F. Hartree--Fock method for atoms. A numerical
Education, 37(3), 204,2002. approach 1977.
3.Müller, R., & Wiesner, H. . Teaching quantum mechanics on an 14. Arfken, G. B., & Weber, H. J. (). Mathematical methods for
introductory level. American Journal of physics, 70(3), 200- physicists ,1999.
209,2002. 15. Ahmed Ali Rajput, Fida Hussain Khoso, Muhammad Daniyal,
4.Niedderer, H., & Deylitz, S. Evaluation of a new approach in Misha Shafi, Muhammad MustaqeemZahid, Hasan Nafees and
quantum atomic physics in high school. In Annual Meeting Zaheer Uddin,A python program to model and analyze wind speed
National Association For Research In Science Teaching, Boston. data. International Journal, 9(6)2021.

2521
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

Appendix A R=1

p=sm.pi
Python code
Q=sm.sqrt(1/(2*p))
#Wave function generator
U=sm.sqrt((((2/n)**3)))*sm.sqrt((((mt.fa
def wave_generator(): ctorial(n-l-
1))/((2*n)*(mt.factorial(n+l)**3)))))*(Fract
x=sm.Symbol('x') ion(2/n)**l)*sm.exp(-
rho/2)*(r/a)**l*sm.sqrt(1/(a**3))
a=sm.Symbol('a')
H=sm.sqrt((((2*l+1)*(mt.factorial(l-
y=sm.Symbol('y') np.abs(m))))/(2*(mt.factorial(l+np.abs(m))))
))
n=int(input("n="))
o=Q*U*H*sm.exp(-
l=int(input("l=")) rho/2)*Q*((r/a)**l)*sm.sqrt(1/(a**3))

m=int(input("m=")) for i in np.arange(0,f+1):

limit=int(input("limit=")) if R!=0:

z=sm.Symbol('z') R=(((hammer(t,i)*hammer(b,i))/(ha
mmer(c,i)*2**i*mt.factorial(i))))*(((1-
r=sm.Symbol('r') d)))**i

d=z/(sm.sqrt(x**2+y**2+z**2)) Z=Z+R

r=sm.sqrt(x**2+y**2+z**2) k=((mt.factorial(np.abs(m)+l)/((mt.facto
rial(l-
theta=sm.Symbol("theta") np.abs(m)))*(2**np.abs(m)*mt.factorial(np.ab
s(m))))))*Z
def hammer(l,s):
p=2*l+1
g=1
q=n-l-1
if g!=0:
F=0
for i in np.arange(0,s):
for i in np.arange(0,q+1):
b=i+l
h=((mt.factorial(q+p)*(((-
g=g*b 1)**i)*(mt.factorial(p+q)/((mt.factorial(q-
i)*mt.factorial(p+i)*mt.factorial(i)))))))*(
return g rho**i)

t=np.abs(m)-l #print(h)

b=np.abs(m)+l+1 F=h+F

c=np.abs(m)+1 O=sm.sqrt(((((2/n)**3)))*((((mt.factoria
l(n-l-
rho=(2*r)/(n*a) 1))/((2*n)*(mt.factorial(n+l)**3))))))*((2/n
)**l)
f=n+l+np.abs(m)
T=simplify(F*O)
Z=0

2522
Kousar Shaheen et al., International Journal of Advanced Trends in Computer Science and Engineering, 10(3), May - June 2021, 2513 – 2523

G=T*sm.exp(- sm.init_printing(use_latex=True)
rho/2)*(r/a)**l*sm.sqrt(1/(a**3))
print(wave_generator())
I1=simplify(G*k*H*Q*(-m/np.abs(m))**(-
m)*(x+(m/np.abs(m))*1.j*y)**np.abs(m)*sm.sqr
t((x**2+y**2+z**2))**(-np.abs(m)))

print(f"Ψ({n},{l},{m})=")

display(simplify(I1))

I=simplify(G*k*H*Q*(sm.sqrt((1-
d**2)**(np.abs(m)))))

print(f"Ψ({n},{l},{m})**2=")

display(simplify(I**2))

EQ=lambdify((x,z,y,a),I,numpy)

y=1

a=0.529

x=np.linspace(-limit,limit,500)

z=np.linspace(-
limit,limit,500)[:,np.newaxis]

hi=np.abs((EQ(x,z,y,a)))

plt.imshow(hi**1,origin='lower',extent=[
-1,1,-1,1],cmap='hot')

#plt.imshow(hi**2,origin='lower',extent=
[-limit,limit,-limit,limit],cmap='hot')

plt.xlabel(f"({n},{l},{m})",fontsize=50)

plt.colorbar()

from numpy import *

import numpy

import numpy as np

from fractions import Fraction

import matplotlib.pyplot as plt

import sympy as sm

import math as mt

from sympy import *

#%matplotlib qt5

2523

You might also like