      Subroutine kmixup (bn,bnf,rt,ait)
c *** see RH Landau, Program lpott, 1981
      Implicit  Real*8   (a-h,o-z)
      Dimension bn(16), bnf(16), t(28), rt(14), ait(14)
c
c     form partial wave decompositon of k+p, l+n ampli-
c     tudes. non flip sp,pp,pn ...etc p:proton,n: netron
c     code for bn,bnf
c     all for k plus
c     1 re s,p    2 im s,p    3 re s,n   4 im s,n
c     5 re p,p    6 im p,p    7 re p,n   8 im p,n
c     9 re d,p   10 im d,p   11 re d,n  12 im d,n
c     13re f,p  14 im f,p    15 re f,n   16 im f,n
c     spin non-flip
      Do 10 n=1,14
         nodd = 2*n-1
         neven = 2*n
         t(nodd) = rt(n)
         t(neven) = ait(n)
 10   Continue
      bn(1) = t(1)
      bn(2) = t(2)
      bn(3) = (t(1)+t(7))/2.
      bn(4) = (t(2)+t(8))/2.
      bn(5) = (2.*t(5))+t(3)
      bn(6) = 2.*t(6)+t(4)
      bn(7) = ((2.*t(5))+t(3)+(2.*t(11))+t(9))/2.
      bn(8) = ((2.*t(6))+t(4)+(2.*t(12))+t(10))/2.
      bn(9) = 3.*t(15)+2.*t(13)
      bn(10) = 3.*t(16)+2.*t(14)
      bn(11) = ((3.*t(15))+(2.*t(13))+(3.*t(21))+(2.*t(19)))/2.
      bn(12) = ((3.*t(16))+(2.*t(14))+(3.*t(22))+(2.*t(20)))/2.
      bn(13) = 3.*t(17)
      bn(14) = 3.*t(18)
      bn(15) = ((3.*t(17))+(3.*t(23)))/2.
      bn(16) = ((3.*t(18))+(3.*t(24)))/2.
c     spin flip same order as above
      bnf(1) = 0.
      bnf(2) = 0.
      bnf(3) = 0.
      bnf(4) = 0.
      bnf(5) = t(5)-t(3)
      bnf(6) = t(6)-t(4)
      bnf(7) = (t(5)-t(3)+t(11)-t(9))/2.
      bnf(8) = (t(6)-t(4)+t(12)-t(10))/2.
      bnf(9) = t(15)-t(13)
      bnf(10) = t(16)-t(14)
      bnf(11) = (t(15)-t(13)+t(21)-t(19))/2.
      bnf(12) = (t(16)-t(14)+t(22)-t(20))/2.
      bnf(13) = -t(17)
      bnf(14) = -t(18)
      bnf(15) = (-t(17)-t(23))/2.
      bnf(16) = (-t(18)-t(24))/2.
      Return
      End
