Metal Complex
- class MetalComplex(metals, ligands, reaction_factory=None, num_processes=1, optimizer=<stk.molecular.topology_graphs.topology_graph.optimizers.null.NullOptimizer object>)[source]
Bases:
TopologyGraph
Represents a metal complex topology graph.
Notes
Subclass Implementation
Each subclass needs to define the attributes,
_metal_vertex_prototypes
and_ligand_vertex_prototypes
, which aretuple
ofVertex
instances.Examples
Subclass Implementation
The source code of the subclasses, listed in
metal_complex
, can serve as good examples.Basic Construction
For most
MetalComplex
topology graphs, we first need to define a metalBuildingBlock
, consisting of 1 atom and multiple functional groupsimport stk metal = stk.BuildingBlock( smiles='[Fe+2]', functional_groups=( stk.SingleAtom(stk.Fe(0, charge=2)) for i in range(6) ), position_matrix=[[0, 0, 0]], )
We also need to define an organic ligand
BuildingBlock
# Define an organic linker with two functional groups. bidentate = stk.BuildingBlock( smiles='C=NC/C=N/Br', functional_groups=[ stk.SmartsFunctionalGroupFactory( smarts='[#6]~[#7X2]~[#35]', bonders=(1, ), deleters=(), ), stk.SmartsFunctionalGroupFactory( smarts='[#6]~[#7X2]~[#6]', bonders=(1, ), deleters=(), ), ], )
Finally, we can create the
MetalComplex
.complex = stk.ConstructedMolecule( topology_graph=stk.metal_complex.OctahedralLambda( metals=metal, ligands=bidentate, ) )
Suggested Optimization
For
MetalComplex
topologies, it is recommend to use theMCHammer
optimizer.import stk metal = stk.BuildingBlock( smiles='[Fe+2]', functional_groups=( stk.SingleAtom(stk.Fe(0, charge=2)) for i in range(6) ), position_matrix=[[0, 0, 0]], ) bidentate = stk.BuildingBlock( smiles='C=NC/C=N/Br', functional_groups=[ stk.SmartsFunctionalGroupFactory( smarts='[#6]~[#7X2]~[#35]', bonders=(1, ), deleters=(), ), stk.SmartsFunctionalGroupFactory( smarts='[#6]~[#7X2]~[#6]', bonders=(1, ), deleters=(), ), ] ) complex = stk.ConstructedMolecule( topology_graph=stk.metal_complex.OctahedralLambda( metals=metal, ligands=bidentate, optimizer=stk.MCHammer(), ), )
Construction with Multiple Metals & Ligands
When multiple metals or ligands are used, the metals and ligands parameters accept values of type
dict
, which specify the exact vertex each metal or ligand needs to be placed on.import stk metal = stk.BuildingBlock( smiles='[Fe+2]', functional_groups=( stk.SingleAtom(stk.Fe(0, charge=2)) for i in range(6) ), position_matrix=[[0, 0, 0]], ) bidentate1 = stk.BuildingBlock( smiles='C=NC/C=N/Br', functional_groups=[ stk.SmartsFunctionalGroupFactory( smarts='[#6]~[#7X2]~[#35]', bonders=(1, ), deleters=(), ), stk.SmartsFunctionalGroupFactory( smarts='[#6]~[#7X2]~[#6]', bonders=(1, ), deleters=(), ), ], ) # Define a second organic linker with two functional # groups. bidentate2 = stk.BuildingBlock( smiles='C=NC(C)(C)/C(C)=N/Br', functional_groups=[ stk.SmartsFunctionalGroupFactory( smarts='[#6]~[#7X2]~[#35]', bonders=(1, ), deleters=(), ), stk.SmartsFunctionalGroupFactory( smarts='[#6]~[#7X2]~[#6]', bonders=(1, ), deleters=(), ), ], ) # Build heteroleptic complex. complex = stk.ConstructedMolecule( topology_graph=stk.metal_complex.OctahedralLambda( metals=metal, ligands={ bidentate1: (0, 1), bidentate2: (2, ), }, ), )
However, if each ligand is has a different number of functional groups, they can be provided together in a
tuple
.Note that the valid vertex identifiers depend on the exact metal complex you are using. These are detailed in the docstring for that specific metal vertex topology graph.
Unsubstituted Metal Complexes
Some metal complex topologies represent metal complexes with unsubstituted metal sites. For example,
BidentateSquarePlanar
has all sites substituted andCisProtectedSquarePlanar
is the equivalent metal complex with some unsubstituted sitesimport stk pd = stk.BuildingBlock( smiles='[Pd+2]', functional_groups=( stk.SingleAtom(stk.Pd(0, charge=2)) for i in range(4) ), position_matrix=[[0, 0, 0]], ) # Define a bidentate ligand with two functional groups. bidentate_ligand = stk.BuildingBlock( smiles='NCCN', functional_groups=[ stk.SmartsFunctionalGroupFactory( smarts='[#7]~[#6]', bonders=(0, ), deleters=(), ), ], ) # Construct a cis-protected square planar metal complex. complex = stk.ConstructedMolecule( topology_graph=stk.metal_complex.CisProtectedSquarePlanar( metals=pd, ligands=bidentate_ligand, ), )
Methods
clone
()Return a clone.
Construct a
ConstructedMolecule
.Yield the building blocks.
get_num_building_block
(building_block)Get the number of times building_block is present.
with_building_blocks
(building_block_map)Return a clone holding different building blocks.
- __init__(metals, ligands, reaction_factory=None, num_processes=1, optimizer=<stk.molecular.topology_graphs.topology_graph.optimizers.null.NullOptimizer object>)[source]
Initialize a
MetalComplex
.- Parameters:
metals (
Union
[BuildingBlock
,tuple
[BuildingBlock
,...
],dict
[BuildingBlock
,tuple
[int
,...
]]]) –Can be a
dict
which maps theBuildingBlock
instances to the indices of the vertices in_metal_vertex_prototypes
it should be placed on.If each
BuildingBlock
has a different number of functional groups, they can be supplied together in atuple
.Can also be a
BuildingBlock
instance, which should be placed on all_metal_vertex_prototypes
on the topology graph.ligands (
Union
[BuildingBlock
,tuple
[BuildingBlock
,...
],dict
[BuildingBlock
,tuple
[int
,...
]]]) –Can be a
dict
which maps theBuildingBlock
instances to the indices of the vertices in_ligand_vertex_prototypes
it should be placed on.If each
BuildingBlock
has a different number of functional groups, they can be supplied together in atuple
.Can also be a
BuildingBlock
instance, which should be placed on all_ligand_vertex_prototypes
on the topology graph.reaction_factory (
Optional
[ReactionFactory
]) – The reaction factory to use for creating bonds between building blocks. IfNone
, aDativeReactionFactory
is used, which produces only dative bonds in any reactions done by this topology construction.num_processes (
int
) – The number of parallel processes to create duringconstruct()
.optimizer (
Optimizer
) – Used to optimize the structure of the constructed molecule.
- construct()
Construct a
ConstructedMolecule
.- Return type:
- Returns:
The data describing the
ConstructedMolecule
.
- get_building_blocks()
Yield the building blocks.
Building blocks are yielded in an order based on their position in the topology graph. For two equivalent topology graphs, but with different building blocks, equivalently positioned building blocks will be yielded at the same time.
- Yields:
A building block of the topology graph.
- Return type:
- get_num_building_block(building_block)
Get the number of times building_block is present.
- Parameters:
building_block (
BuildingBlock
) – The building block whose frequency in the topology graph is desired.- Return type:
- Returns:
The number of times building_block is present in the topology graph.
- with_building_blocks(building_block_map)[source]
Return a clone holding different building blocks.
- Parameters:
building_block_map (
dict
[BuildingBlock
,BuildingBlock
]) – Maps a building block in the current topology graph to the building block which should replace it in the clone. If a building block should be not replaced in the clone, it can be omitted from the map.- Return type:
- Returns:
The clone.