NORMALIZATION

 !Program name: NORMALIZATION

real :: a, b, c, s, norm

integer::i

real, dimension (3):: psi, Npsi, P, Npsi2

 

func(a,b,c)=1./sqrt(sum(abs(psi)**2))

norm (a,b,c) = dot_product (psi, psi)

 

 

print *, "For the state vector aUx+bUy+cUz, give the values of a, b and c:"

read *, a, b, c

psi=[a,b,c]

Print *, psi

 

 

Npsi=func(a,b,c)*psi

P=abs(func(a,b,c)*psi)**2

Npsi2=psi/sqrt(norm(a,b,c))

 

Print *, "The normalization constant is:", func(a,b,c)

Print *, "The normalized state vector is:", Npsi, Npsi2

Print *, "The probability is:", P

s=P(1)+P(2)+P(3)

print *, s

stop

end

Comentários

Postagens mais visitadas deste blog

HYDROGEN-RADIAL

HYDROGEN-POTENTIAL

ONE_PART_QHO