MPQC  3.0.0-alpha
spin.h
1 //
2 // spin.h
3 //
4 // Copyright (C) 2005 Edward Valeev
5 //
6 // Author: Edward Valeev <evaleev@vt.edu>
7 // Maintainer: EV
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit 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 Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #include <stdexcept>
29 #include <util/misc/scexception.h>
30 
31 #ifndef _chemistry_qc_mbptr12_spin_h
32 #define _chemistry_qc_mbptr12_spin_h
33 
34 namespace sc {
35 
36  typedef enum { NSpinCases1 = 2, NSpinCases2 = 3} NSpinCases;
37  typedef enum { NPureSpinCases2 = 2 } NPureSpinCases;
39  unsigned int nspincases1(bool spin_polarized);
41  unsigned int nspincases2(bool spin_polarized);
43  unsigned int npurespincases2();
44  enum { ToLowerCase = true,
45  ToUpperCase = false };
46 
49 
50  typedef enum { AnySpinCase1 = -1, Alpha = 0, Beta = 1, InvalidSpinCase1 = 2} SpinCase1;
51  typedef enum { AnySpinCase2 = -1, AlphaBeta = 0, AlphaAlpha = 1, BetaBeta = 2, InvalidSpinCase2 = 3} SpinCase2;
52  typedef enum { AnyPureSpinCase2 = -1, Singlet = 0, Triplet = 1, InvalidPureSpinCase2 = 2} PureSpinCase2;
54  SpinCase1 case1(SpinCase2 S);
56  SpinCase1 case2(SpinCase2 S);
58  SpinCase2 case12(SpinCase1 S1, SpinCase1 S2);
60  SpinCase1 other(SpinCase1 S);
61 
62  std::string to_string(SpinCase1 S);
63  std::string to_string(SpinCase2 S);
64  std::string to_string(PureSpinCase2 S);
65  SpinCase1 to_spincase1(const std::string& key);
66  SpinCase2 to_spincase2(const std::string& key);
67  PureSpinCase2 to_purespincase2(const std::string& key);
68 
70  std::string prepend_spincase(SpinCase1 S, const std::string& R, bool lowercase = false);
72  std::string prepend_spincase(SpinCase2 S, const std::string& R, bool lowercase = false);
74  std::string prepend_spincase(PureSpinCase2 S, const std::string& R, bool lowercase = false);
75 
77  // end of addtogroup ChemistryElectronicStructure
78 
79 };
80 
81 #endif
82 
sc::nspincases2
unsigned int nspincases2(bool spin_polarized)
Returns the number of unique combinations of 2 spin cases (1 or 3)
sc::case1
SpinCase1 case1(SpinCase2 S)
returns the first spin case of the 2-spin S
sc::case12
SpinCase2 case12(SpinCase1 S1, SpinCase1 S2)
combines 2 spins to give 1 2-spin
sc::prepend_spincase
std::string prepend_spincase(SpinCase1 S, const std::string &R, bool lowercase=false)
Prepend string representation of S to R and return.
sc::npurespincases2
unsigned int npurespincases2()
Returns the number of pure 2 spin cases.
sc::other
SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
sc::case2
SpinCase1 case2(SpinCase2 S)
returns the second spin case of the 2-spin S
sc::nspincases1
unsigned int nspincases1(bool spin_polarized)
Returns the number of unique spin cases (1 or 2)
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14

Generated at Sun Jan 26 2020 23:24:00 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.