Skip to content

Commit

Permalink
add sections to fermion operator guide
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Jan 29, 2025
1 parent b4e5acb commit 85319e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/explanations/hamiltonians.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"source": [
"The arguments passed to the initialization are now available as attributes of the same name, i.e., `mol_hamiltonian.one_body_tensor` accesses the one-body tensor.\n",
"\n",
"## Operator action via SciPy LinearOperators\n",
"## Operator action\n",
"\n",
"The basic operation that a Hamiltonian represention should support is applying its action, as a linear operator, to a vector. This basic operation can be used to implement more complex ones, such as operator exponentiation and eigenvalue computation. ffsim uses Scipy's [LinearOperator](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.LinearOperator.html) class to support these operations for Hamiltonians. To obtain a LinearOperator, call the `linear_operator` function:"
]
Expand Down Expand Up @@ -192,7 +192,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "ffsim-1cfkSnAR",
"display_name": "ffsim",
"language": "python",
"name": "python3"
},
Expand All @@ -206,7 +206,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.13.1"
}
},
"nbformat": 4,
Expand Down
6 changes: 6 additions & 0 deletions docs/how-to-guides/fermion-operator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Arithmetic\n",
"\n",
"FermionOperators support arithmetic operations. Note that when multiplying a FermionOperator by a scalar, the scalar must go on the left, i.e. `2 * op` and not `op * 2`."
]
},
Expand Down Expand Up @@ -184,6 +186,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Normal-ordering\n",
"\n",
"Operators can be normal-ordered by calling the `normal_ordered` method, which returns a new FermionOperator. In the normal-ordered form of a FermionOperator, the operators comprising each term appear from left to right in descending lexicographic order by `(action, spin, orb)`. That is, all creation operators appear before all annihilation operators; within creation/annihilation operators, spin beta operators appear before spin alpha operators, and larger orbital indices appear before smaller orbital indices."
]
},
Expand Down Expand Up @@ -222,6 +226,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Operator action\n",
"\n",
"If a FermionOperator conserves particle number and the Z component of spin, then it can be converted to a [LinearOperator](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.LinearOperator.html) using the `ffsim.linear_operator` function. In order for a FermionOperator to conserve particle number and the Z component of spin, it must preserve the number of spin-alpha fermions and the number of spin-beta fermions. So far, the operators we have created do not satisfy these criteria:"
]
},
Expand Down

0 comments on commit 85319e5

Please sign in to comment.