Quit

<< NormalOrder1.m

A = CreationOperator["a"];
a = AnnihilationOperator["a"]; 
AntiCommutator[A, a] = 1; 
AntiCommutator[A[xa_], a[ya_]] = KroneckerDelta[xa, ya];
zr = Ket["0"];
zl = Conjugate[zr];
zl . zr ^= 1;
x = u + v*a[1] . a[2];
y = uu + vv*A[1] . A[2];

NormalOrder[z1 . y]

NormalOrder[a[1] . A[1]]

eq := a[k] . a[-k] . (u + v A[p] . A[-p])

FullSimplify[NormalOrder[eq]]

NormalOrder[a . A . a . a . A . a]

x = u + v*a[1] . a[2]

y = uu + vv*A[1] . A[2]

NormalOrder[x . x . x . x]

NormalOrder[zl . x]

NormalOrder[x . x . x . x . zr]

NormalOrder[
      NormalOrder[zl . x . x . y] . NormalOrder[y . x . zr]]

NormalOrder[ zl . v . (a[1] + u) . A[1] . zr]

NormalOrder[zl . x . x . x . x . zr]

NormalOrder[u^4  v^4]

NormalSimplify[
      Distribute[
        NormalOrder[zl . x . x . x . x] . 
          NormalOrder[x . x . x . x . zr]]]

l1 = 
      NormalOrder[NormalOrder[zl . x . x . x . x] . x . x . x . x]

r1 = 
      NormalOrder[x . x . x . x . NormalOrder[x . x . x . x . zr]]

NormalOrder[l1 . r1]