anchor.diff:      IF (I.EQ.1) THEN
          TrP=Trace(P)
          TrdP=Trace(dP)
  +       ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  +       !       TrP=TrdP
          IF(ABS(TrP-TrdP)>SpAMM_tolerance*1D1)THEN
             WRITE(*,*)' 1TrP = ',TrP,TrdP
             STOP
          ENDIF
  -    ENDIF
  -
  -    WRITE(*,*)' SpAMM SpAMM SpAMM SpAMM SpAMM SpAMM '
  +       ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  +    ENDIF
  +    !
       CALL Multiply(P,P,P2)             ! The only multiplication is a square
  -    WRITE(*,*)' SpAMM SpAMM SpAMM SpAMM SpAMM SpAMM '
  -
       dP2=MATMUL(dP,dP)
  +
  +
  +!    P2=>Dense2Quad(Quad2Dense(P2))
  +    ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       dP2b=Quad2Dense(P2)
  -
       DO II=1,NN
          DO J=1,NN
             IF(ABS(dP2(II,J)-dP2b(II,J))>SpAMM_tolerance*1D1)THEN
  -            WRITE(*,*)'A',II,J,dP2(II,J),dP2b(II,J),dP2(II,J)-dP2b(II,J)
                WRITE(*,*)'++++++++++++++++++++++++++++++++++++++++++++'
                WRITE(*,*)' sparse P*P'
  -             CALL Print_quad(P2)
  -             P=>Dense2Quad(dP2)
  +
  +             sum=Zero
  +             DO KK=1,NN
  +                IF(ABS(dP(II,KK)*dP(KK,J))>1D-1*SpAMM_tolerance)THEN
  +                   WRITE(*,*)dP(II,KK)*dP(KK,J),sum
  +                   sum=sum+dP(II,KK)*dP(KK,J)
  +                ENDIF
  +             ENDDO
  +             WRITE(*,*)' SpAMM_tolerance = ',SpAMM_tolerance
  +            WRITE(*,*)'ARAW',II,J,dP2(II,J),dP2b(II,J),dP2(II,J)-dP2b(II,J)
  +            WRITE(*,*)'ASUM',II,J,sum,dP2b(II,J),dP2(II,J)-sum
  +
  +!             CALL Print_quad(P2)
  + !            P=>Dense2Quad(dP2)
                WRITE(*,*)'++++++++++++++++++++++++++++++++++++++++++++'
                WRITE(*,*)' dense P*P'
  -             CALL Print_quad(P)
  +
  +
  + !            CALL Print_quad(P)
                STOP
             ENDIF
          ENDDO
       ENDDO
  -
  +    ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       TrP2=Trace(P2)
       TrdP2=Trace(dP2)
  -
  -    IF(ABS(TrP2-TrdP2)>SpAMM_tolerance*1D1)THEN
  +    ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  +    !    TrP2=TrdP2
  +    IF(ABS(TrP2-TrdP2)>SpAMM_tolerance)THEN
          WRITE(*,*)'TrP = ',TrP2,TrdP2
          STOP "P2 STOP "
       ENDIF
  +    ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   
       CR1 = ABS(TrP2-Norm)              ! CR1 = Occupation error criteria
       CR2 = ABS(2.D0*TrP - TrP2 - Norm) ! CR2 = Occupation error criteria
  
positive.code:                         SpAMM_dimension
    INTEGER            :: SpAMM_tiles, SpAMM_levels, SpAMM_quadcount
    TYPE(SpAMM_cubes),POINTER :: SpAMM_stream
    INTEGER, PARAMETER :: SpAMM_BLOCK_SIZE=4
    !----------------------------------------------------------------
    !===============================================================================
    !  Interface blocks for generic linear algebra routines
  
negative.code:        ENDIF
      ENDIF
    END SUBROUTINE SpAMM_Copy
    !=================================================================
    ! QuTree multiply routines
    !=================================================================
  