P-N junction with donor and acceptor encapsulated single-walled carbon nanotubes