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