anchor.diff: +
   !------------------------------------------------------------------------------
   !    This code is part of the MondoSCF suite of programs for linear scaling
   !    electronic structure theory and ab initio molecular dynamics.
  
positive.code:     IF(ASSOCIATED(qA%Quad11)) &
           CALL Print_Quad(qA%Quad11)
  
  111 FORMAT("Cuboid[{",I6,",",I6,":",I6,",",I6,"}, (* ",I6,", ",I6,", ",F12.6,"*)")
  
    END SUBROUTINE Print_Quad
  
    SUBROUTINE NewQuNode(qA,count)
      INTEGER :: count
      TYPE(QuTree), POINTER :: qA
      ALLOCATE(qA);  count=count+1
      qA%Num=count
      qA%Norm=Zero
      NULLIFY(qA%Quad00)
      NULLIFY(qA%Quad01)
      NULLIFY(qA%Quad10)
      NULLIFY(qA%Quad11)
    END SUBROUTINE NewQuNode
  
  
    FUNCTION SpAMM(qA,qB,tolerance) RESULT(qC)
      IMPLICIT NONE
      TYPE(QuTree), POINTER                :: qA,qB
      TYPE(QuTree),  POINTER      :: qC
      REAL(DOUBLE),OPTIONAL       :: tolerance
      !
      IF(PRESENT(tolerance))THEN
         SpAMM_tolerance=tolerance
      ELSE
         SpAMM_tolerance=1D-6
      ENDIF
      !
      SpAMM_quadcount=0
      CALL NewQuNode(qC,SpAMM_quadcount)
      !
      qC%Num=1
      qC%Lev=1
      SpAMM_multiplies=Zero
      qC%Box(:,1)=(/1,1/)
      qC%Box(:,2)=(/SpAMM_tiles,SpAMM_tiles/)*BLOCK_SIZE
      !
      CALL SpAMM_Multiply(qC,qA,qB)
    END FUNCTION SpAMM
  
  
    RECURSIVE SUBROUTINE SpAMM_Multiply(qC,qA,qB)
      IMPLICIT NONE
      TYPE(QuTree), POINTER :: qC,qA,qB
      REAL(DOUBLE), DIMENSION(1:BLOCK_SIZE,1:BLOCK_SIZE) :: CTmp
      LOGICAL :: do00x00,do01x10,do10x00,do11x10, &
                 do00x01,do01x11,do10x01,do11x11
      ! Bounds
      qC%Box(1,1)=qA%Box(2,1)
      qC%Box(1,2)=qA%Box(2,2)
      qC%Box(2,1)=qB%Box(1,1)
  
negative.code:   !
    TYPE SpAMM_cubes
       TYPE(SpAMM_cubes), POINTER  :: Next
       INTEGER                     :: Lev
       INTEGER                     :: Hash
       REAL(DOUBLE)                :: Bound
       INTEGER,     DIMENSION(3,2) :: Box
  