Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
classiqdor committed May 7, 2024
1 parent 1a2957a commit cef3177
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ labels: ''
assignees: ''

---


2 changes: 1 addition & 1 deletion .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: pre-commit/action@v3.0.1
- uses: pre-commit/action@v3.0.1
2 changes: 1 addition & 1 deletion .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
python -m pip install -U -r requirements.txt
python -m pip install -U pytest
- name: 'Run tests'
run: python -m pytest tests
run: python -m pytest tests
2 changes: 1 addition & 1 deletion tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def test_dummy():
assert 1+1 == 2
assert 1 + 1 == 2
9 changes: 7 additions & 2 deletions tutorials/getting_started/part5_grover.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@
"def my_predicate(res: QNum, a: QNum, b: QNum) -> None:\n",
" res ^= 2 * a == b * a\n",
"\n",
"\n",
"@qfunc\n",
"def prepare_minus(aux: QBit):\n",
" # Your code here\n",
" pass\n",
"\n",
"\n",
"@qfunc\n",
"def my_oracle(a: QNum, b: QNum):\n",
" # Your code here\n",
Expand Down Expand Up @@ -425,21 +427,24 @@
"def my_predicate(res: QNum, a: QNum, b: QNum) -> None:\n",
" res ^= 2 * a == b\n",
"\n",
"\n",
"@qfunc\n",
"def prepare_minus(aux: QBit):\n",
" X(aux)\n",
" H(aux)\n",
"\n",
"\n",
"@qfunc\n",
"def my_oracle(a: QNum, b: QNum):\n",
" aux = QBit(\"aux\")\n",
" allocate(1, aux)\n",
" \n",
"\n",
" within_apply(\n",
" compute=lambda: prepare_minus(aux),\n",
" action=lambda: my_predicate(res=aux, a=a, b=b)\n",
" action=lambda: my_predicate(res=aux, a=a, b=b),\n",
" )\n",
"\n",
"\n",
"@qfunc\n",
"def my_diffuser(a: QNum, b: QNum):\n",
" reg = QArray(\"reg\")\n",
Expand Down

0 comments on commit cef3177

Please sign in to comment.