---
name: "sc_SCF"
section: "3"
platform: "linux"
package: "libsc-doc"
version: "2.3.1-22"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/sc_SCF"
---

# sc\_SCF(3)

The SCF class is the base for all classes that use a self-consistent field procedure to solve an effective one body problem.

## NAME

sc::SCF - The **SCF** class is the base for all classes that use a self-consistent field procedure to solve an effective one body problem.

## SYNOPSIS

`#include <scf.h>`

Inherits **sc::OneBodyWavefunction**.

Inherited by **sc::CLSCF**, **sc::HSOSSCF**, **sc::OSSSCF**, **sc::TCSCF**, and **sc::UnrestrictedSCF**.

### Public Member Functions

**SCF** (**StateIn** &)\
 **SCF** (const **Ref**\< **KeyVal** \> &)\
 The **KeyVal** constructor.  void **save\_data\_state** (**StateOut** &)\
 Save the base classes (with save\_data\_state) and the members in the same order that the **StateIn** CTOR initializes them.  **RefSCMatrix** **oso\_eigenvectors** ()\
 Returns the orthogonal MO (columns) to orthogonal-SO (rows) transformation matrix.  **RefDiagSCMatrix** **eigenvalues** ()\
 Returns the MO basis eigenvalues.  int **spin\_unrestricted** ()\
 Return 1 if the alpha orbitals are not equal to the beta orbitals.  virtual int **n\_fock\_matrices** () const =0\
 virtual **RefSymmSCMatrix** **fock** (int)=0\
 virtual **RefSymmSCMatrix** **effective\_fock** ()=0\
 virtual double **one\_body\_energy** ()\
 virtual void **two\_body\_energy** (double &ec, double &ex)\
 void **symmetry\_changed** ()\
 Call this if you have changed the molecular symmetry of the molecule contained by this **MolecularEnergy**.  void **obsolete** ()\
 Marks all results as being out of date.  void **print** (std::ostream &o=**ExEnv::out0**()) const\
 Print information about the object.

### Protected Types

enum **Access** { **Read**, **Write**, **Accum** }\

### Protected Member Functions

virtual void **init\_threads** ()\
 virtual void **done\_threads** ()\
 virtual void **compute** ()\
 Recompute at least the results that have compute true and are not already computed.  virtual double **compute\_vector** (double &, double enuclear)\
 virtual **Ref**\< **SCExtrapError** \> **extrap\_error** ()\
 virtual void **compute\_gradient** (const **RefSCVector** &)\
 virtual void **compute\_hessian** (const **RefSymmSCMatrix** &)\
 virtual void **savestate\_iter** (int)\
 virtual void **savestate\_to\_file** (const std::string &filename)\
 signed char \* **init\_pmax** (double \*)\
 **RefSymmSCMatrix** **get\_local\_data** (const **RefSymmSCMatrix** &, double \*&, Access)\
 virtual void **initial\_vector** (int needv=1)\
 void **init\_mem** (int)\
 void **so\_density** (const **RefSymmSCMatrix** &d, double occ, int alp=1)\
 int \* **read\_occ** (const **Ref**\< **KeyVal** \> &, const char \*name, int nirrep)\
 virtual void **set\_occupations** (const **RefDiagSCMatrix** &)=0\
 virtual void **init\_vector** ()=0\
 virtual void **done\_vector** ()=0\
 virtual double **new\_density** ()=0\
 virtual void **reset\_density** ()=0\
 virtual double **scf\_energy** ()=0\
 virtual **Ref**\< **SCExtrapData** \> **extrap\_data** ()=0\
 virtual void **ao\_fock** (double accuracy)=0\
 virtual void **init\_gradient** ()=0\
 virtual void **done\_gradient** ()=0\
 virtual **RefSymmSCMatrix** **lagrangian** ()=0\
 virtual **RefSymmSCMatrix** **gradient\_density** ()=0\
 virtual void **two\_body\_deriv** (double \*)=0\
 virtual void **init\_hessian** ()=0\
 virtual void **done\_hessian** ()=0\

### Protected Attributes

int **need\_vec\_**\
 int **compute\_guess\_**\
 int **keep\_guess\_wfn\_**\
 **Ref**\< **OneBodyWavefunction** \> **guess\_wfn\_**\
 int **always\_use\_guess\_wfn\_**\
 **Ref**\< **SelfConsistentExtrapolation** \> **extrap\_**\
 **Ref**\< **AccumH** \> **accumdih\_**\
 **Ref**\< **AccumH** \> **accumddh\_**\
 int **maxiter\_**\
 int **dens\_reset\_freq\_**\
 int **reset\_occ\_**\
 int **local\_dens\_**\
 size\_t **storage\_**\
 int **print\_all\_evals\_**\
 int **print\_occ\_evals\_**\
 double **level\_shift\_**\
 **Ref**\< **MessageGrp** \> **scf\_grp\_**\
 **Ref**\< **ThreadGrp** \> **threadgrp\_**\
 int **local\_**\
 **Ref**\< **TwoBodyInt** \> \* **tbis\_**\
 std::string **previous\_savestate\_file\_**\
 **RefSCMatrix** **oso\_scf\_vector\_**\
 **RefSCMatrix** **oso\_scf\_vector\_beta\_**\
 **RefSymmSCMatrix** **hcore\_**\

