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

# sc\_TwoBodyInt(3)

This is an abstract base type for classes that compute integrals involving two electrons.

## NAME

sc::TwoBodyInt - This is an abstract base type for classes that compute integrals involving two electrons.

## SYNOPSIS

`#include <tbint.h>`

Inherits **sc::RefCount**.

Inherited by **sc::TwoBodyIntCCA**, **sc::TwoBodyIntCints**, and **sc::TwoBodyIntV3**.

### Public Types

enum **tbint\_type** { **eri** =0, **r12** =1, **r12t1** =2, **r12t2** =3 }\
 Types of two-body integrals that **TwoBodyInt** understands: eri stands for electron repulsion integral, r12 stands for integrals of r12 operator, r12t1 and r12t2 are integrals of \[r12,T1\] and \[r12,T2\] operators.

### Public Member Functions

int **nbasis** () const\
 Return the number of basis functions on center one.  int **nbasis1** () const\
 Return the number of basis functions on center one.  int **nbasis2** () const\
 Return the number of basis functions on center two.  int **nbasis3** () const\
 Return the number of basis functions on center three.  int **nbasis4** () const\
 Return the number of basis functions on center four.  int **nshell** () const\
 Return the number of shells on center one.  int **nshell1** () const\
 Return the number of shells on center one.  int **nshell2** () const\
 Return the number of shells on center two.  int **nshell3** () const\
 Return the number of shells on center three.  int **nshell4** () const\
 Return the number of shells on center four.  **Ref**\< **GaussianBasisSet** \> **basis** ()\
 Return the basis set on center one.  **Ref**\< **GaussianBasisSet** \> **basis1** ()\
 Return the basis set on center one.  **Ref**\< **GaussianBasisSet** \> **basis2** ()\
 Return the basis set on center two.  **Ref**\< **GaussianBasisSet** \> **basis3** ()\
 Return the basis set on center three.  **Ref**\< **GaussianBasisSet** \> **basis4** ()\
 Return the basis set on center four.  virtual const double \* **buffer** (**tbint\_type** type=eri) const\
 The computed shell integrals will be put in the buffer returned by this member.  virtual void **compute\_shell** (int, int, int, int)=0\
 Given four shell indices, integrals will be computed and placed in the buffer.  virtual int **log2\_shell\_bound** (int=-1, int=-1, int=-1, int=-1)=0\
 Return log base 2 of the maximum magnitude of any integral in a shell block obtained from compute\_shell.  virtual int **redundant** () const\
 If redundant is true, then keep redundant integrals in the buffer.  virtual void **set\_redundant** (int i)\
 See **redundant()**.  virtual void **set\_integral\_storage** (size\_t storage)\
 This storage is used to cache computed integrals.  **Integral** \* **integral** () const\
 Return the integral factory that was used to create this object.

### Static Public Attributes

static const int **num\_tbint\_types** = 4\
 The total number of such types.

### Protected Member Functions

**TwoBodyInt** (**Integral** \***integral**, const **Ref**\< **GaussianBasisSet** \> &bs1, const **Ref**\< **GaussianBasisSet** \> &bs2, const **Ref**\< **GaussianBasisSet** \> &bs3, const **Ref**\< **GaussianBasisSet** \> &bs4)\

### Protected Attributes

**Integral** \* **integral\_**\
 **Ref**\< **GaussianBasisSet** \> **bs1\_**\
 **Ref**\< **GaussianBasisSet** \> **bs2\_**\
 **Ref**\< **GaussianBasisSet** \> **bs3\_**\
 **Ref**\< **GaussianBasisSet** \> **bs4\_**\
 double \* **buffer\_**\
 int **redundant\_**\

## Detailed Description

This is an abstract base type for classes that compute integrals involving two electrons.

## Member Function Documentation

### virtual const double \* sc::TwoBodyInt::buffer (tbint\_type type = `eri`) const` [virtual]`

The computed shell integrals will be put in the buffer returned by this member. Some **TwoBodyInt** specializations have more than one buffer: The type arguments selects which buffer is returned. If the requested type is not supported, then 0 is returned.

Reimplemented in **sc::TwoBodyIntCints**.

Referenced by **sc::LocalGBuild\< T \>::run()**.

### virtual void sc::TwoBodyInt::compute\_shell (int, int, int, int)` [pure virtual]`

Given four shell indices, integrals will be computed and placed in the buffer. The first two indices correspond to electron 1 and the second two indices correspond to electron 2.

Implemented in **sc::TwoBodyIntCints**, **sc::TwoBodyIntCCA**, and **sc::TwoBodyIntV3**.

Referenced by **sc::LocalGBuild\< T \>::run()**.

### virtual int sc::TwoBodyInt::log2\_shell\_bound (int = `-1`, int = `-1`, int = `-1`, int = `-1`)` [pure virtual]`

Return log base 2 of the maximum magnitude of any integral in a shell block obtained from compute\_shell. An index of -1 for any argument indicates any shell. \

Implemented in **sc::TwoBodyIntCints**, **sc::TwoBodyIntCCA**, and **sc::TwoBodyIntV3**.

Referenced by **sc::LocalGBuild\< T \>::run()**.

### virtual int sc::TwoBodyInt::redundant () const` [inline]`, ` [virtual]`

If redundant is true, then keep redundant integrals in the buffer. The default is true.

Reimplemented in **sc::TwoBodyIntCCA**.

### virtual void sc::TwoBodyInt::set\_integral\_storage (size\_t storage)` [virtual]`

This storage is used to cache computed integrals.

Reimplemented in **sc::TwoBodyIntCints**, **sc::TwoBodyIntCCA**, and **sc::TwoBodyIntV3**.

### virtual void sc::TwoBodyInt::set\_redundant (int i)` [inline]`, ` [virtual]`

See **redundant()**.

Reimplemented in **sc::TwoBodyIntCCA**.

Referenced by **sc::LocalGBuild\< T \>::run()**.

## Author

Generated automatically by Doxygen for MPQC from the source code.
