schrodinger.application.matsci.nano.tube module

Classes and functions for building single- and multi-walled nanotubes.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.nano.tube.CheckInput

Bases: schrodinger.application.matsci.nano.check.CheckInput

Check user input.

checkAll(element1, element2, bondlength, nindex, mindex, ncells, no_double_bonds, termfrag, min_term_frags, up_to_nindex, up_to_mindex, nwalls, wallsep, logger=None, is_coarse_grain=False)

Manage all checks.

Parameters
  • element1 (str) – elemental symbol of the first atom

  • element2 (str) – elemental symbol of the second atom

  • bondlength (float) – bond length between the first and second atoms in Angstrom

  • nindex (int) – first chiral index

  • mindex (int) – second chiral index

  • ncells (int) – number of unit cells

  • no_double_bonds (bool) – disable the formation of double bonds

  • termfrag (str) – terminate the lattice with a given fragment

  • min_term_frags (bool) – minimize the geometry of terminating fragments

  • up_to_nindex (bool) – enumerate nanotube structures on the n-index

  • up_to_mindex (bool) – enumerate nanotube structures on the m-index

  • nwalls (int) – number of walls in a multi-wall nanotube

  • wallsep (float) – wall separation in Angstrom for a multi-wall nanotube

  • logger (logging.getLogger) – output logger

  • is_coarse_grain (bool) – Whether a coarse grain structure is being created

class schrodinger.application.matsci.nano.tube.Rectangle(origin, bottom, left, end)

Bases: object

Manage the properties of a rectangle.

INSIDETHRESH = 1e-05
__init__(origin, bottom, left, end)

Create an instance.

Parameters
  • origin (numpy.array) – lower left point

  • bottom (numpy.array) – lower right point

  • left (numpy.array) – upper left point

  • end (numpy.array) – upper right point

linear_equation(ixy, fxy, x)

Return y = m*x + b for m and b from the line formed by initial point ixy and final point fxy.

Parameters
  • ixy (numpy.array) – initial point on line

  • fxy (numpy.array) – final point on line

  • x (float) – domain argument

Return type

float

Returns

y, range value

insideRectangle(xy, logger=None)

Return boolean specifying if the provided plane coordinates lie within the boundary.

Parameters
  • xy (numpy.array) – plane coordinates

  • logger (logging.getLogger) – output logger

Return type

bool, bool

Returns

insidex, insidey, inside the x-boundary or not, same for y-boundary

class schrodinger.application.matsci.nano.tube.NanoSheet(nanotube_sheet_obj)

Bases: object

Create a sheet.HoneycombLattice that is large enough so that the nanotube sheet can be cut out from it.

ANGLEMEDIUM = 1.0471975511965976
__init__(nanotube_sheet_obj)

Create an instance.

Parameters

nanotube_sheet_obj (NanoTubeSheet) – contains parameters of the nanotube sheet

defineVectors()

Define HoneycombLattice and NanoTubeSheet lattice, etc. vectors.

Return type

numpy.array, numpy.array

Returns

lattvec1, lattvec2, the HoneycombLattice lattice vectors

getGrowParams(lattvec1, lattvec2)

Get HoneycombLattice grow parameters.

Parameters
  • lattvec1 (numpy.array) – lattice vector 1

  • lattvec2 (numpy.array) – lattice vector 2

Return type

float, numpy.array, float, numpy.array

Returns

grow1len, grow1unit, grow2len, grow2unit, the lengths and unit vectors of the grow vectors

changeBasis(grow1unit, grow2unit)

Change the basis of the NanoTubeSheet to that of the NanoSheet.

Parameters
  • grow1unit (numpy.array) – unit vector of first grow vector

  • grow2unit (numpy.array) – unit vector of second grow vector

Return type

float, float

Returns

coef1, coef2, coefficients of the end vector in the grow basis

defineDimensions(coef1, grow1len, coef2, grow2len)

Define the dimensions of the NanoSheet.

Parameters
  • coef1 (float) – coefficient of end vector on first grow vector

  • grow1len (float) – length of first grow vector

  • coef2 (float) – coefficient of end vector on second grow vector

  • grow2len (float) – length of second grow vector

rotateNanoSheet()

Rotate the nanosheet so that lattice edge 1 is along the x-axis.

getNanoSheet(logger=None)

Get the sheet.HoneycombLattice from which the nanotube sheet will be cut.

