restart; Digits:=14:# Completeness Relation - how much is complete?# we look at a subset of states -> how much do they contribute towards unity in add(|n><n|, n=1..N)?# How do we approach the question?# think about powers of operators -> take their matrix representation, compare that against direct calculations.# Use A=-I*d/dx, and A^2=-d/dx^2 as an operator example, and a subset of the harmonic oscillator states.with(orthopoly);w:=0.75;alpha:=sqrt(w);phi:=n->exp(-0.5*(alpha*x)^2)*H(n,alpha*x);NI:=n->int(phi(n)^2,x=-infinity..infinity);NI(0);NT:=[seq(1/sqrt(NI(n)),n=0..99)]:# Now we have to pick some states |mu> and |nu>, which will be used to define the A^2 matrix element.# For simplicity we will choose as reference states harmonic oscillator eigenstates with some other oscillator constant:beta:=0.5;psi:=n->exp(-0.5*(beta*x)^2)*H(n,beta*x);NIb:=n->int(psi(n)^2,x=-infinity..infinity);n1:=0: n2:=2:NC1:=1/sqrt(NIb(n1));NC2:=1/sqrt(NIb(n2));ME:=-NC1*NC2*int(psi(n1)*diff(psi(n2),x$2),x=-infinity..infinity);# Now let us see how we get this by inserting a completeness relation (however, a truncated one!)# WE COMPUTE THE FIRST ME by ACTING with -I*diff on the bra, so we change it to +I*diff !ME1:=n->I*NC1*NT[n+1]*int(phi(n)*diff(psi(n1),x),x=-infinity..infinity);ME1(0); # derivative of an even function is odd !ME1(1);ME2:=n->-I*NC2*NT[n+1]*int(phi(n)*diff(psi(n2),x),x=-infinity..infinity);ME2(1);ME_tr:=N->add(ME1(n)*ME2(n),n=0..N);ME_tr(0);ME_tr(1);ME_tr(2);ME_tr(3);ME_tr_T:=[seq(ME_tr(n),n=0..30)]:plot([seq([j-1,ME_tr_T[j]],j=1..31)]);ME_tr_T[10],ME;ME_tr_T[20],ME;ME_tr_T[30],ME;# Exercises:# change the states |mu> and |nu>. For example: decrease their beta, so that they are more delocalized. Then repeat the convergence analysis.## Change the states |mu> and |nu> by choosing different n1 and n2, then repeat the convergence analysis.# This is sending the message: a truncated completeness relation -> there is no universal statement possible as to what happens when N is xx or yy.