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
[source]¶ 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)[source]¶ 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
-
DEFAULTMSG
= '\n You have specified a value for flag %s that is not supported. Values\n must be %s. Proceeding with the default value of %s.'¶
-
MIDFIX
= '-'¶
-
checkExistingFile
(infile)[source]¶ Check if the infile already exists and find a new name if it does.
- Parameters
infile (str) – file name to check
- Return type
str
- Returns
outfile, if infile is bad return new file name
-
checkIndicies
(nindex, mindex, logger=None)[source]¶ Check n-index and m-index.
- Parameters
nindex (int) – the first chiral index
mindex (int) – the second chiral index
logger (logging.getLogger) – output logger
-
checkMaeExt
(infile)[source]¶ Check that the infile has a supported Maestro extension.
- Parameters
infile (str) – file name to check
- Return type
str
- Returns
outfile, if infile is bad return its basename plus constants.DEFAULT_MAE_EXT
-
checkNumCells
(ncells, logger=None)[source]¶ Check the number of unit cells.
- Parameters
ncells (int) – the number of unit cells
logger (logging.getLogger) – output logger
-
checkNumWalls
(nwalls, logger=None)[source]¶ Check the number of walls.
- Parameters
nwalls (int) – the number of walls
logger (logging.getLogger) – output logger
-
-
class
schrodinger.application.matsci.nano.tube.
Rectangle
(origin, bottom, left, end)[source]¶ Bases:
object
Manage the properties of a rectangle.
-
INSIDETHRESH
= 1e-05¶
-
__init__
(origin, bottom, left, end)[source]¶ 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)[source]¶ 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)[source]¶ 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)[source]¶ 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)[source]¶ Create an instance.
- Parameters
nanotube_sheet_obj (NanoTubeSheet) – contains parameters of the nanotube sheet
-
defineVectors
()[source]¶ Define HoneycombLattice and NanoTubeSheet lattice, etc. vectors.
- Return type
numpy.array, numpy.array
- Returns
lattvec1, lattvec2, the HoneycombLattice lattice vectors
-
getGrowParams
(lattvec1, lattvec2)[source]¶ 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)[source]¶ 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)[source]¶ 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
-
-
class
schrodinger.application.matsci.nano.tube.
NanoTubeSheet
(element1, element2, bondlength, nindex, mindex, ncells)[source]¶ Bases:
object
Preprocess a nanosheet into a nanotube sheet which will be rolled up into a nanotube.
-
ZEROVEC
= array([0., 0.])¶
-
redefineLatticeVecs
(lattvec1, lattvec2)[source]¶ 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
-
getTubeVectors
()[source]¶ Return chiral and translation vectors for the nanotube sheet.
- Return type
numpy.array, numpy.array
- Returns
chiral, translat, tube vectors
-
renumberAtomLists
(renumbermap)[source]¶ Apply the given renumbering map to the terminating and matching atom lists.
- Parameters
renumbermap (dict) – maps old indicies into new indicies
-
cutOutNanoSheet
(logger=None)[source]¶ Cut out the nanotube sheet from the nanosheet.
- Parameters
logger (logging.getLogger) – output logger
-
delDanglingTermAtoms
()[source]¶ Remove dangling atoms from the top and bottom of the nanotube sheet.
-
delZigZagMatchAtoms
(logger=None)[source]¶ Remove overlapping match atoms for the zigzag case.
- Parameters
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)[source]¶ 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.'¶
-
TWOPI
= 6.283185307179586¶
-
MSGWIDTH
= 50¶
-
NUMDECIMAL
= 3¶
-
A_VACUUM
= 3.35¶
-
C_VACUUM
= 3.35¶
-
__init__
(element1, element2, bondlength, no_double_bonds, nindex, mindex, ncells, termfrag, min_term_frags)[source]¶ 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
-
getChiralAngle
(logger=None)[source]¶ 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)[source]¶ Tubularize the nanotube sheet.
- Parameters
logger (logging.getLogger) – output logger
-
rotateTube
(logger=None)[source]¶ Rotate the nanotube so that the tube axis is the translation vector.
-
preprocessMatchAtoms
(inmatch)[source]¶ 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)[source]¶ 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)[source]¶ 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
- Return type
list of ints
- Returns
nanosheet_obj.frozenatoms, those fragment atoms bound to the nanotube
-
doBondOrders
(logger=None)[source]¶ Assign bond orders to the nanotube.
- Parameters
logger (logging.getLogger) – output logger
-
minTerminatingFrags
(nanosheet_obj)[source]¶ 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)[source]¶ 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)[source]¶ Print the properties of this nanotube.
- Parameters
logger (logging.getLogger) – output logger
-
-
class
schrodinger.application.matsci.nano.tube.
MultiWalledNanoTube
(innertube, nwalls, wallsep)[source]¶ 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)[source]¶ 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
()[source]¶ 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
-
getTerminatingIdxs
()[source]¶ Return the indices of terminating atoms.
- Return type
list
- Returns
indices of terminating atoms
-
getOuterChiralIndicies
(wallindex, logger=None)[source]¶ 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)[source]¶ 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
()[source]¶ Return the length of the wall with the longest translation vector.
- Return type
float
- Returns
tmax, length of longest vector in Angstrom
-
getNumUnitCells
(translat)[source]¶ 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
-
-
class
schrodinger.application.matsci.nano.tube.
NanoTubes
(element1='C', element2='C', bondlength=1.418, no_double_bonds=False, nindex=6, mindex=6, ncells=1, termfrag='hydrogen', min_term_frags=False, up_to_nindex=False, up_to_mindex=False, nwalls=1, wallsep=3.35, orient=False, logger=None)[source]¶ 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=1, termfrag='hydrogen', min_term_frags=False, up_to_nindex=False, up_to_mindex=False, nwalls=1, wallsep=3.35, orient=False, logger=None)[source]¶ - 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 logger
-
printJobParams
(logger=None)[source]¶ Print job parameters.
- Parameters
logger (logging.getLogger) – output logger
-
makeSingleWalledTubes
(use_finite_bos=True, logger=None)[source]¶ 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)[source]¶ Formatted print of single-walled tubes.
- Parameters
logger (logging.getLogger) – output logger
-
makeMultiWalledTubes
(use_finite_bos=True, logger=None)[source]¶ 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
-
-
schrodinger.application.matsci.nano.tube.
remove_pbc
(astructure)[source]¶ 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)[source]¶ Translate the tube so that it is inside the box.
- Parameters
tube (schrodinger.structure.Structure) – the tube structure
radius (float) – the radius in Ang.