From jkl@ccl.net  Sun Oct  1 12:21:32 1995
Received: from bedrock.ccl.net  for jkl@ccl.net
	by www.ccl.net (8.6.10/950822.1) id MAA09434; Sun, 1 Oct 1995 12:16:15 -0400
Received: from krakow.ccl.net  for jkl@ccl.net
	by bedrock.ccl.net (8.6.10/950822.1) id MAA13616; Sun, 1 Oct 1995 12:16:12 -0400
From: Jan Labanowski <jkl@ccl.net>
Received:  for jkl@ccl.net
	by krakow.ccl.net (8.6.10/920428.1525) id MAA11882; Sun, 1 Oct 1995 12:16:11 -0400
Date: Sun, 1 Oct 1995 12:16:11 -0400
Message-Id: <199510011616.MAA11882@krakow.ccl.net>
To: chemistry@www.ccl.net
Subject: Spin contamination in DFT - FORTRAN code
Cc: jkl@ccl.net


Once more about spin contamination in DFT. I hope that my FORTRAN is
better than my broken English. I wrote a routine to compute it.
Can you look at it and see if it is a nonsense or a pearl {:-)}?
Maybe it is easier for you to look at it than at my previous message
(I actually messed up in the previous message, since I did not square
the SAB[i,j] at the very end). Sorry for my oldfashioned FORTRAN,
but I learned it before optimizing compilers on a 64k machine and old
habits die slow (but I still have a few years till retirement, I simply
started late... {:-)}).

Jan Labanowski
jkl@ccl.net

---------------- Variable names as in my previous message -------
      SUBROUTINE SPNCNT(S2EXCT, S2EXPT)

      IMPLICIT REAL*8(A-H,O-Z)
      INCLUDE "param.h"

      COMMON/BASIS/HMAT(NFOCK),TVECTR(NAUXFN),NDTT,NCNTRT,NNNS,NNNP,NNND

      COMMON/ORBEN/ELGALP(NCONTS),ELGBET(NCONTS),DOCA(NCONTS),
     &             DOCB(NCONTS),NLA,NLB

      COMMON/MATRX/SINV(NCONTS,NCONTS),FOCK1(NFOCK),FOCK2(NFOCK),
     &             FOCK3(NFOCK)
      COMMON/MODAT/AMAT(NFOCK),BMAT(NFOCK),
     &             CALPHA(NCONTS,NCONTS),CBETA(NCONTS,NCONTS)
      COMMON/INFOA/CENT(3,NATOMS),CHARGE(NATOMS),NATOMC(NATOMS),NCENTR,
     &             NALPHA,NBETA,NSTATE,NHOLEA(NCONTS),NHOLEB(NCONTS)

      DIMENSION WORK(NCONTS, NCONTS), WVEC(NCONTS)

C  --  Read in overlap matrix
      REWIND 43
      DO 100 I=1,NCNTRT
  100   CALL MYREAD(43,SINV(1,I),NCNTRT)


C  --  "exact spin square"
      S2EXCT = 0.25D0*(NALPHA - NBETA)*(NALPHA - NBETA + 2.0D0)

C  --  Calculate MO overlap matrix SAB = CALPHA' * SINV * CBETA
C  --  CALPHA' is a transpose of CALPHA

C  --  Make a matrix WORK(1:NCNTRT,1:NLB) = SINV * CBETA
      DO 400 K1 = 1, NCNTRT
        DO 150 K2 = 1, NCNTRT
C --        since SINV(K1,K2) = SINV(K2,K1) and FORTRAN orders matrices along
C --        columns, it is better for vectorization to do SINV(K2,K1)
          WVEC(K2) = SINV(K1,K2)
  150   CONTINUE
        DO 300 J =  1, NLB
          SUM = 0.0
          DO 200 K2 = 1, NCNTRT
            SUM = SUM + CBETA(K2,J)*WVEC(K2)
  200     CONTINUE
          WORK(K1,J) = SUM
  300   CONTINUE
  400 CONTINUE

C  --  Calculate SAB = CALPHA' * WORK (save it in SINV)
      DO 700 I = 1, NLA
        DO 600 J = 1, NLB
          SUM = 0.0
          DO 500 K1 = 1, NCNTRT
             SUM = SUM + CALPHA(K1,I)*WORK(K1,J)
  500     CONTINUE
          SINV(I,J) = SUM
  600   CONTINUE
  700 CONTINUE

C  --  Calculate expectation value of square of total spin
      S2EXPT = S2EXCT + NBETA
      DO 900 I = 1, NLA
        DO 800 J = 1, NLB
          X = SINV(I,J)
          S2EXPT = S2EXPT - DOCA(I)* DOCB(J) * X*X
  800   CONTINUE
  900 CONTINUE

C  --  Restore overlap matrix
      REWIND 43
      DO 1000 I=1,NCNTRT
 1000   CALL MYREAD(43,SINV(1,I),NCNTRT)

      RETURN
      END


From !rgab@trpntech.com  Sun Oct  1 14:21:34 1995
Received: from netcomsv.netcom.com  for !rgab@trpntech.com
	by www.ccl.net (8.6.10/950822.1) id OAA10268; Sun, 1 Oct 1995 14:19:18 -0400
Received: from .UUCP by netcomsv.netcom.com with UUCP (8.6.12/SMI-4.1)
	id LAA01898; Sun, 1 Oct 1995 11:17:41 -0700
Message-Id: <199510011817.LAA01898@netcomsv.netcom.com>
Date: 1 Oct 1995 10:49:53 -0800
From: "Richard Bone" <rgab@trpntech.com>
Subject: The bond order question
To: "CCL" <CHEMISTRY@www.ccl.net>


Subject:      The bond order question
                                                                     

From how I understood the original posting on bond-orders,
(and from my experience of working in a pharmaceutical company),
I assumed that the questioner did not have *wavefunctions* for
his molecules.  Consequently, I couldn't see that methods of
Bader, Mayer, etc., had any relevance.

From the original posting, I understood that the questioner had
his molecules stored with atom-types and (presumably) some
connectivity information and from those pieces of information
wished to ascribe (*integer* - by use of the term 'kekule')
bond orders (single, double, triple) to the bonds.

I do not know of a program which explicitly does this, but I
suspect that one has to write subroutines for the task. One would
need a table of 'common' valencies for the atoms somewhere in
there. This gives rise to certain problems for hypervalent
elements, e.g., S, P, and for those which can commonly exist
in more than  one oxidation state, e.g., N.

Richard Bone


__________________________________________________________
 
 Richard G. A. Bone, PhD.
 Computational Chemist
 Terrapin Technologies, Inc.      
 750-H Gateway Blvd.
 South San Francisco
 CA 94080-7020
 USA
 
 Tel. +1 (415) 244 9303
 FAX  +1 (415) 244 9388
 E-mail  rgab@trpntech.com

