# CoNTub

CoNTub is a software project written in Java which runs on Windows, Mac OS X, Linux and Unix Operating systems through any Java-enabled web browser. It is the first implementation of an algorithm for generating 3D structures of arbitrary carbon nanotube connections by means of the placement of non-hexagonal (pentagonal or heptagonal) rings, also referred as defects or disclinations.
The software is a set of tools dedicated to the construction of complex carbon nanotube structures for use in computational chemistry. CoNTub 1.0$^{[1]}$ was the first implementation for building these complex structures and included nanotube heterojunctions, while CoNTub 2.0$^{[2]}$ is mainly devoted to three-nanotube junctions. Its aim is to help in the design and research about new nanotube-based devices. CoNTub is based on the strip algebra, and is able to find the unique structure for connecting two specific and arbitrary carbon nanotubes and many of the possible three-tube junctions.
CoNTub generates the geometry of various types of nanotube junctions, i.e., nanotube heterojunctions and three-nanotube junctions, including also single-walled nanotubes (SWNTs) and multi-walled nanotubes (MWNTs).
Although the current version of CoNTub is v2.0, this version does not supersedes v1.0, as v2.0 is dedicated currently to only three-nanotube junctions, although the incorporation of v1.0 functionality into v.2.0 is planned. Nanotube heterojunctions can be generated only with v1.0.
CoNTub v1.0 is organized in five Tabbed panels CoNTub$^{[1]}$, the first three being dedicated to structure generation, the fourth to the output in PDB format, and the fifth contains a short help section.
CoNTub v2.0 has experimented a major redesign, and the panes have been removed, instead, a conventional menubar has been added where the type of structure to be generated can be chosen. Although the menu item for heterojunction generation appears in the menu, the button is disabled, so NTHJ's can be only generated with v1.0

## Features

* 3D molecular viewer
* Structure generation of carbon nanotube Heterojunctions from indices(i,j) and length (l) of the two nanotubes.
* Structure generation of single-walled nanotubes (SWNTs) from indices(i,j) and length (l)
* Structure generation of symmetric Three-nanotube junctions (TNJ) selected from a list of possibilities, given the indices of the joined nanotubes.
* Plotting the electronic band structure and density of states (DOS) for single-walled nanotubes (SWNTs)
* Structure generation of multi-walled nanotubes from indices(i,j) and length (l), number of shells(N) and spacing(S).
* Output the xyz coordinates of the structures in a (PDB) file format

## Nanotube generation

To generate a SWNT, it is only necessary to introduce the indices of the tube, its desired length (Angstrom), and the type of atom for termination of dangling bonds. ConTub displays the resulting nanotube, as well as its electronic band structure and density of states (DOS), following a tight binding model.
MWNT - multiple tubes with the same axis and length - are created by providing the indices of the most inner tube (i,j), the desired length (l), the number of shells (N), and the approximate distance between shells or spacing (S) in Angstrom. The default value for spacing corresponds to the standard distance between layers in crystalline graphite (3.4 Å). ConTub automatically selects the indices of the remaining tubes, trying to adjust the interlayer spacing, and tries to use tubes with the same chirality as that of the inner nanotube.

## Heterojunction generation

This is the core of the CoNTub$^{[1]}$ program. Strip algebra was implemented, which allows two perfect carbon nanotubes to be joined, independently of their geometry, radius or chirality, with the simplest geometry possible, i.e. with the lowest number of non-hexagonal rings (a pentagon and a heptagon), also called defects or disclinations. There is always a possible connection between two tubes and strip algebra ensues that the solution is unique and depending only of the indices (i,j) of both tubes.

## C$_3$ Symmetric Three-Nanotube Junction generation

A further implementation of the Strip Algebra has been released in the second version of CoNTub, in order to elucidate the precise location of atoms and rings that lead to a junction of three nanotubes.
Connection between three nanotubes requires, at least, the presence of six heptagons, instead of the single pentagon and heptagon required for an heterojunction. In this case, the set of equations that rule the geometry has more variables to solve than restrictions, so the possible geometries constitute an infinite set. The detailed procedure for the nanotube construction has been also published,
Imposing additional restrictions to the geometry can ease the finding of viable geometries, and this is what is applied in the current version of CoNTub: Forcing the tubes connected to be of the same kind, and forcing an additional C$_3$ symmetry, an automated way to construct the geometry can be found. However, even with these restrictions, the possibilities are still infinite. Therefore, a way to estimate the viability of the junction, even before constructing it, had to be developed. Given that non-hexagonal rings

## Image gallery

* CoNTub v1.0 - 3D viewer panel (zoom in).
* CoNTub v1.0 - 3D viewer panel (cutback and ball&stick modes).
* CoNTub v1.0 HETEROJUNTION panel.
* CoNTub v1.0 HETEROJUNTION panel.
* CoNTub v1.0 SWNT panel.
* CoNTub v1.0 SWNT panel.
* CoNTub v1.0 MWNT panel.
* CoNTub v1.0 output panel.