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 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 
29 #ifndef _psi_src_lib_libmints_wavefunction_h
30 #define _psi_src_lib_libmints_wavefunction_h
31 
32 #include "typedefs.h"
36 
37 #include "psi4/pybind11.h"
38 #include <stddef.h>
39 #include <vector>
40 #include <memory>
41 
42 #define MAX_IOFF 30000
43 extern size_t ioff[MAX_IOFF];
44 
45 #define MAX_DF 500
46 extern double df[MAX_DF];
47 
48 #define MAX_BC 20
49 extern double bc[MAX_BC][MAX_BC];
50 
51 #define MAX_FAC 100
52 extern double fac[MAX_FAC];
53 
54 #if !defined( EXPLICIT_IOFF )
55 # define EXPLICIT_IOFF(i) ( (i) * ((i) + 1) / 2 )
56 #endif
57 
58 #if !defined( INDEX2 )
59 # define INDEX2(i, j) ( (i) >= (j) ? EXPLICIT_IOFF(i) + (j) : EXPLICIT_IOFF(j) + (i) )
60 #endif
61 
62 #if !defined( INDEX4 )
63 # define INDEX4(i, j, k, l) ( INDEX2( INDEX2((i), (j)), INDEX2((k), (l)) ) )
64 #endif
65 
66 
67 namespace psi {
68 
69 class Molecule;
70 class BasisSet;
71 class IntegralFactory;
72 class Matrix;
73 class Vector;
74 class MatrixFactory;
75 class Options;
76 class SOBasisSet;
77 class PSIO;
78 class OrbitalSpace;
79 
84 class Wavefunction : public std::enable_shared_from_this<Wavefunction>
85 {
86 protected:
88  std::string name_;
89 
91  std::map<std::string, std::shared_ptr<BasisSet>> basissets_;
92 
94  std::shared_ptr<BasisSet> basisset_;
95 
97  std::shared_ptr<SOBasisSet> sobasisset_;
98 
101 
103  std::shared_ptr<Molecule> molecule_;
104 
107 
108  // PSI file access variables
109  std::shared_ptr<PSIO> psio_;
110 
112  std::shared_ptr<IntegralFactory> integral_;
113 
115  std::shared_ptr<MatrixFactory> factory_;
116 
117  std::shared_ptr<Wavefunction> reference_wavefunction_;
118 
120  long int memory_;
121 
123  unsigned int debug_;
125  unsigned int print_;
126 
129 
131  int nfrzc_;
132 
145 
150 
153 
155  double energy_;
156 
158  double efzc_;
159 
161  int nso_;
163  int nmo_;
165  int nirrep_;
166 
169 
173 
178 
183 
186 
191 
193  std::shared_ptr<Vector> epsilon_a_;
195  std::shared_ptr<Vector> epsilon_b_;
196 
197  // Callback routines to Python
198  std::vector<void*> precallbacks_;
199  std::vector<void*> postcallbacks_;
200 
203 
206 
208  std::shared_ptr<Matrix> tpdm_gradient_contribution_;
209 
211  SharedMatrix C_subset_helper(SharedMatrix C, const Dimension& noccpi, SharedVector epsilon, const std::string& basis, const std::string& subset);
212  SharedMatrix F_subset_helper(SharedMatrix F, SharedMatrix C, const std::string& basis);
213  SharedVector epsilon_subset_helper(SharedVector epsilon, const Dimension& noccpi, const std::string& basis, const std::string& subset);
214  std::vector<std::vector<int> > subset_occupation(const Dimension& noccpi, const std::string& subset);
215 
217  std::shared_ptr<std::vector<double>> atomic_point_charges_;
218 
220  std::shared_ptr<Vector> frequencies_;
221 
223  std::shared_ptr<Vector> normalmodes_;
224 
228 
229  // Collection of variables
230  std::map<std::string, double> variables_;
231  std::map<std::string, SharedMatrix> arrays_;
232 
233 private:
234  // Wavefunction() {}
235  void common_init();
236 
237 public:
238 
240  Wavefunction(std::shared_ptr<Molecule> molecule,
241  std::shared_ptr<BasisSet> basis,
242  Options& options);
243 
245  Wavefunction(std::shared_ptr<Molecule> molecule,
246  std::shared_ptr<BasisSet> basis);
247 
250 
259  void shallow_copy(SharedWavefunction other);
260  void shallow_copy(const Wavefunction* other);
261 
269  void deep_copy(SharedWavefunction other);
270  void deep_copy(const Wavefunction* other);
271 
272  virtual ~Wavefunction();
273 
275  virtual double compute_energy() {throw PSIEXCEPTION("Compute energy has not been implemented for this wavefunction.");}
276 
278  virtual SharedMatrix compute_gradient() {throw PSIEXCEPTION("Analytic gradients are not available for this wavefunction.");}
279 
281  virtual SharedMatrix compute_hessian() {throw PSIEXCEPTION("Analytic Hessians are not available for this wavefunction.");}
282 
284  bool same_a_b_orbs() const { return same_a_b_orbs_; }
285  bool same_a_b_dens() const { return same_a_b_dens_; }
286 
289  Dimension map_irreps(const Dimension &dimpi);
290 
292  std::shared_ptr<Molecule> molecule() const;
293  std::shared_ptr<PSIO> psio() const;
294  Options& options() const;
295 
297  std::shared_ptr<IntegralFactory> integral() const;
299  std::shared_ptr<BasisSet> basisset() const;
301  std::shared_ptr<SOBasisSet> sobasisset() const;
302 
304  std::shared_ptr<BasisSet> get_basisset(std::string label);
305  void set_basisset(std::string label, std::shared_ptr<BasisSet> basis);
306  bool basisset_exists(std::string label);
307 
308 
310  std::shared_ptr<MatrixFactory> matrix_factory() const;
312  std::shared_ptr<Wavefunction> reference_wavefunction() const;
314  void set_reference_wavefunction(const std::shared_ptr<Wavefunction> wfn);
315 
317  bool density_fitted() const { return density_fitted_; }
318 
320  int get_print() const { return print_; }
321  static void initialize_singletons();
322 
324  const Dimension& doccpi() const { return doccpi_; }
326  const Dimension& soccpi() const { return soccpi_; }
328  const Dimension& nsopi() const { return nsopi_; }
330  const Dimension& nmopi() const { return nmopi_; }
332  const Dimension& nalphapi() const { return nalphapi_; }
334  const Dimension& nbetapi() const { return nbetapi_; }
336  const Dimension& frzcpi() const { return frzcpi_; }
338  const Dimension& frzvpi() const { return frzvpi_; }
339 
340  void set_doccpi(const Dimension& doccpi);
341  void set_soccpi(const Dimension& soccpi);
342 
344  void set_frzvpi(const Dimension& frzvpi);
345 
347  int nfrzc() const { return nfrzc_; }
349  int nalpha() const { return nalpha_; }
351  int nbeta() const { return nbeta_; }
353  int nso() const { return nso_; }
355  int nmo() const { return nmo_; }
357  int nirrep() const { return nirrep_; }
359  double reference_energy () const { return energy_; }
361  double efzc() const { return efzc_; }
363  void set_efzc(double efzc) { efzc_ = efzc; }
364 
366  SharedMatrix S() const { return S_; }
367 
369  SharedMatrix H() const { return H_; }
370 
372  SharedMatrix Ca() const;
374  SharedMatrix Cb() const;
376  SharedMatrix Fa() const;
378  SharedMatrix Fb() const;
380  std::shared_ptr<Vector> epsilon_a() const;
382  std::shared_ptr<Vector> epsilon_b() const;
384  std::shared_ptr<Matrix> Lagrangian() const;
386  virtual std::shared_ptr<Matrix> tpdm_gradient_contribution() const;
387 
388  SharedMatrix aotoso() const { return AO2SO_; }
389 
391  const SharedMatrix Da() const;
393  SharedMatrix Db() const;
394 
403  SharedMatrix Ca_subset(const std::string& basis = "SO", const std::string& subset = "ALL");
404 
413  SharedMatrix Cb_subset(const std::string& basis = "SO", const std::string& subset = "ALL");
414 
424  OrbitalSpace alpha_orbital_space(const std::string& id, const std::string& basis = "SO", const std::string& subset = "ALL");
434  OrbitalSpace beta_orbital_space(const std::string& id, const std::string& basis = "SO", const std::string& subset = "ALL");
435 
442  SharedMatrix Da_subset(const std::string& basis = "SO");
443 
450  SharedMatrix Db_subset(const std::string& basis = "SO");
451 
460  SharedMatrix D_subset_helper(SharedMatrix D, SharedMatrix C, const std::string& basis);
461 
469  SharedVector epsilon_a_subset(const std::string& basis = "SO", const std::string& subset = "ALL");
470 
478  SharedVector epsilon_b_subset(const std::string& basis = "SO", const std::string& subset = "ALL");
479 
489  std::shared_ptr<BasisSet> old_basis,
490  std::shared_ptr<BasisSet> new_basis);
491 
493  SharedMatrix X() const;
494 
496  SharedMatrix gradient() const;
498  void set_gradient(SharedMatrix& grad);
499 
501  SharedMatrix hessian() const;
503  void set_hessian(SharedMatrix& hess);
504 
506  std::shared_ptr<std::vector<double>> atomic_point_charges()const{
507  return atomic_point_charges_;
508  }
510  std::shared_ptr<Vector> get_atomic_point_charges() const;
511 
513  void set_atomic_point_charges(const std::shared_ptr<std::vector<double>>& apcs){
515  }
516 
518  std::shared_ptr<Vector> frequencies() const;
520  void set_frequencies(std::shared_ptr<Vector>& freqs);
521 
523  std::shared_ptr<Vector> normalmodes() const;
525  void set_normalmodes(std::shared_ptr<Vector>& norms);
526 
528  void set_name(const std::string& name) { name_ = name; }
529 
531  const std::string& name() const { return name_; }
532 
533  // Set the print flag level
534  void set_print(unsigned int print) { print_ = print; }
535 
536  // Set the debug flag level
537  void set_debug(unsigned int debug) { debug_ = debug; }
538 
540  virtual void save() const;
541 
543  double get_variable(const std::string key);
544  void set_variable(const std::string key, double value) { variables_[key] = value; }
545  std::map<std::string, double> variables(void) { return variables_; }
546 
548  SharedMatrix get_array(const std::string key);
549  void set_array(const std::string key, SharedMatrix value) { arrays_[key] = value; }
550  std::map<std::string, SharedMatrix> arrays(void) { return arrays_; }
551 };
552 
553 }
554 
555 #endif
#define MAX_BC
Definition: wavefunction.h:48
double reference_energy() const
Returns the reference energy.
Definition: wavefunction.h:359
SharedMatrix S_
Overlap matrix.
Definition: wavefunction.h:168
const Dimension & frzvpi() const
Returns the frozen virtual orbitals per irrep array.
Definition: wavefunction.h:338
const Dimension & nsopi() const
Returns the number of SOs per irrep array.
Definition: wavefunction.h:328
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:904
std::shared_ptr< Molecule > molecule() const
Returns the molecule object that pertains to this wavefunction.
Definition: wavefunction.cc:386
Options & options() const
Definition: wavefunction.cc:396
SharedMatrix AO2SO_
AO2SO conversion matrix (AO in rows, SO in cols)
Definition: wavefunction.h:100
std::shared_ptr< Vector > epsilon_a_
Alpha orbital eneriges.
Definition: wavefunction.h:193
std::shared_ptr< PSIO > psio_
Definition: wavefunction.h:109
SharedMatrix S() const
Returns the overlap matrix.
Definition: wavefunction.h:366
SharedVector epsilon_b_subset(const std::string &basis="SO", const std::string &subset="ALL")
Definition: wavefunction.cc:934
int nmo_
Total number of MOs.
Definition: wavefunction.h:163
Dimension soccpi_
Number of singly occupied per irrep.
Definition: wavefunction.h:136
int nbeta_
Definition: wavefunction.h:128
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:391
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:59
SharedMatrix H_
Core Hamiltonian matrix.
Definition: wavefunction.h:171
void set_frzvpi(const Dimension &frzvpi)
Sets the frozen virtual orbitals per irrep array.
Definition: wavefunction.cc:460
SharedMatrix Cb() const
Returns the beta electrons MO coefficients.
Definition: wavefunction.cc:478
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:528
std::shared_ptr< Vector > epsilon_b() const
Returns the beta orbital energies.
Definition: wavefunction.cc:964
std::shared_ptr< Vector > get_atomic_point_charges() const
Returns the atomic point charges in Vector form for python output.
Definition: wavefunction.cc:1028
Dimension frzcpi_
Number of frozen core per irrep.
Definition: wavefunction.h:138
std::vector< std::vector< int > > subset_occupation(const Dimension &noccpi, const std::string &subset)
Definition: wavefunction.cc:490
SharedMatrix Da_subset(const std::string &basis="SO")
Definition: wavefunction.cc:919
SharedMatrix get_array(const std::string key)
Get and set arrays dictionary.
Definition: wavefunction.cc:1049
std::shared_ptr< Vector > frequencies() const
Returns the frequencies.
Definition: wavefunction.cc:1004
void set_array(const std::string key, SharedMatrix value)
Definition: wavefunction.h:549
std::shared_ptr< Vector > epsilon_b_
Beta orbital energies.
Definition: wavefunction.h:195
bool same_a_b_dens() const
Definition: wavefunction.h:285
virtual std::shared_ptr< Matrix > tpdm_gradient_contribution() const
The two particle density matrix contribution to the gradient.
Definition: wavefunction.cc:954
std::shared_ptr< MatrixFactory > factory_
Matrix factory for creating standard sized matrices.
Definition: wavefunction.h:115
double efzc_
Frozen-core energy associated with this wavefunction.
Definition: wavefunction.h:158
double df[MAX_DF]
Definition: wavefunction.cc:62
const Dimension & soccpi() const
Returns the SOCC per irrep array.
Definition: wavefunction.h:326
std::shared_ptr< std::vector< double > > atomic_point_charges() const
Returns the atomic point charges.
Definition: wavefunction.h:506
SharedMatrix Lagrangian_
Lagrangian matrix.
Definition: wavefunction.h:185
double efzc() const
Returns the frozen-core energy.
Definition: wavefunction.h:361
void set_hessian(SharedMatrix &hess)
Set the Hessian for the wavefunction.
Definition: wavefunction.cc:999
long int memory_
How much memory you have access to.
Definition: wavefunction.h:120
std::shared_ptr< IntegralFactory > integral_
Integral factory.
Definition: wavefunction.h:112
void set_efzc(double efzc)
Sets the frozen-core energy.
Definition: wavefunction.h:363
void set_doccpi(const Dimension &doccpi)
double energy_
The energy associated with this wavefunction.
Definition: wavefunction.h:155
bool basisset_exists(std::string label)
Definition: wavefunction.cc:432
Dimension map_irreps(const Dimension &dimpi)
Definition: wavefunction.cc:336
void set_reference_wavefunction(const std::shared_ptr< Wavefunction > wfn)
Sets the reference wavefunction.
Definition: wavefunction.cc:455
#define MAX_FAC
Definition: wavefunction.h:51
int get_print() const
Returns the print level.
Definition: wavefunction.h:320
std::map< std::string, double > variables_
Definition: wavefunction.h:230
int nalpha_
Total alpha and beta electrons.
Definition: wavefunction.h:128
void set_print(unsigned int print)
Definition: wavefunction.h:534
std::shared_ptr< BasisSet > basisset() const
Returns the basis set object that pertains to this wavefunction.
Definition: wavefunction.cc:406
void set_gradient(SharedMatrix &grad)
Set the gradient for the wavefunction.
Definition: wavefunction.cc:989
void deep_copy(SharedWavefunction other)
Definition: wavefunction.cc:153
SharedMatrix Db_subset(const std::string &basis="SO")
Definition: wavefunction.cc:924
SharedMatrix basis_projection(SharedMatrix Cold, Dimension noccpi, std::shared_ptr< BasisSet > old_basis, std::shared_ptr< BasisSet > new_basis)
Definition: wavefunction.cc:761
SharedMatrix Horig_
Definition: wavefunction.h:172
SharedMatrix Ca() const
Returns the alpha electrons MO coefficients.
Definition: wavefunction.cc:466
void set_soccpi(const Dimension &soccpi)
double bc[MAX_BC][MAX_BC]
Definition: wavefunction.cc:63
bool same_a_b_dens_
Same orbs or dens.
Definition: wavefunction.h:226
std::shared_ptr< Vector > normalmodes_
If normal modes are available, they will be here:
Definition: wavefunction.h:223
SharedMatrix F_subset_helper(SharedMatrix F, SharedMatrix C, const std::string &basis)
Definition: wavefunction.cc:622
const Dimension & nmopi() const
Returns the number of MOs per irrep array.
Definition: wavefunction.h:330
#define MAX_DF
Definition: wavefunction.h:45
static void initialize_singletons()
Definition: wavefunction.cc:358
std::map< std::string, double > variables(void)
Definition: wavefunction.h:545
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:914
const SharedMatrix Da() const
Returns the alpha OPDM for the wavefunction.
Definition: wavefunction.cc:969
int nfrzc_
Total frozen core orbitals.
Definition: wavefunction.h:131
int nalpha() const
Return the number of alpha electrons.
Definition: wavefunction.h:349
void set_basisset(std::string label, std::shared_ptr< BasisSet > basis)
Definition: wavefunction.cc:423
int nso_
Total number of SOs.
Definition: wavefunction.h:161
std::shared_ptr< std::vector< double > > atomic_point_charges_
If atomic point charges are available they will be here.
Definition: wavefunction.h:217
SharedMatrix Ca_
Alpha MO coefficients.
Definition: wavefunction.h:175
virtual ~Wavefunction()
Definition: wavefunction.cc:86
SharedMatrix Cb_
Beta MO coefficients.
Definition: wavefunction.h:177
std::shared_ptr< Vector > normalmodes() const
Returns the normalmodes.
Definition: wavefunction.cc:1009
void common_init()
Definition: wavefunction.cc:225
std::string name_
Name of the wavefunction.
Definition: wavefunction.h:88
const Dimension & doccpi() const
Returns the DOCC per irrep array.
Definition: wavefunction.h:324
bool density_fitted_
Whether this wavefunction was obtained using density fitting.
Definition: wavefunction.h:152
std::shared_ptr< MatrixFactory > matrix_factory() const
Returns the MatrixFactory object that pertains to this wavefunction.
Definition: wavefunction.cc:445
SharedMatrix hessian_
If a Hessian is available it will be here:
Definition: wavefunction.h:205
std::shared_ptr< Wavefunction > reference_wavefunction_
Definition: wavefunction.h:117
double get_variable(const std::string key)
Get and set variables dictionary.
Definition: wavefunction.cc:1038
Options & options_
Options object.
Definition: wavefunction.h:106
SharedMatrix gradient() const
Returns the gradient.
Definition: wavefunction.cc:984
void set_frequencies(std::shared_ptr< Vector > &freqs)
Set the frequencies for the wavefunction.
Definition: wavefunction.cc:1014
Definition: dimension.h:38
SharedMatrix hessian() const
Returns the Hessian.
Definition: wavefunction.cc:994
virtual SharedMatrix compute_hessian()
Compute Hessian. Subclasses override this function to compute the Hessian.
Definition: wavefunction.h:281
std::shared_ptr< IntegralFactory > integral() const
An integral factory with basisset() on each center.
Definition: wavefunction.cc:401
void set_debug(unsigned int debug)
Definition: wavefunction.h:537
SharedMatrix H() const
Returns the core Hamiltonian matrix.
Definition: wavefunction.h:369
std::shared_ptr< BasisSet > get_basisset(std::string label)
Getters and setters for other basis sets.
Definition: wavefunction.cc:411
Definition: liboptions.h:360
unsigned int print_
Print flag.
Definition: wavefunction.h:125
std::shared_ptr< Matrix > tpdm_gradient_contribution_
The TPDM contribution to the gradient.
Definition: wavefunction.h:208
int nso() const
Returns the number of SOs.
Definition: wavefunction.h:353
virtual double compute_energy()
Compute energy. Subclasses override this function to compute its energy.
Definition: wavefunction.h:275
std::shared_ptr< BasisSet > basisset_
The ORBITAL basis.
Definition: wavefunction.h:94
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
std::shared_ptr< Wavefunction > wfn
Definition: dx_write.cc:60
double fac[MAX_FAC]
Definition: wavefunction.cc:64
std::shared_ptr< Wavefunction > reference_wavefunction() const
Returns the reference wavefunction.
Definition: wavefunction.cc:450
SharedVector epsilon_subset_helper(SharedVector epsilon, const Dimension &noccpi, const std::string &basis, const std::string &subset)
Definition: wavefunction.cc:578
Simple wavefunction base class.
Definition: wavefunction.h:84
SharedMatrix D_subset_helper(SharedMatrix D, SharedMatrix C, const std::string &basis)
Definition: wavefunction.cc:679
std::shared_ptr< Vector > epsilon_a() const
Returns the alpha orbital energies.
Definition: wavefunction.cc:959
bool same_a_b_orbs_
Definition: wavefunction.h:227
#define MAX_IOFF
Definition: wavefunction.h:42
void set_normalmodes(std::shared_ptr< Vector > &norms)
Set the normalmodes for the wavefunction.
Definition: wavefunction.cc:1019
std::map< std::string, std::shared_ptr< BasisSet > > basissets_
DF/RI/F12/etc basis sets.
Definition: wavefunction.h:91
Dimension frzvpi_
Number of frozen virtuals per irrep.
Definition: wavefunction.h:140
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:66
std::shared_ptr< Molecule > molecule_
Molecule that this wavefunction is run on.
Definition: wavefunction.h:103
int nfrzc() const
Return the number of frozen core orbitals.
Definition: wavefunction.h:347
int nmo() const
Returns the number of MOs.
Definition: wavefunction.h:355
virtual void save() const
Save the wavefunction to checkpoint.
Definition: wavefunction.cc:1024
SharedMatrix Fa_
Alpha Fock matrix.
Definition: wavefunction.h:188
void set_variable(const std::string key, double value)
Definition: wavefunction.h:544
std::shared_ptr< SOBasisSet > sobasisset_
Primary basis set for SO integrals.
Definition: wavefunction.h:97
unsigned int debug_
Debug flag.
Definition: wavefunction.h:123
std::vector< void * > postcallbacks_
Definition: wavefunction.h:199
const Dimension & nbetapi() const
Returns the number of beta electrons per irrep array.
Definition: wavefunction.h:334
SharedMatrix Da_
Alpha density matrix.
Definition: wavefunction.h:180
std::shared_ptr< Vector > frequencies_
If frequencies are available, they will be here:
Definition: wavefunction.h:220
const std::string & name() const
Returns the wavefunction name.
Definition: wavefunction.h:531
The OrbitalSpace class.
Definition: orbitalspace.h:48
int nbeta() const
Return the number of beta electrons.
Definition: wavefunction.h:351
void set_atomic_point_charges(const std::shared_ptr< std::vector< double >> &apcs)
Sets the atomic point charges.
Definition: wavefunction.h:513
SharedVector epsilon_a_subset(const std::string &basis="SO", const std::string &subset="ALL")
Definition: wavefunction.cc:929
std::shared_ptr< SOBasisSet > sobasisset() const
Returns the SO basis set object that pertains to this wavefunction.
Definition: wavefunction.cc:440
bool density_fitted() const
Returns whether this wavefunction was obtained using density fitting or not.
Definition: wavefunction.h:317
int nirrep_
Number of irreps.
Definition: wavefunction.h:165
EXTERN int * ioff
Definition: ccresponse/globals.h:47
SharedMatrix aotoso() const
Definition: wavefunction.h:388
bool same_a_b_orbs() const
Is this a restricted wavefunction?
Definition: wavefunction.h:284
const Dimension & nalphapi() const
Returns the number of alpha electrons per irrep array.
Definition: wavefunction.h:332
SharedMatrix Db_
Beta density matrix.
Definition: wavefunction.h:182
const Dimension & frzcpi() const
Returns the frozen core orbitals per irrep array.
Definition: wavefunction.h:336
Dimension nmopi_
Number of mo per irrep.
Definition: wavefunction.h:149
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:52
std::map< std::string, SharedMatrix > arrays_
Definition: wavefunction.h:231
SharedMatrix Fb_
Beta Fock matrix.
Definition: wavefunction.h:190
Dimension nbetapi_
Number of beta electrons per irrep.
Definition: wavefunction.h:144
std::vector< void * > precallbacks_
Definition: wavefunction.h:198
#define PSIEXCEPTION(message)
Definition: exception.h:48
SharedMatrix Ca_subset(const std::string &basis="SO", const std::string &subset="ALL")
Definition: wavefunction.cc:909
Dimension nalphapi_
Number of alpha electrons per irrep.
Definition: wavefunction.h:142
SharedMatrix Db() const
Returns the beta OPDM for the wavefunction.
Definition: wavefunction.cc:974
int nirrep() const
Returns the number of irreps.
Definition: wavefunction.h:357
SharedMatrix Fa() const
Returns the (SO basis) alpha Fock matrix.
Definition: wavefunction.cc:939
SharedMatrix X() const
Returns the Lagrangian in SO basis for the wavefunction.
Definition: wavefunction.cc:979
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:899
virtual SharedMatrix compute_gradient()
Compute gradient. Subclasses override this function to compute the gradient.
Definition: wavefunction.h:278
std::shared_ptr< Vector > SharedVector
Definition: adc.h:51
Dimension nsopi_
Number of so per irrep.
Definition: wavefunction.h:147
SharedMatrix Fb() const
Returns the (SO basis) beta Fock matrix.
Definition: wavefunction.cc:944
std::map< std::string, SharedMatrix > arrays(void)
Definition: wavefunction.h:550
SharedMatrix gradient_
If a gradient is available it will be here:
Definition: wavefunction.h:202
std::shared_ptr< Matrix > Lagrangian() const
Returns the SO basis Lagrangian.
Definition: wavefunction.cc:949
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:528
static const long double epsilon
Definition: utility.cc:46
Dimension doccpi_
Number of doubly occupied per irrep.
Definition: wavefunction.h:134