Magnetic field effects in carbon nanotubes