Preliminary abstract (edited Tex version) submitted to Nordic MATLAB Conference 1995
Applications of Matlab to Problems in Quantum Mechanics
for Research and Education: Dirac Notation Interpreter
Ladislav Kocbach
Department of Physics, University of Bergen
Allégaten 55, N-5007 Bergen, Norway
KEYWORDS: Physics, Education, Quantum Mechanics, Command Interpreter
This contribution describes applications of Matlab to quantum mechanical problems, formulated in terms of matrices. A special feature of general interest is a demonstration that one can quite easily write small specialized command interpreters using Matlab's character-string functions and the command eval to execute the standard Matlab operations. In this abstract, mostly the educational aspect of the work is presented.
A whole large class of quantum mechanical problems leads to matrix formulations; this particular work is related to theory of atomic collisions, but similar problems are found in parts of nuclear physics, optical physics, quantum chemistry etc. We have used Matlab for analysis of the problems with non-orthogonal basis. In course of this work, an idea emerged to write a simple interpreter enabling us to enter the statements in easier understandable form. Further development of these ideas resulted in a small package suitable for teaching quantum mechanics.
Main part of this abstract will is used to describe this package. The interpreter can be easily extended and adapted to other problems, for example to define vectors with vectors as elements (indexed vectors) or multidimensional arrays.
Time-dependent Schrödinger equation for description of atomic collisions.
The matrix formulation of this problem arises from expansion of the unknown electron wavefunction in a set of basis functions, much in analogy with Fourier series or expansions using orthogonal polynomials. The unknown quantities to be found are the expansion coefficients, which form a vector. In this formulation, the time-dependent Schrödinger equation is replaced by a set of coupled differential equations, which are conveniently expressed in matrix notation. Normaly, the basis functions would be orthonormal. In many of the the physical problems we study, the natural sets of basis functions are not orthogonal. There are currently several possible approaches to this problem, using matrix inversion or pre-orthogonalization of the basis set. Matlab has proven to be a very useful tool for debugging the FORTRAN-based codes and in particular, to analyze the actual conceptual problems. The details of these applications can be found e.g. in ref. 1.
Dirac Notation.
Dirac's formulation of Quantum Mechanics is based on abstract Hilbert space, which in matrix formulation leads to a set of simple replacements rules.
An abstract operator
is replaced by a matrix
and
the abstract vector
by a column vector
,
so that
e.g. an eigenvalue equation is written in Dirac notation as
stands for the following matrix expression
The scalar product in Dirac notation
is replaced in matrix notation by
The most special type of Dirac notation, the so called
general matrix element
stands for
The mathematical and physical basis of the Dirac formalism is
explained in many texts on Quantum Mechanics, e.g. in ref. 2.
The Dirac interpreter enables the user to enter the Dirac expressions
and have them evaluated by normal Matlab matrix operations. We have chosen
to show the corresponding Matlab expression before evaluation.
Having declared and defined
and
as two dimensional
vectors, we can enter e.g. linear combinations and even assignments
(the constants are
)
Dirac : |a> Matlab: --> a a = 1 0 Dirac : |b> Matlab: --> b b = 0 1 Dirac : |c> = c1 |a> + c2|b> Matlab: --> c=c1*a+c2*b c = 0.8000 0.6000 Dirac : |d> = c2 |a> - c1|b> Matlab: --> d=c2*a-c1*b d = 0.6000 -0.8000 Dirac : <c|d> Matlab: --> (c)'*d ans = 0 Dirac : <c|c> Matlab: --> (c)'*c ans = 1Projection operators are are often a difficult topic. In Dirac notation, using
Dirac : | b > < b | Matlab: --> b*(b)' ans = 0 0 0 1We can e.g. easily demonstrate that
Dirac : ( | b > < b | )( | b > < b | ) Matlab: --> (b*(b)')*(b*(b)') ans = 0 0 0 1 Dirac : | b > < b| b > < b | Matlab: --> b*(b)'*b*(b)' ans = 0 0 0 1For teaching and demonstration purposes the standard Matlab output is not always suitable.
At present, we are thus also working with formatting routines, as an
example this is a printout of a matrix
(2. ; 0. ; 0. ) (0. ; 1. ; 1.+ 1.i ) (0. ; 1.- 1.i ; -1. )The applications to teaching and demonstrations are countless. It should be also mentioned that the interpreter understands the exponential of a matrix (replaces exp() by expm() ),
The files and documentation can be found in the World Wide Web at the address http://www.fi.uib.no/AMOS/matlab/
References
1. J. P. Hansen and K. Taulbjerg, Comp.Phys.Communications 51,317 (1988)
A preorthonormalization procedure for coupled channel problems
2. E. Merzbacher: Quantum Mechanics (Wiley International Edition)