braketvc

◼ braketvc[a, op, b] computes the braket ⟨a|op|b⟩, where op is an operator expression, while a and b are some states in the occupation number representation.
◼ braketop[a, op, b] computes the braket ⟨a|op|b⟩, where op is an operator expression, while a and b are some states in the creation operator representation.
◼ expvvc[op, a] computes the braket ⟨a|op|a⟩, where op is an operator expression, while a is a state in the occupation number representation.
◼ expvop[op, a] computes the braket ⟨a|op|a⟩, where op is an operator expression, while a is a state in the creation operator representation.

◼ See also: matrixrepresentationop, matrixrepresentationvc, ap, vc, vacuum, makebasis.

Further examples

Load sneg and declare c to be a fermionic operator

<< sneg`sneg`;
snegfermionoperators[c];
snegrealconstants[U, t, ϵ];

Two-site Hubbard Hamiltonian

n = 2;
H = hamiltonian[Hubbard, c[], n, U, t, ϵ]

Construct a basis with well defined (Q, (Subscript[S, z])) quantum numbers

ops = Table[c[i], {i, n}];
makebasis[ops];
bz = qszbasisvc[ops];
MatrixForm[bz]

Construct the Hamiltonian matrices in all subspaces.

matvc = makematricesbzvc[H, bz];
MatrixForm@
      Map[{First[#], 
            MatrixForm[#[[2]]]} &, 
        matvc]

Custom simplification function .  Note the use ofmaskOpto runFullSimplifyto simplify the expressions.

mysimplify[expr__] := 
        maskOp[FullSimplify, expr, 
          Assumptions -> {U > 0, t > 0}];

Diagonalize the Hamiltonian in (Q = 0, (Subscript[S, z])=0) subspace

mat = Select[matvc, 
            First[#] == {0, 0} &][[1, 
          2]];

    {val, vec} = maskOp[Eigensystem, mat];

    MatrixForm[val]   

    

    basis00 = Select[bz, 
            First[#] == {0, 0} &][[1, 
          2]];

    vec = Map[basis00 . # &, vec];

    MatrixForm[vec]   

    

    vec = Map[mysimplify[#/normvc[#]] &, vec];

    MatrixForm[vec]

Check orthonormality of the eigenvectors (brakets with the identity operator)

Outer[Simplify@braketvc[#1, 1, #2] &, vec, vec] // 
      MatrixForm

Hamiltonian in the eigenbasis.

Outer[mysimplify[braketvc[#1, H, #2]] &, vec, vec] // 
      MatrixForm

Spin-spin correlation operator in the eigenbasis.

s1s2 = spinspin[c[1], c[2]]
mats1s2 = 
        Outer[mysimplify[braketvc[#1, s1s2, #2]] &, vec, 
          vec];
mats1s2 // MatrixForm

Spin-spin correlation matrix in the t->0 (decoupled sites) limit

maskOp[Limit, mats1s2, t -> 0] // MatrixForm

Orbital pseudo-spin (z component) in the eigenbasis

ch12 = number[c[1]] - number[c[2]]
match12 = 
        Outer[mysimplify[braketvc[#1, ch12, #2]] &, vec, 
          vec];
match12 // MatrixForm
maskOp[Limit, match12, t -> 0] // MatrixForm