Psi4
slaterd.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
33 /* Slater Determinant Class
34 **
35 ** Based on a previous implementation by David Sherrill using bitsrings
36 ** from the g++ library and on a symbolic Slater's rules program written
37 ** in C by Matt Leininger
38 **
39 ** February 7, 1996
40 **
41 ** C. David Sherrill and Matthew L. Leininger
42 ** Center for Computational Quantum Chemistry
43 ** University of Georgia
44 ** Athens, GA 30606
45 **
46 ** Need to #include <cstdio> before this file
47 **
48 ** Assume number of alpha electrons is greater than or equal to the number
49 ** of beta electrons
50 **
51 ** Currently matrix_element() uses static temp arrays which are never free'd.
52 ** The arrays should always be small, so this shouldn't be a problem. The
53 ** malloc'ing is only done once, no matter how many times matrix_element is
54 ** called.
55 */
56 
57 
58 #ifndef _psi_src_bin_detci_slaterd_h
59 #define _psi_src_bin_detci_slaterd_h
60 #include <string>
61 namespace psi { namespace detci {
62 
63 class CIWavefunction;
64 
66  friend class CIWavefunction;
67 
68  protected:
69  unsigned nalp_;
70  unsigned nbet_;
71  unsigned char *Occs_[2];
72 
73  public:
74  SlaterDeterminant() { nalp_=0; nbet_=0; Occs_[0]=NULL; Occs_[1]=NULL; }
76  if (Occs_[0] != NULL) free(Occs_[0]);
77  if (Occs_[1] != NULL) free(Occs_[1]);
78  }
79  void set(unsigned int nalp, unsigned char *alpoccs,
80  unsigned int nbet, unsigned char *betoccs);
81  void print(void);
82  void print_config(void);
84  friend int operator==(SlaterDeterminant& s1, SlaterDeterminant& s2) ;
86 };
87 
88 }} // namespace psi::detci
89 
90 #endif // header guard
Definition: ciwave.h:74
void set(unsigned int nalp, unsigned char *alpoccs, unsigned int nbet, unsigned char *betoccs)
Definition: slaterd.cc:53
SlaterDeterminant & operator=(const SlaterDeterminant &s)
Definition: slaterd.cc:134
unsigned nbet_
Definition: slaterd.h:70
SlaterDeterminant()
Definition: slaterd.h:74
friend double matrix_element(SlaterDeterminant *I, SlaterDeterminant *J)
SharedWavefunction detci(SharedWavefunction, Options &)
Definition: detci.cc:64
void print(void)
Definition: slaterd.cc:79
unsigned char * Occs_[2]
Definition: slaterd.h:71
unsigned nalp_
Definition: slaterd.h:69
friend int operator==(SlaterDeterminant &s1, SlaterDeterminant &s2)
Definition: slaterd.cc:149
~SlaterDeterminant()
Definition: slaterd.h:75
Definition: slaterd.h:65
void print_config(void)
Definition: slaterd.cc:97