Akm[k_,m_]:=Piecewise[{{A[0, 0], k == 0 && m == 0}, {-A[1, 1], k == 1 && m == -1}, {A[1, 1], k == 1 && m == 1}, {A[2, 2], k == 2 && (m == -2 || m == 2)}, {I*B[2, 1], k == 2 && (m == -1 || m == 1)}, {A[2, 0], k == 2 && m == 0}, {-A[3, 3], k == 3 && m == -3}, {(-I)*B[3, 2], k == 3 && m == -2}, {-A[3, 1], k == 3 && m == -1}, {A[3, 1], k == 3 && m == 1}, {I*B[3, 2], k == 3 && m == 2}, {A[3, 3], k == 3 && m == 3}, {A[4, 4], k == 4 && (m == -4 || m == 4)}, {I*B[4, 3], k == 4 && (m == -3 || m == 3)}, {A[4, 2], k == 4 && (m == -2 || m == 2)}, {I*B[4, 1], k == 4 && (m == -1 || m == 1)}, {A[4, 0], k == 4 && m == 0}, {-A[5, 5], k == 5 && m == -5}, {(-I)*B[5, 4], k == 5 && m == -4}, {-A[5, 3], k == 5 && m == -3}, {(-I)*B[5, 2], k == 5 && m == -2}, {-A[5, 1], k == 5 && m == -1}, {A[5, 1], k == 5 && m == 1}, {I*B[5, 2], k == 5 && m == 2}, {A[5, 3], k == 5 && m == 3}, {I*B[5, 4], k == 5 && m == 4}, {A[5, 5], k == 5 && m == 5}, {A[6, 6], k == 6 && (m == -6 || m == 6)}, {I*B[6, 5], k == 6 && (m == -5 || m == 5)}, {A[6, 4], k == 6 && (m == -4 || m == 4)}, {I*B[6, 3], k == 6 && (m == -3 || m == 3)}, {A[6, 2], k == 6 && (m == -2 || m == 2)}, {I*B[6, 1], k == 6 && (m == -1 || m == 1)}, {A[6, 0], k == 6 && m == 0}}, 0]