### Additional Inherited Members

## Detailed Description

The **SCF** class is the base for all classes that use a self-consistent field procedure to solve an effective one body problem.

## Constructor & Destructor Documentation

### sc::SCF::SCF (const Ref\< KeyVal \> &)

The **KeyVal** constructor.

- `maxiter`

  This integer specifies the maximum number of **SCF** iterations. The default is 40.

- `density_reset_frequency`

  This integer specifies how often, in term of **SCF** iterations, $ reset to $D$. The default is 10.

- `reset_occuptions`

  Reassign the occupations after each iteration based on the eigenvalues. This only has an effect for molecules with higher than $C\_1$ symmetry. The default is false.

- `level_shift`

  The default is 0.

- `extrap`

  This specifies an object of type **SelfConsistentExtrapolation**. The default is a **DIIS** object.

- `memory`

  The amount of memory that each processor may use. The default is 0 (minimal memory use).

- `local_density`

  If this is true, a local copy of the density and $G$ matrix will be made on all nodes, even if a distributed matrix specialization is used. The default is true.

- `guess_wavefunction`

  This specifies the initial guess for the solution to the **SCF** equations. This can be either a **OneBodyWavefunction** object or the name of file that contains the saved state of a **OneBodyWavefunction** object. By default the one-electron hamiltonian will be diagonalized to obtain the initial guess.

- `keep_guess_wavefunction`

  The guess wavefunction is normally discarded after it is projected. Setting this boolean variable to true will cause the guess to be kept. This is useful when doing frequencies of symmetric molecules by finite displacements, because the wavefunction is lost whenever the molecule is displaced into lower symmetry.

- `always_use_guess_wavefunction`

  If the orbitals must be recomputed after they have already been computed once, then the old orbitals are used as the initial guess by default. However, if this option is true, then the guess wavefunction will be used, if available. If a guess wavefunction is not available, then a core Hamiltonian guess will be used. If this option is set to true, then keep\_guess\_wavefunction should also be set to true.

- `print_evals`

  Takes a boolean value. If true, print all eigenvalues after the **SCF** procedure converges. Takes a boolean value. The default is false.

- `print_occ_evals`

  Takes a boolean value. If true, print the occupied eigenvalues after the **SCF** procedure converges. The default is false.

## Member Function Documentation

### virtual void sc::SCF::compute ()` [protected]`, ` [virtual]`

Recompute at least the results that have compute true and are not already computed. This should only be called by **Result**'s members.

Implements **sc::Compute**.

### virtual RefSymmSCMatrix sc::SCF::effective\_fock ()` [pure virtual]`

Implemented in **sc::CLSCF**, **sc::HSOSSCF**, and **sc::UnrestrictedSCF**.

### RefDiagSCMatrix sc::SCF::eigenvalues ()` [virtual]`

Returns the MO basis eigenvalues.

Implements **sc::OneBodyWavefunction**.

Reimplemented in **sc::UnrestrictedSCF**.

### virtual RefSymmSCMatrix sc::SCF::fock (int)` [pure virtual]`

Implemented in **sc::CLSCF**, **sc::HSOSSCF**, and **sc::UnrestrictedSCF**.

### void sc::SCF::obsolete ()` [virtual]`

Marks all results as being out of date. Any subsequent access to results will cause **Compute::compute()** to be called.

Reimplemented from **sc::Compute**.

### RefSCMatrix sc::SCF::oso\_eigenvectors ()` [virtual]`

Returns the orthogonal MO (columns) to orthogonal-SO (rows) transformation matrix.

Implements **sc::OneBodyWavefunction**.

### void sc::SCF::print (std::ostream & = ExEnv::out0`()`) const` [virtual]`

Print information about the object.

Reimplemented from **sc::MolecularEnergy**.

Reimplemented in **sc::TCHF**, **sc::TCSCF**, **sc::UHF**, and **sc::UnrestrictedSCF**.

### void sc::SCF::save\_data\_state (StateOut &)` [virtual]`

Save the base classes (with save\_data\_state) and the members in the same order that the **StateIn** CTOR initializes them. This must be implemented by the derived class if the class has data.

Reimplemented from **sc::MolecularEnergy**.

Reimplemented in **sc::TCHF**, **sc::TCSCF**, **sc::UHF**, and **sc::UnrestrictedSCF**.

### int sc::SCF::spin\_unrestricted ()` [virtual]`

Return 1 if the alpha orbitals are not equal to the beta orbitals.

Implements **sc::OneBodyWavefunction**.

Reimplemented in **sc::UnrestrictedSCF**.

### void sc::SCF::symmetry\_changed ()` [virtual]`

Call this if you have changed the molecular symmetry of the molecule contained by this **MolecularEnergy**.

Reimplemented from **sc::MolecularEnergy**.

Reimplemented in **sc::TCSCF**, and **sc::UnrestrictedSCF**.

## Author

Generated automatically by Doxygen for MPQC from the source code.
