function construct_matrix_representation(states, orig_orbs, trans_orbs) &
result(matrix)
! construct the matrix representation of the symmetry operation
! for a given basis. the symmetry operation is encoded in
! orig orbs and trans orbs
integer, intent(in) :: states(:, :), orig_orbs(nBasis / 2), trans_orbs(nBasis / 2)
integer :: matrix(size(states, 2), size(states, 2))
integer :: i, j, nJ(nel), phase
matrix = 0
do i = 1, size(states, 2)
do j = 1, size(states, 2)
call apply_transformation(states(:, j), orig_orbs, trans_orbs, &
nJ, phase)
if (all(nJ == states(:, i))) then
matrix(i, j) = phase
! matrix(j,i) = phase
end if
end do
end do
end function construct_matrix_representation