dbcsr_t_contract Subroutine

public subroutine dbcsr_t_contract(alpha, tensor_1, tensor_2, beta, tensor_3, contract_1, notcontract_1, contract_2, notcontract_2, map_1, map_2, bounds_1, bounds_2, bounds_3, optimize_dist, pgrid_opt_1, pgrid_opt_2, pgrid_opt_3, filter_eps, flop, move_data, retain_sparsity, unit_nr, log_verbose)

Contract tensors by multiplying matrix representations. tensor_3(map_1, map_2) := alpha * tensor_1(notcontract_1, contract_1) * tensor_2(contract_2, notcontract_2) + beta * tensor_3(map_1, map_2)

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_scalar_type), intent(in) :: alpha
type(dbcsr_t_type), intent(inout), TARGET:: tensor_1

first tensor (in)

type(dbcsr_t_type), intent(inout), TARGET:: tensor_2

second tensor (in)

type(dbcsr_scalar_type), intent(in) :: beta
type(dbcsr_t_type), intent(inout), TARGET:: tensor_3

contracted tensor (out)

integer, intent(in), DIMENSION(:):: contract_1

indices of tensor_1 to contract

integer, intent(in), DIMENSION(:):: notcontract_1

indices of tensor_1 not to contract

integer, intent(in), DIMENSION(:):: contract_2

indices of tensor_2 to contract (1:1 with contract_1)

integer, intent(in), DIMENSION(:):: notcontract_2

indices of tensor_2 not to contract

integer, intent(in), DIMENSION(:):: map_1

which indices of tensor_3 map to non-contracted indices of tensor_1 (1:1 with notcontract_1)

integer, intent(in), DIMENSION(:):: map_2

which indices of tensor_3 map to non-contracted indices of tensor_2 (1:1 with notcontract_2)

integer, intent(in), optional DIMENSION(2, SIZE(contract_1)):: bounds_1

bounds corresponding to contract_1 AKA contract_2: start and end index of an index range over which to contract. For use in batched contraction.

integer, intent(in), optional DIMENSION(2, SIZE(notcontract_1)):: bounds_2

bounds corresponding to notcontract_1: start and end index of an index range. For use in batched contraction.

integer, intent(in), optional DIMENSION(2, SIZE(notcontract_2)):: bounds_3

bounds corresponding to notcontract_2: start and end index of an index range. For use in batched contraction.

logical, intent(in), optional :: optimize_dist

Whether distribution should be optimized internally. In the current implementation this guarantees optimal parameters only for dense matrices.

type(dbcsr_t_pgrid_type), intent(out), optional POINTER:: pgrid_opt_1

Optionally return optimal process grid for tensor_1. This can be used to choose optimal process grids for subsequent tensor contractions with tensors of similar shape and sparsity. Under some conditions, pgrid_opt_1 can not be returned, in this case the pointer is not associated.

type(dbcsr_t_pgrid_type), intent(out), optional POINTER:: pgrid_opt_2

Optionally return optimal process grid for tensor_2.

type(dbcsr_t_pgrid_type), intent(out), optional POINTER:: pgrid_opt_3

Optionally return optimal process grid for tensor_3.

real(kind=real_8), intent(in), optional :: filter_eps

As in DBCSR mm

integer(kind=int_8), intent(out), optional :: flop

As in DBCSR mm

logical, intent(in), optional :: move_data

memory optimization: transfer data such that tensor_1 and tensor_2 are empty on return

logical, intent(in), optional :: retain_sparsity

enforce the sparsity pattern of the existing tensor_3; default is no

integer, intent(in), optional :: unit_nr

output unit for logging set it to -1 on ranks that should not write (and any valid unit number on ranks that should write output) if 0 on ALL ranks, no output is written

logical, intent(in), optional :: log_verbose

verbose logging (for testing only)


Contents

None