Skip to content

Commit

Permalink
Merge branch 'main' into mpo
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung authored Jan 30, 2025
2 parents 8a2f6bc + 8962aa9 commit e862d50
Show file tree
Hide file tree
Showing 14 changed files with 431 additions and 67 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
Expand All @@ -38,7 +38,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]
python-version: ["3.9", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -56,7 +56,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
python-version: ["3.9", "3.12"]
python-version: ["3.9", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.13"
- name: Install tox
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pyo3 = { version = "0.21", features = [
"num-complex",
"abi3-py39",
] }
num-integer = "0.1"

[target.'cfg(target_os = "linux")'.dependencies]
blas-src = { version = "0.10", features = ["openblas"] }
Expand Down
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
35 changes: 35 additions & 0 deletions docs/explanations/state-vectors-and-gates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,41 @@
"\n",
"rotated_vec"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## How much memory does a state vector occupy?\n",
"\n",
"The following code cell shows how to compute the number of gibibytes of memory occupied by the state vector for a system with a specified number of spatial orbitals, $\\alpha$ electrons, and $\\beta$ electrons (in this example: 26, 5, and 5)."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Storage required for state vector: 64.48 GiB\n"
]
}
],
"source": [
"# 128 bits per complex number, 8 bits per byte, 1024**3 bytes per GiB\n",
"GIB_PER_AMPLITUDE = 128 / 8 / 1024**3\n",
"\n",
"norb = 26\n",
"nelec = (5, 5)\n",
"\n",
"dim = ffsim.dim(norb, nelec)\n",
"gib = GIB_PER_AMPLITUDE * dim\n",
"\n",
"print(f\"Storage required for state vector: {gib:.2f} GiB\")"
]
}
],
"metadata": {
Expand Down
Loading

0 comments on commit e862d50

Please sign in to comment.