Parameters

logger (logging.getLogger) – output logger

class schrodinger.application.matsci.nano.tube.NanoTubeSheet(element1, element2, bondlength, nindex, mindex, ncells, is_coarse_grain)

Bases: object

Preprocess a nanosheet into a nanotube sheet which will be rolled up into a nanotube.

ZEROVEC = array([0., 0.])
__init__(element1, element2, bondlength, nindex, mindex, ncells, is_coarse_grain)

Create an instance.

Parameters
  • element1 (str) – elemental symbol of the first atom

  • element2 (str) – elemental symbol of the second atom

  • bondlength (float) – bond length between the first and second atoms in Angstrom

  • nindex (int) – first chiral index

  • mindex (int) – second chiral index

  • ncells (int) – number of unit cells

  • is_coarse_grain (bool) – Whether a coarse grain structure is being created

static redefineLatticeVecs(lattvec1, lattvec2)

Redefine lattice vectors according to Dresselhaus.

Parameters
  • lattvec1 (numpy.array) – first lattice vector

  • lattvec2 (numpy.array) – second lattice vector

Return type

numpy.array, numpy.array

Returns

nlattvec1, nlattvec2, first and second lattice vectors redefined

renumberAtomLists(renumbermap)

Apply the given renumbering map to the terminating and matching atom lists.

Parameters

renumbermap (dict) – maps old indicies into new indicies

cutOutNanoSheet(logger=None)

Cut out the nanotube sheet from the nanosheet.

Parameters

logger (logging.getLogger) – output logger

delDanglingTermAtoms()

Remove dangling atoms from the top and bottom of the nanotube sheet.

delZigZagMatchAtoms(logger=None)

Remove overlapping match atoms for the zigzag case.

Parameters

logger (logging.getLogger) – output logger

delChiralMatchAtoms(logger=None)

Remove overlapping match atoms for the chiral case.

Parameters

logger (logging.getLogger) – output logger

buildNanoTubeSheet(termfrag, use_finite_bos=True, logger=None)

Build the nanotube sheet.

Parameters
  • termfrag (str) – terminate the lattice with a given fragment

  • use_finite_bos (bool) – use a bond order protocol meant for finite molecules

  • logger (logging.getLogger) – output logger

class schrodinger.application.matsci.nano.tube.NanoTube(element1, element2, bondlength, no_double_bonds, nindex, mindex, ncells, termfrag, min_term_frags, is_coarse_grain)

Bases: object

Create a nanotube by rolling up a nanotube sheet.

TITLEKEY = 's_m_title'
ENTRYKEY = 's_m_entry_name'
TITLENAME = 'nanotube'
NINDEX = 'i_matsci_N_Index'
MINDEX = 'i_matsci_M_Index'
NCELLS = 'i_matsci_N_Cells'
RADIUS = 'r_matsci_Radius/Ang.'
LENGTH = 'r_matsci_Length/Ang.'
MSGWIDTH = 50
NUMDECIMAL = 3
__init__(element1, element2, bondlength, no_double_bonds, nindex, mindex, ncells, termfrag, min_term_frags, is_coarse_grain)

Create an instance.

Parameters
  • element1 (str) – elemental symbol of the first atom

  • element2 (str) – elemental symbol of the second atom

  • bondlength (float) – bond length between the first and second atoms in Angstrom

  • no_double_bonds (bool) – disable the formation of double bonds

  • nindex (int) – first chiral index

  • mindex (int) – second chiral index

  • ncells (int) – number of unit cells

  • termfrag (str) – terminate the lattice with a given fragment

  • min_term_frags (bool) – minimize the geometry of terminating fragments

  • is_coarse_grain (bool) – Whether a coarse grain structure is being created

getChiralAngle(logger=None)

Determine the chiral angle of the tube in degrees where the chiral angle is angle(lattvec1, chiral) and is in [0.0, 30.0], 0.0 for zigzag and 30.0 for armchair and the rest are chiral.

Parameters

logger (logging.getLogger) – output logger

tubularizeNanoTubeSheet(logger=None)

Tubularize the nanotube sheet.

Parameters

logger (logging.getLogger) – output logger

rotateTube(logger=None)

Rotate the nanotube so that the tube axis is the translation vector.

preprocessMatchAtoms(inmatch)

Dangling match atoms require two bonding partners so make those atom indicies redundant in the list.

