Skip to content

Commit

Permalink
Merge branch 'master' into mhucka-add-security-policy
Browse files Browse the repository at this point in the history
  • Loading branch information
mhucka authored Jan 30, 2025
2 parents 91799fc + 64f203f commit cb12b9c
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 23 deletions.
58 changes: 40 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
name: Continuous Integration
on: [pull_request]

on:
pull_request:
types: [opened, synchronize]
branches:
- master

merge_group:
types:
- checks_requested

push:
branches:
- master

jobs:
format:
name: Format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v1
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
cache: pip
- name: Install requirements
run: pip install -r dev_tools/requirements/envs/format.env.txt
- name: Format
Expand All @@ -21,11 +35,12 @@ jobs:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
cache: pip
- name: Install requirements
run: pip install -r dev_tools/requirements/envs/mypy.env.txt
- name: Type check
Expand All @@ -34,11 +49,12 @@ jobs:
name: Lint check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
cache: pip
- name: Install requirements
run: pip install -r dev_tools/requirements/envs/pylint.env.txt
- name: Lint
Expand All @@ -47,10 +63,11 @@ jobs:
name: Pytest max compat
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
cache: pip
- name: Install requirements
run: |
pip install -r dev_tools/requirements/max_compat/pytest-max-compat.env.txt
Expand All @@ -63,16 +80,18 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
cirq-version: [ 1.4.1 ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
- name: Install requirements
run: |
pip install -r dev_tools/requirements/envs/pytest.env.txt
pip install cirq-core${{matrix.cirq-version}}
pip install cirq-core==${{matrix.cirq-version}}
- name: Pytest check
run: check/pytest
shell: bash
Expand All @@ -82,30 +101,33 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
cirq-version: [ 1.4.1 ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
- name: Install requirements
run: |
pip install -r dev_tools/requirements/envs/pytest-extra.env.txt
pip install cirq-core${{matrix.cirq-version}}
pip install cirq-core==${{matrix.cirq-version}}
- name: Pytest check resources
run: check/pytest -m 'not slow' src/openfermion/resource_estimates
shell: bash
coverage:
name: Coverage check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v1
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
- name: Install requirements
run: pip install -r dev_tools/requirements/envs/pytest.env.txt
- name: Coverage check
run: check/pytest-and-incremental-coverage
run: check/pytest-and-incremental-coverage
5 changes: 3 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ jobs:
python-version: [ '3.10' ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install requirements
run: |
pip install -r dev_tools/requirements/envs/pytest.env.txt
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/intro_workshop_exercises.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"operator*, and we refer to creation and annihilation operators as\n",
"fermionic *ladder operators*.\n",
" \n",
"The canonical anticommutation relations impose a number of consequences on the structure of the vector space on which the ladder operators act; see [Michael Nielsen's notes](http://michaelnielsen.org/blog/archive/notes/fermions_and_jordan_wigner.pdf) for a good discussion.\n",
"The canonical anticommutation relations impose a number of consequences on the structure of the vector space on which the ladder operators act; see [Michael Nielsen's notes](https://futureofmatter.com/assets/fermions_and_jordan_wigner.pdf) for a good discussion.\n",
"\n",
"The electronic structure Hamiltonian is commonly written in the form\n",
"$$\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"- The annihilation operators $a_p$ act on this basis as follows:\n",
" $$\\begin{aligned} a_p \\lvert n_0, \\ldots, n_{p-1}, 1, n_{p+1}, \\ldots, n_{N-1} \\rangle &= (-1)^{\\sum_{q=0}^{p-1} n_q} \\lvert n_0, \\ldots, n_{p-1}, 0, n_{p+1}, \\ldots, n_{N-1} \\rangle \\,, \\\\ a_p \\lvert n_0, \\ldots, n_{p-1}, 0, n_{p+1}, \\ldots, n_{N-1} \\rangle &= 0 \\,.\\end{aligned}$$\n",
" \n",
"See [here](http://michaelnielsen.org/blog/archive/notes/fermions_and_jordan_wigner.pdf) for a derivation and discussion of these\n",
"See [here](https://futureofmatter.com/assets/fermions_and_jordan_wigner.pdf) for a derivation and discussion of these\n",
"consequences.\n",
"\n",
"## Mapping fermions to qubits with transforms\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def freeze_orbitals(fermion_operator, occupied, unoccupied=None, prune=True):
n_swaps = 0 # Number of swaps that have been done

for op in enumerate(reversed(term)):
if op[1][0] is item[0]:
if op[1][0] == item[0]:
n_ops += 1

# Determine number of swaps needed to bring the op in
Expand Down

0 comments on commit cb12b9c

Please sign in to comment.