Polymers#

The polymers package provides simple methods to create polymers. Specifically implemented are:

These are constructors for simple polycarbon chains.

buildamol.extensions.polymers.polycarbons.cyclic_alkane(n: int, include_hydrogens: bool = True) Molecule[source]#

Construct a cyclic alkane change with n carbon atoms.

Parameters:
  • n (int) – The number of carbon atoms.

  • include_hydrogens (bool, optional) – If True, infer hydrogens, by default True

Returns:

The cyclic alkane chain.

Return type:

bam.Molecule

buildamol.extensions.polymers.polycarbons.linear_alkane(n: int, include_hydrogens: bool = True) Molecule[source]#

Construct a linear alkane change with n carbon atoms.

Parameters:
  • n (int) – The number of carbon atoms.

  • include_hydrogens (bool, optional) – If True, infer hydrogens, by default True

Returns:

The linear alkane chain.

Return type:

bam.Molecule

buildamol.extensions.polymers.polycarbons.linear_alkene(n: int, include_hydrogens: bool = True, double_bonds: str | list | tuple | set = 'even') Molecule[source]#

Construct a linear alkene change with n carbon atoms.

Parameters:
  • n (int) – The number of carbon atoms.

  • include_hydrogens (bool, optional) – If True, infer hydrogens, by default True

  • double_bonds (str or iterable, optional) – The positions of the double bonds. If “even”, the double bonds start with the first carbon atom and alternate every two carbon atoms. If “odd”, the double bonds start with the second carbon atom and alternate every two carbon atoms. If a list/tuple/set, the double bonds are at the positions specified in the list.

Returns:

The linear alkene chain.

Return type:

bam.Molecule

The main function to make simple nanotubes.

buildamol.extensions.polymers.nanotubes.nanotube(n: int, k: int) Molecule[source]#

Make a graphene nanotube with n carbon atoms per ring layer

Parameters:
  • n (int) – The number of carbon atoms per ring layer

  • k (int) – The number of ring layers

Returns:

The nanotube

Return type:

Molecule