Parameters

inmatch (list of ints) – non-redundant list

Return type

list of ints

Returns

outmatch, redundant list

bondMatchingEdges(matchleft, matchright)

Properly bond the left and right edges which meet each other after rolling.

Parameters
  • matchleft (list of ints) – indicies of atoms on the left

  • matchright (list of ints) – indicies of atoms on the right

doTermination(nanosheet_obj, fragment)

Terminate the nanotube. Do this by hijacking the HoneycombLattice instance and overwriting some attributes.

Parameters
  • nanosheet_obj (sheet.HoneycombLattice) – contains information shared between this instance and the nanotube instance

  • fragment (str) – fragment name

doBondOrders(logger=None)

Assign bond orders to the nanotube.

Parameters

logger (logging.getLogger) – output logger

removeHydrogens()

Remove all hydrogens from the structure.

minTerminatingFrags(nanosheet_obj)

Minimize terminating fragments. Do this by hijacking the HoneycombLattice instance and overwriting some attributes.

Parameters

nanosheet_obj (sheet.HoneycombLattice) – contains information shared between this instance and the nanotube instance

handleProps(chorus_properties)

Handle the structure properties of the tube.

Parameters

chorus_properties (list) – contains the nine chorus properties, i.e. ax, ay, az, bx, …, cz

printProps(logger=None)

Print the properties of this nanotube.

Parameters

logger (logging.getLogger) – output logger

getChorusPBC()

Return the chorus box PBC.

Return type

list

Returns

contains the nine chorus properties, i.e. ax, ay, az, bx, …, cz

buildTube(use_finite_bos=True, logger=None)

Build a tube.

Parameters
  • use_finite_bos (bool) – use a bond order protocol meant for finite molecules

  • logger (logging.getLogger) – output logger

class schrodinger.application.matsci.nano.tube.MultiWalledNanoTube(innertube, nwalls, wallsep)

Bases: object

Build a multi-walled nanotube by assembling specific NanoTubes.

NWALLS = 'i_matsci_N_Walls'
WALLSEP = 'r_matsci_Wall_Sep./Ang.'
MSGWIDTH = 50
__init__(innertube, nwalls, wallsep)

Create an instance.

Parameters
  • innertube (NanoTube) – tube object of inner most tube

  • nwalls (int) – number of walls in the multi-walled tube

  • wallsep (float) – wall separation in Angstrom for the multi-walled tube.

areSameLength()

Return True if the tubes in the multi-walled nanotube are the same length, False otherwise.

Return type

bool

Returns

True if the tubes in the multi-walled nanotube are the same length, False otherwise

getRadius()

Return the radius in Ang.

Return type

float

Returns

the radius in Ang.

getTerminatingIdxs()

Return the indices of terminating atoms.

Return type

list

Returns

indices of terminating atoms

getOuterChiralIndicies(wallindex, logger=None)

Get the chiral indicies for this outer tube.

Parameters
  • wallindex (int) – index of this outer tube

  • logger (logging.getLogger) – output logger

Return type

int, int

Return type

nindex, mindex, chiral indicies for outer tube

getOuterTubeVectors(nindex, mindex)

Return the tube vectors for the given (n, m).

Parameters
  • nindex (int) – first chiral index

  • mindex (int) – second chiral index

Return type

numpy.array, numpy.array

Returns

chiral, translat, the tube vectors

findLargestTranslat()

Return the length of the wall with the longest translation vector.

Return type

float

Returns

tmax, length of longest vector in Angstrom

getNumUnitCells(translat)

Return the number of unit cells to use for the given wall.

Parameters

translat (numpy.array) – translation vector of the given wall

Return type

int

Returns

ncells, the number of cells to use for the given wall

alignCenterCollect()

Align and center the tubes and collect tubes into a single structure.

getTubeSpacings()

Determine actual tube spacings in units of Ang.

handleProps()

Handle the structure properties of the multi-walled tube.

printProps(logger=None)

Print the properties of this multi-walled nanotube.

Parameters

logger (logging.getLogger) – output logger

buildMultiWallTube(use_finite_bos=True, logger=None)

Assemble the multi-walled tube.

Parameters
  • use_finite_bos (bool) – use a bond order protocol meant for finite molecules

  • logger (logging.getLogger) – output logger

