reshape_mm_small Subroutine

private subroutine reshape_mm_small(tensor_in, ind1, ind2, tensor_out, trans, new, nodata, move_data, unit_nr)

Prepare tensor for contraction: redistribute to a 2d format which can be contracted by matrix multiplication. This routine reshapes the smallest of the three tensors.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout), TARGET :: tensor_in

tensor in

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

index that should be mapped to first matrix dimension index that should be mapped to second matrix dimension

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

index that should be mapped to first matrix dimension index that should be mapped to second matrix dimension

type(dbcsr_t_type), intent(out), POINTER :: tensor_out

tensor out

character(len=1), intent(out) :: trans

transpose flag of matrix rep.

logical, intent(out) :: new

whether a new tensor was created for tensor_out

logical, intent(in), optional :: nodata

don't copy tensor data memory optimization: transfer data s.t. tensor_in may be empty on return

logical, intent(in), optional :: move_data

don't copy tensor data memory optimization: transfer data s.t. tensor_in may be empty on return

integer, intent(in), optional :: unit_nr

output unit