kill(all)$

maxima : prefix operator, schrodinger equation in 1D ,version 1.0
peter.vlasschaert@gmail.com, 26/05/2022

easy to read : chemist ,engineers, others.

ref : Quantum chemistry (Donald A McQuarrie)
→ The Energy of a particle in a Box is Quantized :(pg : 77-87)
--------------------------------------------------------------------------
rem : all important math explained in the book.
--------------------------------------------------------------------------

→ learning curve : How to impliment the prefix operator (Maxima).

load :packages
-----------------

load(lrats)$

option values :
-----------------

ratprint : false$

study example : quantum chemistry

→ declaration : values

declare([n,L],[integer,real])$

given wave function : computation of the discrete energy level
--------------------------------------------------------------------------

p1:ψ(x):=abs(A)*sin(n*π*x/L);

assume(L>0,n>0,A>0);

→ integration : domain space (-∞,+∞) for given wave function (=ψ(x)).

p2:'integrate((ψ(x))^2,x,-inf,inf) = limit(integrate((ψ(x))^2,x,-L,L),L,a);

rem : ψ(x) = a1+i*b1  , complex conjugate : ψ*(x) = a1-i*b1
→ ψ(x)*ψ*(x) =( a1+i*b1)*(a1-i*b1) =a1^2+b1^2
first : * = multiplication , second: * conjugate

normalization: wave function over domain space (=1D)
------------------------------------------------------------------
[-L,L] value: L = a

p2a:rhs(p2) =1;

→ find : A

p3:solve([p2a],A);

→ subst : A into p1

: normalized "wave function"

p4:subst([p3[2],L=a],p1);

→ schrodinger equation:
rem : %i = sqrt(-1) , above math : i

first step : momentum operator:

assume(m>0); /*m =mass*/

p5:p(fu):=-%i*h/(2*π)*diff(fu,x);

prefix("p");

p(p ψ(x));

second step: potential operator :w
v = pontential

p6:w(fu):=v*fu;

prefix("w");

thrid step : H*ψ =E*ψ,time independent schrodinger eq. 1D

→ Hamiltonian operator: combination (p & w :operator)
m = mass
classical mechanics : 
H =1/2*m*vel^2+ v = kinetic energy + potential energy
p = momentum = m*vel 
-------------------------------------------------------------------
units :SI 
vel = velocity   (m/s)
m   = mass        (kg)
v    = potential  (Joule)
-------------------------------------------------------------------

depends(v,x);

definition : H with prefix operators inside.
                   fu : wave function.

p7:H(fu) := 1/(2*m)*p(p fu) + w fu;

→ kinetic operator (=1/(2*m)*p^2) + potential operator(=v)

H(ψ(x));

prefix("H");

→ H*ψ (lhs)

p8:H ψ(x);

→ E*ψ (rhs)

p9:E*ψ(x);

→ H*ψ =E*ψ

p10:p8=p9;

p11:ratsimp(subst([p3[2]],p10)/sin((%pi*n*x)/L));

→ solve :E

p12:solve(p11,E);

→ superposition of energy levels above the potential.

p12a:expand(p12);

set : potential to zero level (v=0),reference (sytem)

p13:subst([L=a,v=0],p12)[1];

p14:C=ratcoeff(rhs(p13),n^2);

values inside C are fixed.

E[n]= discrete energy values for n=integer (=energy levels).

p15:lratsubst([E=E[n],reverse(p14)],p13);

------------------------------------------------------------