graph2mat.core.modules.matrixblock
Classes
|
Computes a fixed size matrix coming from the product of spherical harmonics. |
- class graph2mat.core.modules.matrixblock.MatrixBlock(i_basis: PointBasis, j_basis: PointBasis, operation_cls: Type, symm_transpose: bool = False, preprocessor=None, **operation_kwargs)[source]
Bases:
object
Computes a fixed size matrix coming from the product of spherical harmonics.
- There are two things to note:
It computes a dense matrix.
It computes a fixed size matrix.
- It takes care of:
Determining what are the irreps needed to reproduce a certain block.
Converting from those irreps to the actual values of the block using the appropiate change of basis.
This module doesn’t implement any computation, so you need to pass one as stated in the
operation
parameter.- Parameters:
i_irreps (o3.Irreps) – The irreps of the matrix rows.
j_irreps (o3.Irreps) – The irreps of the matrix columns.
symmetry (str) – Symmetries that this matrix is expected to have. This should be indicated as documented in
e3nn.o3.ReducedTensorProducts
. As an example, for a symmetric matrix you would pass “ij=ji” here.operation_cls (Type[torch.nn.Module]) –
Torch module used to actually do the computation. On initialization, it will receive the irreps_out argument from this module, specifying the shape of the output that it should produce.
On forward, this module will just be a wrapper around the operation, so you should pass whatever arguments that the operation expects.
**operation_kwargs (dict) – Any arguments needed for the initialization of the operation_cls.
- Returns:
matrix – A 2D tensor of shape (i_irreps.dim, j_irreps.dm) containing the output matrix.
- Return type:
ArrayType
- __init__(i_basis: PointBasis, j_basis: PointBasis, operation_cls: Type, symm_transpose: bool = False, preprocessor=None, **operation_kwargs)[source]
- numpy: ModuleType = <module 'numpy' from '/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/numpy/__init__.py'>