 Application Center - Maplesoft

# PX: A package for multiplication and commutation of quantum operators

You can switch back to the summary page by clicking here. Quantum Mechanics Worksheet

SLAC and Stanford University Software Notices:

Introduction

PX is a Maple package designed to implement non-commutative multiplication and commutation of quantum operators.  In particular it is designed to deal with systems with several degree of freedom satisfying the commutation relations of operators and their conjugate momenta; i.e., operators such as and ,  or alternatively their associated annihilation and creation operators and In what follows I will take A and Adag to be fundamental, satisfying the commutation relations Note that  I have implicitly adopted the particle physics convention of setting Planck's constant and the speed of light equal to 1.

The usefulness of this package is that it enables one to explicitly study how one derives the Heisenberg equations of motion for any operator by taking commutators of the operator with the Hamiltonian.  In this example worksheet I show how to use the package to work out the equations of motion for several simple Hamiltonians.  To see all of the things which can be done with the package read the help files.

 > with(PX)

Warning, inserted missing semicolon at end of statement

"running setup"    As you can see, when PX is loaded, using the command  with(PX) many functions are made available. This is done so that userscan make use of them to create their own specialized routines which improve upon the functionality of this package.  However, for most users there are only a few workhorse functions which will be used to define: the set of quantum operators, in particular which ones are momentum type operators and which are position type operators; to define the commutators of these momentum operators with the position operators; to define non-commuting products of the quantum operators; to compute the  commutators of more complicated operators; and finally, to bring complicated products of operators into a standard form so that apparently different expressions can be compared with one another.

The list of all quantum operators known to
PX is kept in a private list which can only be supplemented using the functions: addmomop() and addposop()   These functions add the arguments to the appropriate list of operators.  They also add their arguments to the list of all quantum operators known to PX during the computation.  The contents of the various lists can be displayed at any time using the commands listqops(), listmomops() and listposops().  These lists and their associated commutation relations can be initialized to be empty using the function clearqops().  One should avoid using the function addqops() to add entries to the list of all quantum operators directly.  The reason for this is adding an operator to the list of momentum operators or position operators already accomplishes this feat.

We divide the momentum operators and position operators into separate lists to avoid having to specify too many elementary commutation relations.  The algorithm implemented in the function
com() (which shouldn't be used directly) is that if both of its arguments are of type position operator, or both of its arguments are of type momentum operator, then their commutator vanishes.  Otherwise, their commutator is computed using the elementary user-defined commutation relations defined using the function addcom().

The operator
&X() is used to take the non-commuting product of any number of operators.  Having defined generic operators using &X() the commutator of any two operators us computed using Xcom() .  Bringing a general product of operators into a standard form is accomplished using the function porder().

Having made these general remarks let us see how to make use of these functions in practice.

Getting Started

When PX first loads there are two quantum operators known to the system.   To see what these operators are type

 > listqops(); To get a list of the momentum and position operators separately use the commands

 > mypositionops:=listposops(); mymomentumops:=listmomops();  To see what commutation relations have been defined for the basic operators just type

 > listcomms(); The basic commutation relations are stored in a Maple table.  Each entry in the table is and index pair and its value.
To store the table so as to refer to it in a more easily readable way simply type

 > listcomms(); To clear the initially defined operators and begin defining your own quantum problems simply type

 > clearqops(); Now check to see that everything has been properly reinitialized.

 > listqops();listmomops();listposops();

Let us now start to define a new set of quantum operators so that we can study the quantum Harmonic oscillator.  > listqops(); > listmomops(); > listposops(); Now let us check to see if any commutation relations have been defined.

 > listcomms();

Note that if nothing is defined  listcomms() doesn't return anything.  To add a basic commutation relation type Now type

 > listcomms(); At this point I haven't set Planck's constant to unity just to show I don't have to do so.  Let us now go on to define
the Hamiltonian for the system.

NOTE:  To define basic operators raised to a power it is best to explicitly multiply them together.  In this way
Xcom() will automatically know what to do with a power of an operator if the commutation relation with a single term is defined.  This is particularly useful for operators such as 1/x.
Thus, to define the Hamiltonian for a simple harmonic oscillator we type  NOTE:  we can check that these operators satisfy the correct commutation relations by using Xcom() and invoking identify() to eliminate the rounding caused by the fact that I am working to ten significant digits; i.e.,

 > Digits; > identify(Xcom(&X(x),&X(p))); identify(Xcom(&X(p),&X(x)));  The Hamiltonian of the oscillator is then define to be

 > H := &X(p,p)/2 + 1/2*omega^2*&X(x,x);  We can bring this Hamiltonian into the familiar normal ordered form using

 > H:=porder(H); In the Heisenberg representation of quantum mechanics the states of the system don't change, but the operators do change in time.  Since the time dependent for of an operator is obtained by applying the exponential of the Hamitonian; i.e. =   it follows that = [ , ]

i.e.

 > dxdt:= I*Xcom(H,x); NOTE:  For technical reasons having to do with the way I use this package numerical factors get converted to floating point numbers.  To get expressions involving only integer factors into a prettier form it is convenient to convert it back using.

 > dxdt:=factor(map(identify,expand(dxdt))); and then compare it to

 > p; Taking the second derivative we obtain Hamilton's equation of motion

 > d2xdt2:=I*Xcom(H,dxdt); which we can make prettier by

 > factor(map(identify,expand(d2xdt2))); which we recognize as the equation of motion for a harmonic oscillator

 > -omega^2*x; Now let us carry out the same manipulation for a more complicated Hamiltonian but without the annihilation and creation operators.  First let us get rid of all definitions

 > clearqops(); > x:='x':p:='p':

Now let's define x and p to be two non-commution operators.   Now define the potential

 > V:=&X(x,x,x,x)-2*f^2*&X(x,x) ; > H := &X(p,p)/2 + V; Note the use of &X(x) which is necessary to tell Xcom() that x is an operator, and not just the name of an operator.

 > dxdt := expand(I*Xcom(H,&X(x))); > dxdt:=identify(dxdt); Which, as before, we see is just p.  Now let us get the second derivative of x.

 > d2xdt2:=expand(I*Xcom(H,dxdt)); Finally, let us see how to bring a product of operators into a standard order with all momentum operators standing to the right of all position operators.  For example, consider the operator

 > O1 := &X(p,x); To bring this to standard order just

 > porder(O1); Now consider something more complicated

 > O2:=&X(p,x,p,x); > porder(O2); > O3:=&X(p,x,x,p,x,x,p); > porder(O3); >

Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities. 