0% found this document useful (0 votes)
11 views2 pages

Untitled11 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Untitled11 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COULOMB POTENTIAL

November 14, 2024

[7]: import numpy as np


import matplotlib.pyplot as plt

def v(x):
return -e**2/x

# Parameters
hbar = 1973 # Reduced Planck's constant
m = 0.511e6 # Mass of the electron
e=3.795
x = np.linspace(1e-2, 10, 1000) # Spatial domain
d=x[1]-x[0]

#----------------------------------------------------
# Create potential matrix
v_matrix=v(x)
#---------------------------------------------------------
# Hamiltonian matrix initialization
n = len(x)
matrix = np.zeros((n-2, n-2))
constant = 2 * m * d**2 / hbar**2
for i in range(n-2):
if i > 0:
matrix[i, i-1] = -1 # Off-diagonal (lower)
matrix[i, i] = 2 + constant * v_matrix[i+1] # Diagonal
if i < n - 3:
matrix[i, i+1] = -1 # Off-diagonal (upper)

#----------------------------------------------------------------
# Solve the eigenvalue problem
eigen_value, eigen_vector = np.linalg.eigh(matrix)

#---------------------------------------------------------------------
# Plotting the first few eigenstates
plt.figure(figsize=(10,8))
for n in range(3): # Plotting first three states
value=eigen_vector.T[n] # Taking transpose of the matrix

1
value=np.insert(value,0,0) #inserting values at the boundary
value=np.append(value,0)
plt.plot(x, value, label=f'n={n}\n Energy eigen = {eigen_value[n]*hbar**2/
,→(2*m*d**2)}')

plt.title('Wavefunctions of the coulamb Oscillator')


plt.xlabel('Position (m)')
plt.ylabel('Wavefunction')
plt.legend()
plt.grid()
plt.show()

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy