NF=2 NB=0 IndexDn={0} IndexUp={1} psi0=NewWavefunction(NF,NB,{{"10",1}}) psi1=NewWavefunction(NF,NB,{{"01",1}}) OppSx = NewOperator("Sx" ,NF,IndexUp,IndexDn) OppSy = NewOperator("Sy" ,NF,IndexUp,IndexDn) OppSz = NewOperator("Sz" ,NF,IndexUp,IndexDn) print("The expectation value of a single state") print(Braket(psi0,OppSz,psi0)) print("The expectation value of two states with a single state") print(Braket(psi0,OppSx,{psi0,psi1})) -- note that I made one list of length 3, the other of length 2 so that the order is clear print("The expectation value of a three states with two other states") print(Braket({psi0,psi1},OppSy,{psi0,psi1,psi1}))