snegold2newrules

◼ snegold2newrules[o, n, r] produces transformation rules from the old basis to the new basis, given a set of old operators o, a set of new operators n and a set of operator expressions for the new basis r.

◼ Operator c must be expressed in the stripped form, i.e. a form which excludes the first index (creation/annihilation) and the last index (spin).

◼ See also:

Further examples

Load sneg and declare some quantities

<< sneg`sneg`;
snegfermionoperators[c, d, e, o];

Transformation from local basis to even and odd combination of orbitals ("molecular orbitals")

rules = 
      snegold2newrules[{c[], d[]}, {e[], 
          o[]}, {(1/(Sqrt[2])) (c[] + d[]), (1/(Sqrt[2])) (c[] - 
                d[])}]
mkallrules[rules_] := 
        Join[
rules /. 
            f_?fermionQ[i___] -> f[CR, i, UP], 
rules /. 
            f_?fermionQ[i___] -> f[CR, i, DO], 
rules /. 
            f_?fermionQ[i___] -> f[AN, i, UP], 
rules /. 
            f_?fermionQ[i___] -> 
              f[AN, i, DO]
];
rules = mkallrules[rules]

Test the transformation on the two-site Hubbard model

H = 
      t hop[c[], d[]] + U/2 pow[number[c[]] - 1, 2] + 
        U/2 pow[number[d[]] - 1, 2]
H /. rules // Simplify