Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ updates:
labels:
- "area/dependencies"
- "area/docker"
cooldown:
default-days: 7

- package-ecosystem: "github-actions"
# The "github-actions" code explicitly looks in /.github/workflows if the
Expand All @@ -35,6 +37,8 @@ updates:
labels:
- "area/dependencies"
- "area/devops"
cooldown:
default-days: 7

- package-ecosystem: "pip"
# OpenFermion has requirements.txt files in multiple places.
Expand All @@ -46,3 +50,5 @@ updates:
versioning-strategy: "increase-if-necessary"
labels:
- "area/dependencies"
cooldown:
default-days: 7
24 changes: 22 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ concurrency:
cancel-in-progress: true
group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}}

permissions: read-all
# Declare default permissions as read only.
permissions:
contents: read

jobs:
python-checks:
Expand All @@ -68,6 +70,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python and restore cache
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
Expand Down Expand Up @@ -112,6 +115,8 @@ jobs:
steps:
- name: Check out a copy of the git repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Python and restore cache
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
Expand Down Expand Up @@ -144,6 +149,8 @@ jobs:
steps:
- name: Check out a copy of the git repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Python and restore cache
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
Expand Down Expand Up @@ -173,6 +180,8 @@ jobs:
steps:
- name: Check out a copy of the git repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

# Note: deliberately not using our Python cache here b/c this runs
# a different version of Python.
Expand Down Expand Up @@ -202,6 +211,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python and restore cache
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
Expand All @@ -228,6 +238,8 @@ jobs:
steps:
- name: Check out a copy of the git repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install yamllint
run: |
Expand All @@ -248,6 +260,8 @@ jobs:
steps:
- name: Check out a copy of the git repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Run hadolint on Dockerfiles
env:
Expand All @@ -258,7 +272,7 @@ jobs:
files=(**/[Dd]ockerfile*)
if [[ ${#files[@]} -gt 0 ]]; then
docker run --rm -v "${PWD}:/app" -w /app \
ghcr.io/hadolint/hadolint@${{env.sha}} /bin/hadolint "${files[@]}"
"ghcr.io/hadolint/hadolint@${sha}" /bin/hadolint "${files[@]}"
fi

workflow-lint:
Expand All @@ -268,6 +282,8 @@ jobs:
steps:
- name: Check out a copy of the git repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Run actionlint
uses: raven-actions/actionlint@3d39aea434753780c3b3d4a1a31c854b4dbf49d7 # v2.2.0
Expand All @@ -283,6 +299,8 @@ jobs:
steps:
- name: Check out a copy of the git repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Run shellcheck on shell scripts
run: |
Expand All @@ -296,6 +314,8 @@ jobs:
steps:
- name: Check out a copy of the git repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Python and restore cache
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/nightly-pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ on:
# Allow manual invocation.
workflow_dispatch:

concurrency:
cancel-in-progress: true
group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}}

# Declare default workflow permissions as read only.
permissions: read-all
permissions:
contents: read

jobs:
Pytest:
Expand Down Expand Up @@ -75,6 +80,8 @@ jobs:
steps:
- name: Check out a copy of the OpenFermion git repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
Expand All @@ -89,7 +96,11 @@ jobs:
run: pip install -r dev_tools/requirements/envs/pytest.env.txt

- name: Install cirq-core (current stable version)
run: pip install -U cirq-core ${{inputs.args}}
env:
INSTALL_ARGS: ${{inputs.args}}
run: |
# shellcheck disable=SC2086
pip install -U cirq-core $INSTALL_ARGS

- name: Set up Pytest output problem matcher
run: echo '::add-matcher::.github/problem-matchers/pytest.json'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ on:
workflow_dispatch:

# Declare default permissions as read only.
permissions: read-all
permissions:
contents: read

jobs:
cirq-stable:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/scorecard-scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,21 @@ concurrency:
group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}}

# Declare default workflow permissions as read only.
permissions: read-all
permissions:
contents: read

jobs:
run-scorecard:
# Skip fork PRs to avoid "Analysis configuration not found" errors.
if: >-
github.repository_owner == 'quantumlib' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.fork == false)
github.event.pull_request.head.repo.full_name == github.repository)
name: Scorecard analyzer
runs-on: ubuntu-24.04
permissions:
security-events: write
id-token: write
security-events: write # Needed to upload SARIF results to GitHub Code Scanning dashboard.
id-token: write # Needed to sign and publish Scorecard results.
timeout-minutes: 15
steps:
- name: Check out a copy of the git repository
Expand Down Expand Up @@ -83,10 +84,11 @@ jobs:
timeout-minutes: 5
steps:
- name: Write the Scorecard report page link to the workflow summary
env:
REPO: ${{github.repository}}
run: |
repo="${{github.repository}}"
url="https://scorecard.dev/viewer/?uri=github.com/${repo}"
url="https://scorecard.dev/viewer/?uri=github.com/${REPO}"
{
echo -n "The results are available on the OpenSSF Scorecard "
echo "[report page for ${{github.repository}}]($url)."
echo "[report page for ${REPO}]($url)."
} >> "$GITHUB_STEP_SUMMARY"
3 changes: 2 additions & 1 deletion docs/fqe/tutorials/fermi_hubbard.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
},
"outputs": [],
"source": [
"np.random.seed(0)\n",
"nele, sz = 2, 0\n",
"init_wfn = fqe.Wavefunction([[nele, sz, nsites]])\n",
"init_wfn.set_wfn(strategy=\"random\")"
Expand All @@ -196,7 +197,7 @@
"outputs": [],
"source": [
"%%time\n",
"e_time = 0.9\n",
"e_time = 0.1\n",
"true_evolved_fqe = init_wfn.time_evolve(e_time, hubbard)"
]
},
Expand Down
Loading