Psi4
wavefunction.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 
28 #ifndef _psi_src_lib_libmints_wavefunction_h
29 #define _psi_src_lib_libmints_wavefunction_h
30 
31 #include "typedefs.h"
35 
36 #include "psi4/pybind11.h"
37 #include <stddef.h>
38 #include <vector>
39 #include <memory>
40 
41 #define MAX_IOFF 30000
42 extern size_t ioff[MAX_IOFF];
43 
44 #define MAX_DF 500
45 extern double df[MAX_DF];
46 
47 #define MAX_BC 20
48 extern double bc[MAX_BC][MAX_BC];
49 
50 #define MAX_FAC 100
51 extern double fac[MAX_FAC];
52 
53 #if !defined( EXPLICIT_IOFF )
54 # define EXPLICIT_IOFF(i) ( (i) * ((i) + 1) / 2 )
55 #endif
56 
57 #if !defined( INDEX2 )
58 # define INDEX2(i, j) ( (i) >= (j) ? EXPLICIT_IOFF(i) + (j) : EXPLICIT_IOFF(j) + (i) )
59 #endif
60 
61 #if !defined( INDEX4 )
62 # define INDEX4(i, j, k, l) ( INDEX2( INDEX2((i), (j)), INDEX2((k), (l)) ) )
63 #endif
64 
65 
66 namespace psi {
67 
68 class Molecule;
69 class BasisSet;
70 class IntegralFactory;
71 class Matrix;
72 class Vector;
73 class MatrixFactory;
74 class Options;
75 class SOBasisSet;
76 class PSIO;
77 class Chkpt;
78 class OrbitalSpace;
79 class OEProp;
80 
85 class Wavefunction : public std::enable_shared_from_this<Wavefunction>
86 {
87 protected:
89  std::string name_;
90 
92  std::map<std::string, std::shared_ptr<BasisSet>> basissets_;
93 
95  std::shared_ptr<BasisSet> basisset_;
96 
98  std::shared_ptr<SOBasisSet> sobasisset_;
99 
102 
104  std::shared_ptr<Molecule> molecule_;
105 
108 
109  // PSI file access variables
110  std::shared_ptr<PSIO> psio_;
111 
113  std::shared_ptr<IntegralFactory> integral_;
114 
116  std::shared_ptr<MatrixFactory> factory_;
117 
118  std::shared_ptr<Wavefunction> reference_wavefunction_;
119 
120  std::shared_ptr<OEProp> oeprop_;
121 
123  long int memory_;
124 
126  unsigned int debug_;
128  unsigned int print_;
129 
132 
134  int nfrzc_;
135 
148 
153 
156 
158  double energy_;
159 
161  double efzc_;
162 
164  int nso_;
166  int nmo_;
168  int nirrep_;
169 
172 
176 
181 
186 
189 
194 
196  std::shared_ptr<Vector> epsilon_a_;
198  std::shared_ptr<Vector> epsilon_b_;
199 
200  // Callback routines to Python
201  std::vector<void*> precallbacks_;
202  std::vector<void*> postcallbacks_;
203 
206 
209 
211  std::shared_ptr<Matrix> tpdm_gradient_contribution_;
212 
214  SharedMatrix C_subset_helper(SharedMatrix C, const Dimension& noccpi, SharedVector epsilon, const std::string& basis, const std::string& subset);
215  SharedMatrix F_subset_helper(SharedMatrix F, SharedMatrix C, const std::string& basis);
216  SharedVector epsilon_subset_helper(SharedVector epsilon, const Dimension& noccpi, const std::string& basis, const std::string& subset);
217  std::vector<std::vector<int> > subset_occupation(const Dimension& noccpi, const std::string& subset);
218 
220  std::shared_ptr<std::vector<double>> atomic_point_charges_;
221 
223  std::shared_ptr<Vector> frequencies_;
224 
226  std::shared_ptr<Vector> normalmodes_;
227 
231 
232  // Collection of variables
233  std::map<std::string, double> variables_;
234  std::map<std::string, SharedMatrix> arrays_;
235 
236 private:
237  // Wavefunction() {}
238  void common_init();
239 
240 public:
241 
243  Wavefunction(std::shared_ptr<Molecule> molecule,
244  std::shared_ptr<BasisSet> basis,
245  Options& options);
246 
248  Wavefunction(std::shared_ptr<Molecule> molecule,
249  std::shared_ptr<BasisSet> basis);
250 
253 
262  void shallow_copy(SharedWavefunction other);
263  void shallow_copy(const Wavefunction* other);
264 
272  void deep_copy(SharedWavefunction other);
273  void deep_copy(const Wavefunction* other);
274 
275  virtual ~Wavefunction();
276 
278  virtual double compute_energy() {throw PSIEXCEPTION("Compute energy has not been implemented for this wavefunction.");}
279 
281  virtual SharedMatrix compute_gradient() {throw PSIEXCEPTION("Analytic gradients are not available for this wavefunction.");}
282 
284  virtual SharedMatrix compute_hessian() {throw PSIEXCEPTION("Analytic Hessians are not available for this wavefunction.");}
285 
287  bool same_a_b_orbs() const { return same_a_b_orbs_; }
288  bool same_a_b_dens() const { return same_a_b_dens_; }
289 
292  Dimension map_irreps(const Dimension &dimpi);
293 
295  std::shared_ptr<Molecule> molecule() const;
296  std::shared_ptr<PSIO> psio() const;
297  Options& options() const;
298 
300  std::shared_ptr<IntegralFactory> integral() const;
302  std::shared_ptr<BasisSet> basisset() const;
304  std::shared_ptr<SOBasisSet> sobasisset() const;
305 
307  std::shared_ptr<BasisSet> get_basisset(std::string label);
308  void set_basisset(std::string label, std::shared_ptr<BasisSet> basis);
309  bool basisset_exists(std::string label);
310 
311 
313  std::shared_ptr<MatrixFactory> matrix_factory() const;
315  std::shared_ptr<Wavefunction> reference_wavefunction() const;
317  void set_reference_wavefunction(const std::shared_ptr<Wavefunction> wfn);
318 
320  bool density_fitted() const { return density_fitted_; }
321 
322  static void initialize_singletons();
323 
325  const Dimension& doccpi() const { return doccpi_; }
327  const Dimension& soccpi() const { return soccpi_; }
329  const Dimension& nsopi() const { return nsopi_; }
331  const Dimension& nmopi() const { return nmopi_; }
333  const Dimension& nalphapi() const { return nalphapi_; }
335  const Dimension& nbetapi() const { return nbetapi_; }
337  const Dimension& frzcpi() const { return frzcpi_; }
339  const Dimension& frzvpi() const { return frzvpi_; }
340 
341  void set_doccpi(const Dimension& doccpi);
342  void set_soccpi(const Dimension& soccpi);
343 
345  void set_frzvpi(const Dimension& frzvpi) { for(int h=0; h < nirrep_; h++) frzvpi_[h] = frzvpi[h]; }
346 
348  int nfrzc() const { return nfrzc_; }
350  int nalpha() const { return nalpha_; }
352  int nbeta() const { return nbeta_; }
354  int nso() const { return nso_; }
356  int nmo() const { return nmo_; }
358  int nirrep() const { return nirrep_; }
360  double reference_energy () const { return energy_; }
362  double efzc() const { return efzc_; }
364  void set_efzc(double efzc) { efzc_ = efzc; }
365 
367  SharedMatrix S() const { return S_; }
368 
370  SharedMatrix H() const { return H_; }
371 
373  SharedMatrix Ca() const;
375  SharedMatrix Cb() const;
377  SharedMatrix Fa() const;
379  SharedMatrix Fb() const;
381  std::shared_ptr<Vector> epsilon_a() const;
383  std::shared_ptr<Vector> epsilon_b() const;
385  std::shared_ptr<Matrix> Lagrangian() const;
387  virtual std::shared_ptr<Matrix> tpdm_gradient_contribution() const;
388 
389  SharedMatrix aotoso() const { return AO2SO_; }
390 
391  std::shared_ptr<OEProp> get_oeprop() const { return oeprop_; }
392  void set_oeprop( std::shared_ptr<OEProp> oeprop ) { oeprop_ = oeprop; }
393 
395  const SharedMatrix Da() const;
397  SharedMatrix Db() const;
398 
407  SharedMatrix Ca_subset(const std::string& basis = "SO", const std::string& subset = "ALL");
408 
417  SharedMatrix Cb_subset(const std::string& basis = "SO", const std::string& subset = "ALL");
418 
428  OrbitalSpace alpha_orbital_space(const std::string& id, const std::string& basis = "SO", const std::string& subset = "ALL");
438  OrbitalSpace beta_orbital_space(const std::string& id, const std::string& basis = "SO", const std::string& subset = "ALL");
439 
446  SharedMatrix Da_subset(const std::string& basis = "SO");
447 
454  SharedMatrix Db_subset(const std::string& basis = "SO");
455 
464  SharedMatrix D_subset_helper(SharedMatrix D, SharedMatrix C, const std::string& basis);
465 
473  SharedVector epsilon_a_subset(const std::string& basis = "SO", const std::string& subset = "ALL");
474 
482  SharedVector epsilon_b_subset(const std::string& basis = "SO", const std::string& subset = "ALL");
483 
493  std::shared_ptr<BasisSet> old_basis,
494  std::shared_ptr<BasisSet> new_basis);
495 
497  SharedMatrix X() const;
498 
500  SharedMatrix gradient() const;
502  void set_gradient(SharedMatrix& grad);
503 
505  SharedMatrix hessian() const;
507  void set_hessian(SharedMatrix& hess);
508 
510  std::shared_ptr<std::vector<double>> atomic_point_charges()const{
511  return atomic_point_charges_;
512  }
514  std::shared_ptr<Vector> get_atomic_point_charges() const;
515 
517  void set_atomic_point_charges(const std::shared_ptr<std::vector<double>>& apcs){
519  }
520 
522  std::shared_ptr<Vector> frequencies() const;
524  void set_frequencies(std::shared_ptr<Vector>& freqs);
525 
527  std::shared_ptr<Vector> normalmodes() const;
529  void set_normalmodes(std::shared_ptr<Vector>& norms);
530 
532  void set_name(const std::string& name) { name_ = name; }
533 
535  const std::string& name() const { return name_; }
536 
537  // Set the print flag level
538  void set_print(unsigned int print) { print_ = print; }
539 
540  // Set the debug flag level
541  void set_debug(unsigned int debug) { debug_ = debug; }
542 
544  virtual void save() const;
545 
547  double get_variable(const std::string key);
548  void set_variable(const std::string key, double value) { variables_[key] = value; }
549  std::map<std::string, double> variables(void) { return variables_; }
550 
552  SharedMatrix get_array(const std::string key);
553  void set_array(const std::string key, SharedMatrix value) { arrays_[key] = value; }
554  std::map<std::string, SharedMatrix> arrays(void) { return arrays_; }
555 };
556 
557 }
558 
559 #endif
#define MAX_BC
Definition: wavefunction.h:47
double reference_energy() const
Returns the reference energy.
Definition: wavefunction.h:360
SharedMatrix S_
Overlap matrix.
Definition: wavefunction.h:171
const Dimension & frzvpi() const
Returns the frozen virtual orbitals per irrep array.
Definition: wavefunction.h:339
const Dimension & nsopi() const
Returns the number of SOs per irrep array.
Definition: wavefunction.h:329
OrbitalSpace beta_orbital_space(const std::string &id, const std::string &basis="SO", const std::string &subset="ALL")
Creates an OrbitalSpace object containing information about the request beta orbital space...
Definition: wavefunction.cc:901
std::shared_ptr< Molecule > molecule() const
Returns the molecule object that pertains to this wavefunction.
Definition: wavefunction.cc:390
Options & options() const
Definition: wavefunction.cc:400
SharedMatrix AO2SO_
AO2SO conversion matrix (AO in rows, SO in cols)
Definition: wavefunction.h:101
std::shared_ptr< Vector > epsilon_a_
Alpha orbital eneriges.
Definition: wavefunction.h:196
std::shared_ptr< PSIO > psio_
Definition: wavefunction.h:110
SharedMatrix S() const
Returns the overlap matrix.
Definition: wavefunction.h:367
SharedVector epsilon_b_subset(const std::string &basis="SO", const std::string &subset="ALL")
Definition: wavefunction.cc:931
int nmo_
Total number of MOs.
Definition: wavefunction.h:166
Dimension soccpi_
Number of singly occupied per irrep.
Definition: wavefunction.h:139
int nbeta_
Definition: wavefunction.h:131
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:395
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:58
SharedMatrix H_
Core Hamiltonian matrix.
Definition: wavefunction.h:174
SharedMatrix Cb() const
Returns the beta electrons MO coefficients.
Definition: wavefunction.cc:475
void set_name(const std::string &name)
Set the wavefunction name (e.g. &quot;RHF&quot;, &quot;ROHF&quot;, &quot;UHF&quot;, &quot;CCEnergyWavefunction&quot;)
Definition: wavefunction.h:532
std::shared_ptr< Vector > epsilon_b() const
Returns the beta orbital energies.
Definition: wavefunction.cc:961
std::shared_ptr< Vector > get_atomic_point_charges() const
Returns the atomic point charges in Vector form for python output.
Definition: wavefunction.cc:1025
Dimension frzcpi_
Number of frozen core per irrep.
Definition: wavefunction.h:141
std::vector< std::vector< int > > subset_occupation(const Dimension &noccpi, const std::string &subset)
Definition: wavefunction.cc:487
SharedMatrix Da_subset(const std::string &basis="SO")
Definition: wavefunction.cc:916
SharedMatrix get_array(const std::string key)
Get and set arrays dictionary.
Definition: wavefunction.cc:1046
std::shared_ptr< Vector > frequencies() const
Returns the frequencies.
Definition: wavefunction.cc:1001
void set_array(const std::string key, SharedMatrix value)
Definition: wavefunction.h:553
std::shared_ptr< Vector > epsilon_b_
Beta orbital energies.
Definition: wavefunction.h:198
bool same_a_b_dens() const
Definition: wavefunction.h:288
virtual std::shared_ptr< Matrix > tpdm_gradient_contribution() const
The two particle density matrix contribution to the gradient.
Definition: wavefunction.cc:951
std::shared_ptr< MatrixFactory > factory_
Matrix factory for creating standard sized matrices.
Definition: wavefunction.h:116
double efzc_
Frozen-core energy associated with this wavefunction.
Definition: wavefunction.h:161
double df[MAX_DF]
Definition: wavefunction.cc:61
const Dimension & soccpi() const
Returns the SOCC per irrep array.
Definition: wavefunction.h:327
std::shared_ptr< std::vector< double > > atomic_point_charges() const
Returns the atomic point charges.
Definition: wavefunction.h:510
SharedMatrix Lagrangian_
Lagrangian matrix.
Definition: wavefunction.h:188
double efzc() const
Returns the frozen-core energy.
Definition: wavefunction.h:362
void set_hessian(SharedMatrix &hess)
Set the Hessian for the wavefunction.
Definition: wavefunction.cc:996
std::shared_ptr< OEProp > oeprop_
Definition: wavefunction.h:120
long int memory_
How much memory you have access to.
Definition: wavefunction.h:123
std::shared_ptr< IntegralFactory > integral_
Integral factory.
Definition: wavefunction.h:113
std::shared_ptr< OEProp > get_oeprop() const
Definition: wavefunction.h:391
void set_efzc(double efzc)
Sets the frozen-core energy.
Definition: wavefunction.h:364
void set_doccpi(const Dimension &doccpi)
double energy_
The energy associated with this wavefunction.
Definition: wavefunction.h:158
bool basisset_exists(std::string label)
Definition: wavefunction.cc:435
Dimension map_irreps(const Dimension &dimpi)
Definition: wavefunction.cc:340
void set_reference_wavefunction(const std::shared_ptr< Wavefunction > wfn)
Sets the reference wavefunction.
Definition: wavefunction.cc:458
#define MAX_FAC
Definition: wavefunction.h:50
std::map< std::string, double > variables_
Definition: wavefunction.h:233
int nalpha_
Total alpha and beta electrons.
Definition: wavefunction.h:131
void set_print(unsigned int print)
Definition: wavefunction.h:538
std::shared_ptr< BasisSet > basisset() const
Returns the basis set object that pertains to this wavefunction.
Definition: wavefunction.cc:410
void set_gradient(SharedMatrix &grad)
Set the gradient for the wavefunction.
Definition: wavefunction.cc:986
void deep_copy(SharedWavefunction other)
Definition: wavefunction.cc:155
SharedMatrix Db_subset(const std::string &basis="SO")
Definition: wavefunction.cc:921
SharedMatrix basis_projection(SharedMatrix Cold, Dimension noccpi, std::shared_ptr< BasisSet > old_basis, std::shared_ptr< BasisSet > new_basis)
Definition: wavefunction.cc:758
SharedMatrix Horig_
Definition: wavefunction.h:175
SharedMatrix Ca() const
Returns the alpha electrons MO coefficients.
Definition: wavefunction.cc:463
void set_soccpi(const Dimension &soccpi)
double bc[MAX_BC][MAX_BC]
Definition: wavefunction.cc:62
bool same_a_b_dens_
Same orbs or dens.
Definition: wavefunction.h:229
std::shared_ptr< Vector > normalmodes_
If normal modes are available, they will be here:
Definition: wavefunction.h:226
SharedMatrix F_subset_helper(SharedMatrix F, SharedMatrix C, const std::string &basis)
Definition: wavefunction.cc:619
const Dimension & nmopi() const
Returns the number of MOs per irrep array.
Definition: wavefunction.h:331
#define MAX_DF
Definition: wavefunction.h:44
static void initialize_singletons()
Definition: wavefunction.cc:362
std::map< std::string, double > variables(void)
Definition: wavefunction.h:549
void shallow_copy(SharedWavefunction other)
Definition: wavefunction.cc:90
SharedMatrix Cb_subset(const std::string &basis="SO", const std::string &subset="ALL")
Definition: wavefunction.cc:911
const SharedMatrix Da() const
Returns the alpha OPDM for the wavefunction.
Definition: wavefunction.cc:966
int nfrzc_
Total frozen core orbitals.
Definition: wavefunction.h:134
int nalpha() const
Return the number of alpha electrons.
Definition: wavefunction.h:350
void set_basisset(std::string label, std::shared_ptr< BasisSet > basis)
Definition: wavefunction.cc:426
int nso_
Total number of SOs.
Definition: wavefunction.h:164
std::shared_ptr< std::vector< double > > atomic_point_charges_
If atomic point charges are available they will be here.
Definition: wavefunction.h:220
SharedMatrix Ca_
Alpha MO coefficients.
Definition: wavefunction.h:178
virtual ~Wavefunction()
Definition: wavefunction.cc:86
SharedMatrix Cb_
Beta MO coefficients.
Definition: wavefunction.h:180
std::shared_ptr< Vector > normalmodes() const
Returns the normalmodes.
Definition: wavefunction.cc:1006
void common_init()
Definition: wavefunction.cc:229
std::string name_
Name of the wavefunction.
Definition: wavefunction.h:89
const Dimension & doccpi() const
Returns the DOCC per irrep array.
Definition: wavefunction.h:325
bool density_fitted_
Whether this wavefunction was obtained using density fitting.
Definition: wavefunction.h:155
std::shared_ptr< MatrixFactory > matrix_factory() const
Returns the MatrixFactory object that pertains to this wavefunction.
Definition: wavefunction.cc:448
SharedMatrix hessian_
If a Hessian is available it will be here:
Definition: wavefunction.h:208
std::shared_ptr< Wavefunction > reference_wavefunction_
Definition: wavefunction.h:118
double get_variable(const std::string key)
Get and set variables dictionary.
Definition: wavefunction.cc:1035
Options & options_
Options object.
Definition: wavefunction.h:107
SharedMatrix gradient() const
Returns the gradient.
Definition: wavefunction.cc:981
void set_frequencies(std::shared_ptr< Vector > &freqs)
Set the frequencies for the wavefunction.
Definition: wavefunction.cc:1011
Definition: dimension.h:39
SharedMatrix hessian() const
Returns the Hessian.
Definition: wavefunction.cc:991
virtual SharedMatrix compute_hessian()
Compute Hessian. Subclasses override this function to compute the Hessian.
Definition: wavefunction.h:284
std::shared_ptr< IntegralFactory > integral() const
An integral factory with basisset() on each center.
Definition: wavefunction.cc:405
void set_debug(unsigned int debug)
Definition: wavefunction.h:541
SharedMatrix H() const
Returns the core Hamiltonian matrix.
Definition: wavefunction.h:370
std::shared_ptr< BasisSet > get_basisset(std::string label)
Getters and setters for other basis sets.
Definition: wavefunction.cc:414
Definition: liboptions.h:359
unsigned int print_
Print flag.
Definition: wavefunction.h:128
std::shared_ptr< Matrix > tpdm_gradient_contribution_
The TPDM contribution to the gradient.
Definition: wavefunction.h:211
int nso() const
Returns the number of SOs.
Definition: wavefunction.h:354
virtual double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: wavefunction.h:278
std::shared_ptr< BasisSet > basisset_
The ORBITAL basis.
Definition: wavefunction.h:95
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
std::shared_ptr< Wavefunction > wfn
Definition: dx_write.cc:59
double fac[MAX_FAC]
Definition: wavefunction.cc:63
std::shared_ptr< Wavefunction > reference_wavefunction() const
Returns the reference wavefunction.
Definition: wavefunction.cc:453
SharedVector epsilon_subset_helper(SharedVector epsilon, const Dimension &noccpi, const std::string &basis, const std::string &subset)
Definition: wavefunction.cc:575
Simple wavefunction base class.
Definition: wavefunction.h:85
SharedMatrix D_subset_helper(SharedMatrix D, SharedMatrix C, const std::string &basis)
Definition: wavefunction.cc:676
std::shared_ptr< Vector > epsilon_a() const
Returns the alpha orbital energies.
Definition: wavefunction.cc:956
bool same_a_b_orbs_
Definition: wavefunction.h:230
#define MAX_IOFF
Definition: wavefunction.h:41
void set_normalmodes(std::shared_ptr< Vector > &norms)
Set the normalmodes for the wavefunction.
Definition: wavefunction.cc:1016
std::map< std::string, std::shared_ptr< BasisSet > > basissets_
DF/RI/F12/etc basis sets.
Definition: wavefunction.h:92
Dimension frzvpi_
Number of frozen virtuals per irrep.
Definition: wavefunction.h:143
Wavefunction(std::shared_ptr< Molecule > molecule, std::shared_ptr< BasisSet > basis, Options &options)
Constructor for an entirely new wavefunction with an existing basis.
Definition: wavefunction.cc:65
std::shared_ptr< Molecule > molecule_
Molecule that this wavefunction is run on.
Definition: wavefunction.h:104
void set_oeprop(std::shared_ptr< OEProp > oeprop)
Definition: wavefunction.h:392
int nfrzc() const
Return the number of frozen core orbitals.
Definition: wavefunction.h:348
int nmo() const
Returns the number of MOs.
Definition: wavefunction.h:356
virtual void save() const
Save the wavefunction to checkpoint.
Definition: wavefunction.cc:1021
SharedMatrix Fa_
Alpha Fock matrix.
Definition: wavefunction.h:191
void set_variable(const std::string key, double value)
Definition: wavefunction.h:548
std::shared_ptr< SOBasisSet > sobasisset_
Primary basis set for SO integrals.
Definition: wavefunction.h:98
unsigned int debug_
Debug flag.
Definition: wavefunction.h:126
std::vector< void * > postcallbacks_
Definition: wavefunction.h:202
const Dimension & nbetapi() const
Returns the number of beta electrons per irrep array.
Definition: wavefunction.h:335
SharedMatrix Da_
Alpha density matrix.
Definition: wavefunction.h:183
std::shared_ptr< Vector > frequencies_
If frequencies are available, they will be here:
Definition: wavefunction.h:223
const std::string & name() const
Returns the wavefunction name.
Definition: wavefunction.h:535
The OrbitalSpace class.
Definition: orbitalspace.h:47
int nbeta() const
Return the number of beta electrons.
Definition: wavefunction.h:352
void set_atomic_point_charges(const std::shared_ptr< std::vector< double >> &apcs)
Sets the atomic point charges.
Definition: wavefunction.h:517
SharedVector epsilon_a_subset(const std::string &basis="SO", const std::string &subset="ALL")
Definition: wavefunction.cc:926
std::shared_ptr< SOBasisSet > sobasisset() const
Returns the SO basis set object that pertains to this wavefunction.
Definition: wavefunction.cc:443
bool density_fitted() const
Returns whether this wavefunction was obtained using density fitting or not.
Definition: wavefunction.h:320
int nirrep_
Number of irreps.
Definition: wavefunction.h:168
EXTERN int * ioff
Definition: ccresponse/globals.h:46
void set_frzvpi(const Dimension &frzvpi)
Sets the frozen virtual orbitals per irrep array.
Definition: wavefunction.h:345
SharedMatrix aotoso() const
Definition: wavefunction.h:389
bool same_a_b_orbs() const
Is this a restricted wavefunction?
Definition: wavefunction.h:287
const Dimension & nalphapi() const
Returns the number of alpha electrons per irrep array.
Definition: wavefunction.h:333
SharedMatrix Db_
Beta density matrix.
Definition: wavefunction.h:185
const Dimension & frzcpi() const
Returns the frozen core orbitals per irrep array.
Definition: wavefunction.h:337
Dimension nmopi_
Number of mo per irrep.
Definition: wavefunction.h:152
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:50
std::map< std::string, SharedMatrix > arrays_
Definition: wavefunction.h:234
SharedMatrix Fb_
Beta Fock matrix.
Definition: wavefunction.h:193
Dimension nbetapi_
Number of beta electrons per irrep.
Definition: wavefunction.h:147
std::vector< void * > precallbacks_
Definition: wavefunction.h:201
#define PSIEXCEPTION(message)
Definition: exception.h:47
SharedMatrix Ca_subset(const std::string &basis="SO", const std::string &subset="ALL")
Definition: wavefunction.cc:906
Dimension nalphapi_
Number of alpha electrons per irrep.
Definition: wavefunction.h:145
SharedMatrix Db() const
Returns the beta OPDM for the wavefunction.
Definition: wavefunction.cc:971
int nirrep() const
Returns the number of irreps.
Definition: wavefunction.h:358
SharedMatrix Fa() const
Returns the (SO basis) alpha Fock matrix.
Definition: wavefunction.cc:936
SharedMatrix X() const
Returns the Lagrangian in SO basis for the wavefunction.
Definition: wavefunction.cc:976
OrbitalSpace alpha_orbital_space(const std::string &id, const std::string &basis="SO", const std::string &subset="ALL")
Creates an OrbitalSpace object containing information about the request alpha orbital space...
Definition: wavefunction.cc:896
virtual SharedMatrix compute_gradient()
Compute gradient. Subclasses override this function to compute the gradient.
Definition: wavefunction.h:281
std::shared_ptr< Vector > SharedVector
Definition: adc.h:52
Dimension nsopi_
Number of so per irrep.
Definition: wavefunction.h:150
SharedMatrix Fb() const
Returns the (SO basis) beta Fock matrix.
Definition: wavefunction.cc:941
std::map< std::string, SharedMatrix > arrays(void)
Definition: wavefunction.h:554
SharedMatrix gradient_
If a gradient is available it will be here:
Definition: wavefunction.h:205
std::shared_ptr< Matrix > Lagrangian() const
Returns the SO basis Lagrangian.
Definition: wavefunction.cc:946
SharedMatrix C_subset_helper(SharedMatrix C, const Dimension &noccpi, SharedVector epsilon, const std::string &basis, const std::string &subset)
Helpers for C/D/epsilon transformers.
Definition: wavefunction.cc:525
static const long double epsilon
Definition: utility.cc:45
Dimension doccpi_
Number of doubly occupied per irrep.
Definition: wavefunction.h:137