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

# sc\_OneBodyWavefunction(3)

A OneBodyWavefunction is a MolecularEnergy that solves an effective one-body problem.

## NAME

sc::OneBodyWavefunction - A **OneBodyWavefunction** is a **MolecularEnergy** that solves an effective one-body problem.

## SYNOPSIS

`#include <obwfn.h>`

Inherits **sc::Wavefunction**.

Inherited by **sc::ExtendedHuckelWfn**, **sc::HCoreWfn**, and **sc::SCF**.

### Public Member Functions

**OneBodyWavefunction** (**StateIn** &)\
 **OneBodyWavefunction** (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.  int **nelectron** ()\
 Returns the number of electrons.  void **set\_desired\_value\_accuracy** (double eps)\
 Overload of **Function::set\_desired\_value\_accuracy()**.  **RefSCMatrix** **so\_to\_mo** ()\
 Returns the **SO** to MO transformation matrix.  **RefSCMatrix** **orthog\_so\_to\_mo** ()\
 Returns the orthogonal-SO to MO transformation matrix.  **RefSCMatrix** **mo\_to\_so** ()\
 Returns the MO to **SO** transformation matrix.  **RefSCMatrix** **mo\_to\_orthog\_so** ()\
 Returns the MO to orthogonal-SO transformation matrix.  **RefSCMatrix** **eigenvectors** ()\
 Deprecated.  virtual **RefSCMatrix** **oso\_eigenvectors** ()=0\
 Returns the orthogonal MO (columns) to orthogonal-SO (rows) transformation matrix.  virtual **RefDiagSCMatrix** **eigenvalues** ()=0\
 Returns the MO basis eigenvalues.  virtual double **occupation** (int irrep, int vectornum)=0\
 Returns the occupation.  double **occupation** (int vectornum)\
 Returns the occupation.  virtual int **spin\_unrestricted** ()=0\
 Return 1 if the alpha orbitals are not equal to the beta orbitals.  virtual double **alpha\_occupation** (int irrep, int vectornum)\
 Returns the alpha occupation.  virtual double **beta\_occupation** (int irrep, int vectornum)\
 Returns the beta occupation.  double **alpha\_occupation** (int vectornum)\
 Returns the alpha occupation.  double **beta\_occupation** (int vectornum)\
 Returns the beta occupation.  virtual **RefSCMatrix** **oso\_alpha\_eigenvectors** ()\
 virtual **RefSCMatrix** **oso\_beta\_eigenvectors** ()\
 virtual **RefSCMatrix** **alpha\_eigenvectors** ()\
 virtual **RefSCMatrix** **beta\_eigenvectors** ()\
 virtual **RefDiagSCMatrix** **alpha\_eigenvalues** ()\
 virtual **RefDiagSCMatrix** **beta\_eigenvalues** ()\
 virtual **RefDiagSCMatrix** **projected\_eigenvalues** (const **Ref**\< **OneBodyWavefunction** \> &, int alp=1)\
 virtual **RefSCMatrix** **projected\_eigenvectors** (const **Ref**\< **OneBodyWavefunction** \> &, int alp=1)\
 Projects the density into the current basis set.  virtual **RefSCMatrix** **hcore\_guess** ()\
 Return a guess vector.  virtual **RefSCMatrix** **hcore\_guess** (**RefDiagSCMatrix** &val)\
 Return a guess vector and the eigenvalues.  void **symmetry\_changed** ()\
 Call this if you have changed the molecular symmetry of the molecule contained by this **MolecularEnergy**.  double **orbital** (const **SCVector3** &r, int iorb)\
 double **orbital\_density** (const **SCVector3** &r, int iorb, double \*orbval=0)\
 void **print** (std::ostream &o=**ExEnv::out0**()) const\
 Print information about the object.

### Protected Member Functions

void **init\_sym\_info** ()\
 int **form\_occupations** (int \*&newocc, const int \*oldocc)\

### Protected Attributes

**ResultRefSymmSCMatrix** **density\_**\
 **AccResultRefSCMatrix** **oso\_eigenvectors\_**\
 **AccResultRefDiagSCMatrix** **eigenvalues\_**\
 int **nirrep\_**\
 int \* **nvecperirrep\_**\
 double \* **occupations\_**\
 double \* **alpha\_occupations\_**\
 double \* **beta\_occupations\_**\

### Additional Inherited Members

## Detailed Description

A **OneBodyWavefunction** is a **MolecularEnergy** that solves an effective one-body problem.

## Constructor & Destructor Documentation

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

The **KeyVal** constructor.

- `eigenvector_accuracy`

  Gives the accuracy to which eigenvectors are initially computed. The default 1.0e-7. Accuracies are usually adjusted as needed anyway, so it should not be necessary to change this.

## Member Function Documentation

### virtual double sc::OneBodyWavefunction::alpha\_occupation (int irrep, int vectornum)` [virtual]`

Returns the alpha occupation. The irreducible representation and the vector number within that representation are given as arguments.

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

### double sc::OneBodyWavefunction::alpha\_occupation (int vectornum)

Returns the alpha occupation. The vector number in the MO basis is given as an argument.

### virtual double sc::OneBodyWavefunction::beta\_occupation (int irrep, int vectornum)` [virtual]`

Returns the beta occupation. The irreducible representation and the vector number within that representation are given as arguments.

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

### double sc::OneBodyWavefunction::beta\_occupation (int vectornum)

Returns the beta occupation. The vector number in the MO basis is given as an argument.

### virtual RefDiagSCMatrix sc::OneBodyWavefunction::eigenvalues ()` [pure virtual]`

Returns the MO basis eigenvalues.

Implemented in **sc::SCF**, **sc::UnrestrictedSCF**, **sc::ExtendedHuckelWfn**, and **sc::HCoreWfn**.

### RefSCMatrix sc::OneBodyWavefunction::eigenvectors ()

Deprecated. Use **so\_to\_mo()**.t() instead.

### virtual RefSCMatrix sc::OneBodyWavefunction::hcore\_guess ()` [virtual]`

Return a guess vector. The guess transforms the orthogonal **SO** basis to the MO basis.

### virtual RefSCMatrix sc::OneBodyWavefunction::hcore\_guess (RefDiagSCMatrix & val)` [virtual]`

Return a guess vector and the eigenvalues. The guess ransforms the orthogonal **SO** basis to the MO basis. Storage for the eigenvalues will be allocated.

### RefSCMatrix sc::OneBodyWavefunction::mo\_to\_orthog\_so ()

Returns the MO to orthogonal-SO transformation matrix. This returns the same matrix as **oso\_eigenvectors()**.

### int sc::OneBodyWavefunction::nelectron ()` [virtual]`

Returns the number of electrons.

Implements **sc::Wavefunction**.

### virtual double sc::OneBodyWavefunction::occupation (int irrep, int vectornum)` [pure virtual]`

Returns the occupation. The irreducible representation and the vector number within that representation are given as arguments.

Implemented in **sc::OSSSCF**, **sc::TCSCF**, **sc::CLSCF**, **sc::HSOSSCF**, **sc::ExtendedHuckelWfn**, **sc::HCoreWfn**, and **sc::UnrestrictedSCF**.

### double sc::OneBodyWavefunction::occupation (int vectornum)

Returns the occupation. The vector number in the MO basis is given as an argument.

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

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

Implemented in **sc::SCF**, **sc::ExtendedHuckelWfn**, and **sc::HCoreWfn**.

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

Print information about the object.

Reimplemented from **sc::MolecularEnergy**.

### virtual RefSCMatrix sc::OneBodyWavefunction::projected\_eigenvectors (const Ref\< OneBodyWavefunction \> &, int alp = `1`)` [virtual]`

Projects the density into the current basis set. Returns an orthogonalized **SO** to MO transformation with the orbitals.

### void sc::OneBodyWavefunction::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::HCoreWfn**.

### void sc::OneBodyWavefunction::set\_desired\_value\_accuracy (double eps)` [virtual]`

Overload of **Function::set\_desired\_value\_accuracy()**. Must update accuracy of the eigenvectors and the eigenvalues

Reimplemented from **sc::Function**.

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

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

Implemented in **sc::SCF**, **sc::UnrestrictedSCF**, **sc::ExtendedHuckelWfn**, and **sc::HCoreWfn**.

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

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

Reimplemented from **sc::MolecularEnergy**.

## Author

Generated automatically by Doxygen for MPQC from the source code.
