SWNTGenerator¶
-
class
sknano.generators.
SWNTGenerator
(*args, from_scaling_matrix=False, **kwargs)[source] [edit on github][source]¶ Bases:
sknano.generators.NanotubeBundleGeneratorBase
,sknano.generators.SWNTGeneratorBase
,sknano.core.structures.SWNT
Class for generating
SWNT
structures.Parameters: - *Ch –
Either a 2-tuple of integers (i.e., *Ch = [(n, m)]) or 2 integers (i.e., *Ch = [n, m]) specifying the chiral indices of the nanotube chiral vector Ch=na1+ma2=(n,m).
- ny, nz (nx,) – Number of repeat unit cells in the x,y,z dimensions.
- basis ({
list
}, optional) –List of
str
s of element symbols or atomic number of the two atom basis (default: [‘C’, ‘C’])New in version 0.3.10.
- element2 (element1,) –
Element symbol or atomic number of basis
Atom
1 and 2Deprecated since version 0.3.10: Use
basis
instead - bond (float, optional) – aCC= distance between nearest neighbor atoms. Must be in units of Angstroms.
- Lz (float, optional) –
Length of nanotube in units of Angstroms. Overrides the
nz
value.New in version 0.2.5.
Changed in version 0.4.0: Changed units from nanometers to Angstroms
- tube_length (float, optional) –
Length of nanotube in units of Angstroms. Overrides the
nz
value.Deprecated since version 0.2.5: Use
Lz
instead - fix_Lz (bool, optional) –
Generate the nanotube with length as close to the specified Lz as possible. If
True
, then non integer nz cells are permitted.New in version 0.2.6.
- vdw_radius (float, optional) –
van der Waals radius of nanotube atoms
New in version 0.2.5.
- bundle_packing ({'hcp', 'ccp'}, optional) –
Packing arrangement of nanotubes bundles. If
bundle_packing
isNone
, then it will be determined by thebundle_geometry
parameter ifbundle_geometry
is notNone
. If bothbundle_packing
andbundle_geometry
areNone
, thenbundle_packing
defaults tohcp
.New in version 0.2.5.
- bundle_geometry ({'triangle', 'hexagon', 'square', 'rectangle'}, optional) –
Force a specific geometry on the nanotube bundle boundaries.
New in version 0.2.5.
- autogen (bool, optional) – if
True
, automatically generate structure data. - verbose (bool, optional) – if
True
, show verbose output
Examples
Using the
SWNTGenerator
class, you can generate structure data for single-walled nanotubes (SWNTs) or nanotube bundles with either cubic close packed (ccp) or hexagonal close packed (hcp) arrangement of nanotubes. The bundle packing arrangement is set using thebundle_packing
parameter.You can also enforce a specific
bundle geometry
which will try and build the nanotube bundle such that it “fits inside” the boundaries of a specified geometric shape. This allows you to generate hcp bundles that are trianglar, hexagonal, or rectangular in shape, as some of the examples below illustrate.First, load the
SWNTGenerator
class.>>> from sknano.generators import SWNTGenerator
Now let’s generate a Ch=(10,5)
SWNT
unit cell.>>> swnt = SWNTGenerator((10, 5)) >>> swnt.save(fname='10,5_unit_cell.xyz') >>> # note that there are two other alternative, but equivalent >>> # means of passing arguments to SWNTGenerator constructor: >>> # SWNTGenerator(10, 5) and SWNTGenerator(n=10, m=5)
Here’s a nice ray traced rendering of the generated (10,5)
SWNT
unit cell.Next, let’s generate an hcp bundle of Ch=(10,5) SWCNTs and cell count nx=10,ny=3,nz=5.
>>> SWCNTbundle = SWNTGenerator(n=10, m=5, nx=10, ny=3, nz=5) >>> SWCNTbundle.save()
The rendered structure looks like:
Now let’s generate a nice hexagon bundle, 3 tubes wide, with Ch=(6,5).
>>> SWCNTbundle = SWNTGenerator(n=6, m=5, nz=5, bundle_geometry='hexagon') >>> SWCNTbundle.save()
which looks like:
Remember, all of the
save
methods allow you to rotate the structure data before saving:>>> SWCNTbundle.save(fname='0605_hcp_7tube_hexagon_rot-30deg.xyz', ... rot_axis='z', rotation_angle=30)
Now, just because we can, let’s make a big ass hexagon bundle with Ch=(10,0).
>>> big_hexagonal_bundle = SWNTGenerator(10, 0, nx=25, ny=25, nz=1, ... bundle_geometry='hexagon') >>> big_hexagonal_bundle.save()
Take a look at the 469 (10,0) unit cells in this big ass bundle!
Lastly, here’s a look at a bundle generated with cubic close packed bundle arrangement:
>>> SWCNTbundle = SWNTGenerator(10, 10, nx=3, ny=3, nz=5, ... bundle_packing='ccp') >>> SWCNTbundle.save()
The rendered
ccp
structure looks like:Attributes
Ch
SWNT circumference |Ch| in Å Ch_vec
SWNT chiral vector. Lx
Axis-aligned length along the x
-axis in Angstroms.Ly
Axis-aligned length along the y
-axis in Angstroms.Lz
SWNT length Lz=Ltube in Angstroms. M
M=np−nq N
Number of graphene hexagons in nanotube unit cell. Natoms
N atoms. Natoms_list
list
ofNatoms
per nanotube in bundle.Natoms_per_bundle
Alias for Natoms
.Natoms_per_tube
Alias for Natoms_list
.Natoms_per_unit_cell
Number of atoms in nanotube unit cell. Ntubes
Number of nanotubes in bundle. R
Symmetry vector R=(p,q). T
Length of nanotube unit cell |T| in Å. Tvec
SWNT
translation vector.atoms
Structure Atoms
.basis
NanoStructureBase
basis objects.bundle_density
Compute the nanotube bundle density. bundle_geometry
Bundle geometry. bundle_mass
An alias for mass
.bundle_packing
Bundle packing. chiral_angle
Chiral angle θc in degrees. chiral_type
SWNT
chiral type.crystal_cell
Structure CrystalCell
.d
d=gcd dR
d_R=\gcd{(2n + m, 2m + n)} dt
Nanotube diameter d_t = \frac{|\mathbf{C}_h|}{\pi} in Å. electronic_type
SWNT electronic type. element1
Basis element 1 element2
Basis element 2 fix_Lz
bool
indicating whetherSWNTMixin.Lz
is fixed or calculated.fmtstr
Format string. lattice
Structure Crystal3DLattice
.lattice_shift
Lattice displacement vector. linear_mass_density
Linear mass density of nanotube in g/Å. m
Chiral index m. mass
Total mass of atoms. n
Chiral index n. nx
Number of nanotubes along the x-axis. ny
Number of nanotubes along the y-axis. nz
Number of nanotube unit cells along the z-axis. rt
Nanotube radius r_t = \frac{|\mathbf{C}_h|}{2\pi} in Å. scaling_matrix
CrystalCell.scaling_matrix
.structure
An alias to self
.t1
t_{1} = \frac{2m + n}{d_{R}} t2
t_2 = -\frac{2n + m}{d_R} tube_length
Alias for SWNT.Lz
tube_mass
An alias for mass
.unit_cell
Structure UnitCell
.unit_cell_mass
Unit cell mass in atomic mass units. unit_cell_symmetry_params
Tuple of SWNT
unit cell symmetry parameters.vdw_distance
Van der Waals distance. vdw_radius
Van der Waals radius Methods
clear
()Clear list of StructureMixin.atoms
.finalize
()Finalize structure data by clipping region bounds if fix_Lz
isTrue
.generate
([finalize])Generate structure data. generate_bundle_coords
()Generate coordinates of bundle tubes. generate_fname
([n, m, nx, ny, nz, fix_Lz, ...])Generate filename string. init_bundle_parameters
()Initialize bundle attributes. make_supercell
(scaling_matrix[, wrap_coords])Make supercell. rotate
(**kwargs)Rotate crystal cell lattice, basis, and unit cell. save
([fname, outpath, structure_format, ...])Save structure data. todict
()Return dict
of constructor parameters.transform_lattice
(scaling_matrix[, ...])Transform structure lattice. translate
(t[, fix_anchor_points])Translate crystal cell lattice, basis, and unit cell. write
(*args, **kwargs)Write structure data to file. write_data
(**kwargs)Write LAMMPS data file. write_dump
(**kwargs)Write LAMMPS dump file. write_pdb
(**kwargs)Write pdb file. write_xyz
(**kwargs)Write xyz file. Methods Summary
finalize
()Finalize structure data by clipping region bounds if fix_Lz
isTrue
.generate_fname
([n, m, nx, ny, nz, fix_Lz, ...])Generate filename string. save
([fname, outpath, structure_format, ...])Save structure data. Methods Documentation
-
finalize
()[source] [edit on github][source]¶ Finalize structure data by clipping region bounds if
fix_Lz
isTrue
.
-
classmethod
generate_fname
(n=None, m=None, nx=None, ny=None, nz=None, fix_Lz=False, Ntubes=None, bundle_geometry=None, bundle_packing=None, **kwargs)[source] [edit on github][source]¶ Generate filename string.
-
save
(fname=None, outpath=None, structure_format=None, center_centroid=True, **kwargs)[source] [edit on github][source]¶ Save structure data.
See
save
method for documentation.
- *Ch –