Usually, the potential energy curve means the total energy of a system with respect to a distance, e.g. the distance between two nanotubes in your case. In other word, the term of "potential energy" is improperly used in your question.
To obtain the interaction energy between two capped CNTs, one may follow the procedure used to calculate the total energy of O2 as a function of the distance between two O atoms:
i) assume that the distance between two capped CNTs is d;
ii) calculate the total energies (E_tot) of two capped CNTs with different values of d;
iii) calculate the total energies of each capped CNTs, separately. assume that they are E_tot(1) and E_tot(2), respectively;
iii) from the minimum energy (E_min) in the curve of E_tot vs d, the interaction energy will be E_min - E_tot(1) - E_tot(2).