An attempt to use the NCAlgebra package (non-commutative algebra) to calculate the commutators of the charge operators for the Left and Right currents of Hw2 problem II.6.  Did not work.

(*Import["https://raw.githubusercontent.com/NCAlgebra/NC/master/NCExtras/NCWebInstall.m"];*)
<< NC`
<< NCAlgebra`

ClearAll[mdot, Hx, Hdaggerx, Hdotx, Hdotdaggerx, Hy, Hdaggery, Hdoty, Hdotdaggery, qLx, qRx,qLy,qRy, display,displaym, a, b, c, d, x, y, phi1x, phi2x, pi1x, pi2x,phi1y, phi2y, pi1y, pi2y, phi1xConjugate,pi1xConjugate,phi1yConjugate,pi1yConjugate,phi2xConjugate,pi2xConjugate,phi2yConjugate,pi2yConjugate, conj, nonconj, ones, twos]

nonconj:={phi1x,pi1x,phi1y,pi1y,phi2x,pi2x,phi2y,pi2y};
conj:={phi1xConjugate,pi1xConjugate,phi1yConjugate,pi1yConjugate,phi2xConjugate,pi2xConjugate,phi2yConjugate,pi2yConjugate};
ones:={phi1x,pi1x,phi1y,pi1y,phi1xConjugate,pi1xConjugate,phi1yConjugate,pi1yConjugate};
twos:={phi2x,pi2x,phi2y,pi2y,phi2xConjugate,pi2xConjugate,phi2yConjugate,pi2yConjugate};

SetNonCommutative[phi1x,phi2x,pi1x,pi2x,phi1y,phi2y,pi1y,pi2y,phi1xConjugate,phi2xConjugate,pi1xConjugate,pi2xConjugate,phi1yConjugate,phi2yConjugate,pi1yConjugate,pi2yConjugate];
(*Table[SetCommutingOperators[conj[[i]],nonconj[[j]]],{i,1,1}, {j,1,1}];
Table[SetCommutingOperators[ones[[i]],twos[[j]]],{i,1,8}, {j,1,8}];
*)
(*SetCommutingOperators[phi1x,phi1y];
SetCommutingOperators[pi1x,pi1y];
SetCommutingOperators[phi2x,phi2y];
SetCommutingOperators[pi2x,pi2y];
SetCommutingOperators[phi1xConjugate,phi1yConjugate];
SetCommutingOperators[pi1xConjugate,pi1yConjugate];
SetCommutingOperators[phi2xConjugate,phi2yConjugate];
SetCommutingOperators[pi2xConjugate,pi2yConjugate];*)



mdot[a_, b_] := Inner[NonCommutativeMultiply,a,b,Plus];

Hx:=(1/Sqrt[2]) {{phi2xConjugate,phi1x},{-phi1xConjugate,phi2x}};
Hdaggerx:=(1/Sqrt[2]) {{phi2x,phi1xConjugate},{-phi1x,phi2xConjugate}} // Transpose;
Hdotx:=(1/Sqrt[2]) {{pi2xConjugate,pi1x},{-pi1xConjugate,pi2x}};
Hdotdaggerx:=(1/Sqrt[2]) {{pi2x,pi1xConjugate},{-pi1x,pi2xConjugate}} // Transpose;


Hy:=(1/Sqrt[2]) {{phi2yConjugate,phi1y},{-phi1yConjugate,phi2y}};
Hdaggery:=(1/Sqrt[2]) {{phi2y,phi1yConjugate},{-phi1y,phi2yConjugate}}//Transpose;
Hdoty:=(1/Sqrt[2]) {{pi2yConjugate,pi1y},{-pi1yConjugate,pi2y}};
Hdotdaggery:=(1/Sqrt[2]) {{pi2y,pi1yConjugate},{-pi1y,pi2yConjugate}}//Transpose;

display[v_] := ((v /. {
phi1x -> (Subscript[ϕ, 1])[x], phi2x -> (Subscript[ϕ, 2])[x], pi1x -> (Subscript[π, 1])[x], pi2x -> (Subscript[π, 2])[x],
phi1y -> (Subscript[ϕ, 1])[y], phi2y -> (Subscript[ϕ, 2])[y], pi1y -> (Subscript[π, 1])[y], pi2y -> (Subscript[π, 2])[y],
phi1xConjugate->Conjugate[Subscript[ϕ,1][x]],phi2xConjugate->Conjugate[Subscript[ϕ,2][x]],pi1xConjugate->Conjugate[Subscript[π,1][x]],pi2xConjugate->Conjugate[Subscript[π,2][x]],phi1yConjugate->Conjugate[Subscript[ϕ,1][y]],phi2yConjugate->Conjugate[Subscript[ϕ,2][y]],pi1yConjugate->Conjugate[Subscript[π,1][y]],pi2yConjugate->Conjugate[Subscript[π,2][y]]
}) )// TraditionalForm ;
displaym[m_] := MatrixForm[ m ] //display ;


qLx[a_]:=(I/2) Tr[mdot[Hdotdaggerx.PauliMatrix[a],Hx]-mdot[Hdaggerx.PauliMatrix[a],Hdotx]];
qRx[a_]:=(I/2) Tr[mdot[Hdotx.PauliMatrix[a],Hdaggerx]-mdot[Hx.PauliMatrix[a],Hdotdaggerx]];

qLy[a_]:=(I/2) Tr[mdot[Hdotdaggery.PauliMatrix[a],Hy]-mdot[Hdaggery.PauliMatrix[a],Hdoty]];
qRy[a_]:=(I/2) Tr[mdot[Hdoty.PauliMatrix[a],Hdaggery]-mdot[Hy.PauliMatrix[a],Hdotdaggery]];

(*mdot[Hdotdaggerx.PauliMatrix[1],Hx]// display
mdot[Hdaggerx.PauliMatrix[1],Hdotx] // display*)

Grid[{{Hx // displaym,
Hdaggerx // displaym,
Hdotx // displaym,
Hdotdaggerx // displaym},
{Hy // displaym,
Hdaggery // displaym,
Hdoty // displaym,
Hdotdaggery // displaym}}]

qLx[1] // display
qLx[2] // display
qLx[3] // display
qRy[1] // display
qRy[2] // display
qRy[3] // display

Here’s the commutators of the integrands of the (Q^(L,a)) and (Q^(R,b)) charge operators:

Table[(qLx[i] ** qRy[j] -qRy[j] ** qLx[i] ) // display,{i,1,3},{j,1,3}]// Grid

(*https://mathematica.stackexchange.com/a/110275/10*)
(*ClearAll[ExpandNCM];
ExpandNCM[expr_]:=expr/.{(h:NonCommutativeMultiply)[a___,b_Plus,c___]:>Distribute[h[a,b,c],Plus,h,Plus,ExpandNCM@*h],(h:NonCommutativeMultiply)[a___,b_Times,c___]:>Most[b] ExpandNCM[h[a,Last[b],c]]};*)
(*NC`SetNonCommutative[phi1x, phi2x, pi1x, pi2x,phi1y, phi2y, pi1y, pi2y]*)