class schrodinger.application.matsci.nano.tube.NanoTubes(element1='C', element2='C', bondlength=1.418, no_double_bonds=False, nindex=6, mindex=6, ncells=2, termfrag='hydrogen', min_term_frags=False, up_to_nindex=False, up_to_mindex=False, nwalls=1, wallsep=3.35, orient=False, logger=None, is_coarse_grain=False)

Bases: object

Main class for making nanotubes.

MSGWIDTH = 50
__init__(element1='C', element2='C', bondlength=1.418, no_double_bonds=False, nindex=6, mindex=6, ncells=2, termfrag='hydrogen', min_term_frags=False, up_to_nindex=False, up_to_mindex=False, nwalls=1, wallsep=3.35, orient=False, logger=None, is_coarse_grain=False)
Parameters
  • element1 (str) – elemental symbol of the first atom

  • element2 (str) – elemental symbol of the second atom

  • bondlength (float) – bond length between the first and second atoms in Angstrom

  • no_double_bonds (bool) – disable the formation of double bonds

  • nindex (int) – first chiral index

  • mindex (int) – second chiral index

  • ncells (int) – number of unit cells

  • termfrag (str) – terminate the lattice with a given fragment

  • min_term_frags (bool) – minimize the geometry of terminating fragments

  • up_to_nindex (bool) – enumerate nanotube structures on the n-index

  • up_to_mindex (bool) – enumerate nanotube structures on the m-index

  • nwalls (int) – number of walls in a multi-wall nanotube

  • wallsep (float) – wall separation in Angstrom in a multi-wall nanotube

  • orient (bool) – whether to orient the sheets for Maestro

  • logger (logging.getLogger) – output

  • is_coarse_grain (bool) – Whether a coarse grain structure is being created

printJobParams(logger=None)

Print job parameters.

Parameters

logger (logging.getLogger) – output logger

makeSingleWalledTubes(use_finite_bos=True, logger=None)

Make single-walled nanotubes.

Parameters
  • use_finite_bos (bool) – use a bond order protocol meant for finite molecules

  • logger (logging.getLogger) – output logger

Return type

list of NanoTube

Returns

singletubes, contains all created single-walled tubes

printSingleWalledTubes(logger=None)

Formatted print of single-walled tubes.

Parameters

logger (logging.getLogger) – output logger

makeMultiWalledTubes(use_finite_bos=True, logger=None)

Make multi-walled nanotubes.

Parameters
  • use_finite_bos (bool) – use a bond order protocol meant for finite molecules

  • logger (logging.getLogger) – output logger

Return type

list of MultiWalledNanoTube

Returns

multitubes, contains all created multi-walled tubes

printMultiWalledTubes(logger=None)

Formatted print of multi-walled tubes.

Parameters

logger (logging.getLogger) – output logger

schrodinger.application.matsci.nano.tube.remove_pbc(astructure)

Remove the PBC definitions from the given structure.

Parameters

astructure (schrodinger.structure.Structure) – the structure for which to remove the PBC

schrodinger.application.matsci.nano.tube.translate_tube(tube, radius)

Translate the tube so that it is inside the box.

Parameters
schrodinger.application.matsci.nano.tube.get_tube_unit_cell(radius, length)

Get the a, b, and c vectors of the unit cell for a tube of given length and radius.

Parameters
  • radius (float) – The radius of the tube in Angstroms

  • length (float) – The length of the tube in Angstroms

Return tuple(numpy.array)

Three numpy arrays each of length 3, corresponding to the a, b, and c vectors of the unit cell (in Angstroms)

schrodinger.application.matsci.nano.tube.get_tube_dimensions(chiral, translat)

Calculate the length and radius of a nanotube

Parameters
  • chiral (numpy.array) – The chiral vector of the nanutube

  • translat (numpy.array) – The translat vector of the nanutube

Return tuple(float, float)

The length and radius of the nanotube, respectively. Units are in Angstroms.

schrodinger.application.matsci.nano.tube.get_tube_vectors(ncells, nindex, mindex, lattvec1, lattvec2)

Return chiral and translation vectors for a nanotube sheet.

Parameters
  • ncells (int) – number of unit cells

  • nindex (int) – first chiral index

  • mindex (int) – second chiral index

  • lattvec1 (numpy.array) – first lattice vector

  • lattvec2 (numpy.array) – second lattice vector

Return tuple(numpy.array, numpy.array)

The chiral and translat tube vectors, respectively