Skip to content

Commit

Permalink
Merge pull request #97 from BQSKit/1.0.1
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
edyounis authored Sep 22, 2022
2 parents 98b519c + d2eb4e5 commit cdb5fdf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10.6' # TODO: Remove .6 when mypy fixes issue 13627
- name: set PY
Expand All @@ -19,4 +19,4 @@ jobs:
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v1.1.0
- uses: pre-commit/action@v3.0.0
13 changes: 7 additions & 6 deletions bqskit/passes/partitioning/quick.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ def process_pending_bins() -> None:
while merging:
merging = False
for p in partitioned_circuit.rear:
qudits = partitioned_circuit[p].location
qudits = list(partitioned_circuit[p].location)

# if qudits is subset of bin.qudits
if all(q in bin.qudits for q in qudits):
# if qudits is subset of loc
if all(q in loc for q in qudits):
prev_op = partitioned_circuit.pop(p)
pg = cast(CircuitGate, prev_op.gate)
prev_circ = pg._circuit
Expand All @@ -142,14 +142,15 @@ def process_pending_bins() -> None:
merging = True
break

# if bin.qudits is a subset of qudits
if all(q in qudits for q in bin.qudits):
# if loc is a subset of qudits
if all(q in qudits for q in loc):
prev_op = partitioned_circuit.pop(p)
pg = cast(CircuitGate, prev_op.gate)
prev_circ = pg._circuit
lloc = [qudits.index(q) for q in bin.qudits]
lloc = [qudits.index(q) for q in loc]
prev_circ.append_circuit(subc, lloc)
subc.become(prev_circ)
loc = qudits

# retry merging
merging = True
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = bqskit
version = 1.0.0
version = 1.0.1
description = Berkeley Quantum Synthesis Toolkit
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down

0 comments on commit cdb5fdf

Please sign in to comment.