---
title: FCIDump (latest version)
description: API reference for qiskit_fermions.operators.library.FCIDump in the latest version of qiskit-fermions
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit-fermions/operators-library-fci-dump
---

# FCIDump

*class* `FCIDump`

Bases: [`object`](https://docs.python.org/3/library/functions.html#object)

An electronic structure Hamiltonian in FCIDump format.

## Definition

The FCIDump format was originally defined by Knowles and Handy, 1989   [\[1\]](#id2). It is a widespread format for exporting electronic structure Hamiltonians in a plain-text file.

The present data structure only stores the information relevant for constructing the second quantized operator. However, this implementation goes beyond the original definition by supporting unrestricted spin data to be loaded. The table below outlines how integrals are associated with spin species based on the intervals in which the indices fall (assuming a header with `NORB=n`):

| Integral Type      | i          | j          | k          | l          |
| ------------------ | ---------- | ---------- | ---------- | ---------- |
| Constant           | ${0}$      | ${0}$      | ${0}$      | ${0}$      |
| 1-body alpha       | ${0}$      | ${0}$      | $[1,n]$    | $[1,n]$    |
| 1-body beta        | ${0}$      | ${0}$      | $[n+1,2n]$ | $[n+1,2n]$ |
| 2-body alpha-alpha | $[1,n]$    | $[1,n]$    | $[1,n]$    | $[1,n]$    |
| 2-body alpha-beta  | $[1,n]$    | $[1,n]$    | $[n+1,2n]$ | $[n+1,2n]$ |
| 2-body beta-beta   | $[n+1,2n]$ | $[n+1,2n]$ | $[n+1,2n]$ | $[n+1,2n]$ |

The only required values are the 1-body alpha-spin integrals.

The two-body integrals are expected in chemist ordering, $(ij|kl)$, matching the FCIDump convention.

> **Note**
>
> The implementation of this data structure is opaque to Python and only provides a few attributes and methods documented at the end of this page.

## Conversion

Operator implementations which can be constructed from an instance of [`FCIDump`](#qiskit_fermions.operators.library.FCIDump "qiskit_fermions.operators.library.FCIDump") provide a `from_fcidump` classmethod:

|                                                                                                                                                                |                                                                                                                                                                                                                                                 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`FermionOperator.from_fcidump()`](/docs/api/qiskit-fermions/operators-fermion-operator#from_fcidump "qiskit_fermions.operators.FermionOperator.from_fcidump") | Constructs a [`FermionOperator`](/docs/api/qiskit-fermions/operators-fermion-operator "qiskit_fermions.operators.FermionOperator") from an [`FCIDump`](#qiskit_fermions.operators.library.FCIDump "qiskit_fermions.operators.library.FCIDump"). |

\[[1](#id1)]

16. 10. Knowles and N. C. Handy, Computer Physics Communications 54 (1989) 75-83.

## Attributes

### ms2

Returns twice the spin quantum number, $2S$.

This number, $2S$, is extracted from the `MS2=2S` field in the header of the FCIDump file.

### nelec

Returns the number of electrons.

This number is extracted from the `NELEC` field in the header of the FCIDump file.

### norb

Returns the number of orbitals.

This number, $n$, is extracted from the `NORB=n` field in the header of the FCIDump file.

## Methods

### from\_file

*classmethod* `from_file(file_path)`

Parses an FCIDump file.

Assuming you have an FCIDump file called `molecule.fcidump`, you use this method like so:

```python
from qiskit_fermions.operators.library import FCIDump

fcidump = FCIDump.from_file("molecule.fcidump")
```

**Parameters**

**file\_path** – the path to the FCIDump file.

**Returns**

The constructed data structure.
