Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LO circuit cuts optimizer #471

Closed
wants to merge 146 commits into from
Closed
Show file tree
Hide file tree
Changes from 142 commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
6c29aa0
set up new branch with LO circuit cut finder
ibrahim-shehzad Jan 8, 2024
8f79eb3
Update tutorial with bug fix pending
ibrahim-shehzad Jan 9, 2024
3e8c438
update tutorial with bug fix pending
ibrahim-shehzad Jan 9, 2024
e084033
fix bug and update notebook
ibrahim-shehzad Jan 9, 2024
aa280e8
update print method, Co-authored by: Edwin Pednault pednault@us.ibm.com
ibrahim-shehzad Jan 9, 2024
654ec7c
Update cut finding dir structure
caleb-johnson Jan 9, 2024
cb648eb
commit before pulling changes
ibrahim-shehzad Jan 9, 2024
33c4096
Add license blurbs
caleb-johnson Jan 9, 2024
4251c20
black errors
caleb-johnson Jan 9, 2024
10304cc
snapshot before pulling
ibrahim-shehzad Jan 9, 2024
354e3f4
commit before pulling
ibrahim-shehzad Jan 9, 2024
9a73c0d
clean up notebook with updated print method
ibrahim-shehzad Jan 9, 2024
b22a29a
clean up printed output in tutorial
ibrahim-shehzad Jan 9, 2024
95f024d
Add find_cuts tutorial
caleb-johnson Jan 9, 2024
1df2289
Merge branch 'LO-circuit-cuts-optimizer' of github.com:Qiskit-Extensi…
caleb-johnson Jan 9, 2024
9938566
Use dataclasses for settings objects
caleb-johnson Jan 9, 2024
8e30782
Update tutorial to integrate with CKT
caleb-johnson Jan 9, 2024
3e10f89
edit string output function
ibrahim-shehzad Jan 10, 2024
eabf648
Merge branch 'LO-circuit-cuts-optimizer' of https://github.com/Qiskit…
ibrahim-shehzad Jan 10, 2024
aee698e
clean up utils doc strings.
ibrahim-shehzad Jan 10, 2024
0a8d590
Simplifications in xform func
caleb-johnson Jan 10, 2024
74d984a
black
caleb-johnson Jan 10, 2024
8148475
update xform code to fix small bug
caleb-johnson Jan 10, 2024
5ca795c
minor simplification
caleb-johnson Jan 10, 2024
d56a199
edit doc strings
ibrahim-shehzad Jan 11, 2024
78e0691
edit field name in settings
ibrahim-shehzad Jan 11, 2024
19321a6
Introduce a CircuitElement tuple
caleb-johnson Jan 17, 2024
56eb8a3
Merge remote-tracking branch 'origin/LO-circuit-cuts-optimizer' into …
caleb-johnson Jan 17, 2024
3b8f16f
Remove remnants of other search algorithms.
ibrahim-shehzad Jan 22, 2024
5d7c852
Merge branch 'LO-circuit-cuts-optimizer' of https://github.com/Qiskit…
ibrahim-shehzad Jan 22, 2024
71d2c60
Fix cost lookup logic
caleb-johnson Jan 22, 2024
754e5d2
snapshot test notebook before pull
ibrahim-shehzad Jan 22, 2024
a67ba62
Merge branch 'LO-circuit-cuts-optimizer' of https://github.com/Qiskit…
ibrahim-shehzad Jan 22, 2024
8d6ee74
Add cut finder tests
ibrahim-shehzad Jan 23, 2024
1c87d3d
rebase conflict
caleb-johnson Jan 24, 2024
5957759
Add license blurbs
caleb-johnson Jan 9, 2024
b257039
black errors
caleb-johnson Jan 9, 2024
41861e5
clean up notebook with updated print method
ibrahim-shehzad Jan 9, 2024
99c5259
clean up printed output in tutorial
ibrahim-shehzad Jan 9, 2024
4460c53
edit string output function
ibrahim-shehzad Jan 10, 2024
3e88ed9
Add find_cuts tutorial
caleb-johnson Jan 9, 2024
e5a762a
Use dataclasses for settings objects
caleb-johnson Jan 9, 2024
3686726
Update tutorial to integrate with CKT
caleb-johnson Jan 9, 2024
9e49305
clean up utils doc strings.
ibrahim-shehzad Jan 10, 2024
cf7268b
Simplifications in xform func
caleb-johnson Jan 10, 2024
97f87c1
black
caleb-johnson Jan 10, 2024
5635897
update xform code to fix small bug
caleb-johnson Jan 10, 2024
8c01c37
minor simplification
caleb-johnson Jan 10, 2024
3a090c1
edit doc strings
ibrahim-shehzad Jan 11, 2024
20ce84d
edit field name in settings
ibrahim-shehzad Jan 11, 2024
0d9eef8
Remove remnants of other search algorithms.
ibrahim-shehzad Jan 22, 2024
a4d6eb2
Introduce a CircuitElement tuple
caleb-johnson Jan 17, 2024
de0580a
Fix cost lookup logic
caleb-johnson Jan 22, 2024
741ed42
Fix bugs with wire cutting
caleb-johnson Jan 24, 2024
54cda84
Fix bugs with wire cutting
caleb-johnson Jan 24, 2024
06cf869
Update cco tests
ibrahim-shehzad Jan 24, 2024
8481b82
Merge branch 'LO-circuit-cuts-optimizer' of https://github.com/Qiskit…
ibrahim-shehzad Jan 24, 2024
d377b5d
Update indices to params in gate dict
caleb-johnson Jan 24, 2024
949266e
re run tutorial for correct outputs
caleb-johnson Jan 24, 2024
4b75973
clean up notebook
caleb-johnson Jan 24, 2024
6ed4528
clean up tutorial
caleb-johnson Jan 24, 2024
63ac13a
clean up tutorial
caleb-johnson Jan 24, 2024
c746e59
clean up tutorial
caleb-johnson Jan 24, 2024
8cd851b
clean up tutorial and print statement
caleb-johnson Jan 24, 2024
33a48fb
Add Ed Pednault as author
pednault Jan 25, 2024
6be5b1d
Set gamma UP and LB both to gamma until bell pair cutting is supporte…
caleb-johnson Jan 25, 2024
bb803fa
Remove redundant CircuitElement class
caleb-johnson Jan 25, 2024
43840dd
Remove unnecessary init
caleb-johnson Jan 25, 2024
b185c0d
Add partial type hints for a few modules
ibrahim-shehzad Jan 26, 2024
210f581
Merge branch 'LO-circuit-cuts-optimizer' of https://github.com/Qiskit…
ibrahim-shehzad Jan 26, 2024
1953082
Remove unused code and add roundtrip tests.
ibrahim-shehzad Jan 27, 2024
119ce29
Update BFS test and remove unused code.
ibrahim-shehzad Jan 29, 2024
ff58250
Fix black errors, changes to tests pending
ibrahim-shehzad Jan 30, 2024
c78c9a6
Update test to match new circuit interfaces
ibrahim-shehzad Jan 30, 2024
551237d
Update circuit interface tests and some docstrings.
ibrahim-shehzad Jan 31, 2024
077d4b5
Update CCOtoQC func and associated test.
ibrahim-shehzad Jan 31, 2024
7b35453
Update BFS test and run style.
ibrahim-shehzad Jan 31, 2024
19c78f2
Finish making all tests consistent with new circuit interface
ibrahim-shehzad Feb 1, 2024
5e55d84
Add and update tests
ibrahim-shehzad Feb 5, 2024
a57bd91
Add and update tests
ibrahim-shehzad Feb 5, 2024
5a9c113
Add type hints, tests, update func names.
ibrahim-shehzad Feb 9, 2024
40fd700
add tests, fix some mypy errors.
ibrahim-shehzad Feb 14, 2024
5cdcb68
Correct mypy errors, fix bugs in tests.
ibrahim-shehzad Feb 20, 2024
dfaff48
Remove cast subscripting to make compatible with py38.
ibrahim-shehzad Feb 26, 2024
ea0b2b8
Make type annotations compatible with min version tests.
ibrahim-shehzad Feb 26, 2024
07e2818
Fix more py38 type compatibility issues.
ibrahim-shehzad Feb 26, 2024
e1129af
Fix type hints.
ibrahim-shehzad Feb 26, 2024
5de66b8
Get rid of camel casing in function names and fix linting errors in d…
ibrahim-shehzad Mar 1, 2024
ea9ba93
Fix remaining pylint errors.
ibrahim-shehzad Mar 1, 2024
d374c25
Generate black diff.
ibrahim-shehzad Mar 1, 2024
b8ccbe4
Use python3.10 for lint workflow
garrison Mar 1, 2024
29c66ef
Merge branch 'main' into LO-circuit-cuts-optimizer
ibrahim-shehzad Mar 1, 2024
9abe1a1
Merge branch 'LO-circuit-cuts-optimizer' of https://github.com/Qiskit…
ibrahim-shehzad Mar 1, 2024
4bbac31
Run style with updated version of black
ibrahim-shehzad Mar 1, 2024
7d3872b
Edit doc strings
ibrahim-shehzad Mar 6, 2024
d07c13a
Find cuts updates (#498)
caleb-johnson Mar 7, 2024
94d96ae
Change to namedtuples, redo tests and typing.
ibrahim-shehzad Mar 8, 2024
7d68b14
Merge branch 'LO-circuit-cuts-optimizer' of https://github.com/Qiskit…
ibrahim-shehzad Mar 8, 2024
95a4885
Fix sphinx errors, change actions to named tuples.
ibrahim-shehzad Mar 8, 2024
115fe05
lint
ibrahim-shehzad Mar 8, 2024
0929184
clean up notebook, cast statements.
ibrahim-shehzad Mar 10, 2024
65108d8
Clean up type hints
ibrahim-shehzad Mar 11, 2024
bfd9411
style
ibrahim-shehzad Mar 11, 2024
7ffeb41
Add tests, add qubit list to output.
ibrahim-shehzad Mar 14, 2024
3609d17
style
ibrahim-shehzad Mar 14, 2024
b10c959
Add tests
ibrahim-shehzad Mar 15, 2024
e71dc7e
Remove subscripting in cast statements
ibrahim-shehzad Mar 15, 2024
14803d0
Fix tests.
ibrahim-shehzad Mar 15, 2024
915052b
Fix docstring. Improve error message. Add test.
caleb-johnson Mar 18, 2024
5d38550
Update tutorial, add classes for constraints and settings
ibrahim-shehzad Mar 18, 2024
7f4815d
Merge branch 'LO-circuit-cuts-optimizer' of https://github.com/Qiskit…
ibrahim-shehzad Mar 18, 2024
5f1ec95
Fix test, edit doc string.
ibrahim-shehzad Mar 18, 2024
9589465
Correct error in tutorial
ibrahim-shehzad Mar 19, 2024
23ddea6
Correct tutorial output
ibrahim-shehzad Mar 19, 2024
c44f740
Remove num_QPUs, add tests.
ibrahim-shehzad Mar 19, 2024
aa6ed33
Edit doc string, fix type hint for backjumps.
ibrahim-shehzad Mar 21, 2024
25a9d06
Fix bug in indexing in find_cuts, and fix docstring
caleb-johnson Mar 23, 2024
6493ac5
Fix funky rendering
caleb-johnson Mar 23, 2024
0c5d50f
docstring
caleb-johnson Mar 23, 2024
149e1f5
Fix remnant of indexing bug.
ibrahim-shehzad Mar 23, 2024
8337f64
Fix remnant of indexing bug.
ibrahim-shehzad Mar 23, 2024
0c2ceb5
Fix remnant of indexing bug.
ibrahim-shehzad Mar 23, 2024
3305225
Remove typo in cutting_optimization, update doc string.
ibrahim-shehzad Mar 23, 2024
22f99ee
Use new opt settings class
caleb-johnson Mar 23, 2024
ca597a4
Update to new class in cutting pkg
caleb-johnson Mar 23, 2024
de8a273
Fix style, docstring.
ibrahim-shehzad Mar 24, 2024
ad62b38
release note
caleb-johnson Mar 25, 2024
f09219f
Merge branch 'LO-circuit-cuts-optimizer' of github.com:Qiskit-Extensi…
caleb-johnson Mar 25, 2024
cc8788e
Edit release notes, clean up tutorial
ibrahim-shehzad Mar 25, 2024
1e497c4
Change to qubits per subcircuit everywhere
ibrahim-shehzad Mar 25, 2024
5a501a6
Expand release note
ibrahim-shehzad Mar 25, 2024
c832fc5
Create find_cuts module
caleb-johnson Mar 25, 2024
b53b84c
Merge branch 'main' of github.com:Qiskit-Extensions/circuit-knitting-…
caleb-johnson Mar 25, 2024
0cdf7df
Ignore CutBothWires for coverage
caleb-johnson Mar 25, 2024
2d9f884
Fix coverage
caleb-johnson Mar 26, 2024
363d901
black
caleb-johnson Mar 26, 2024
4f563d1
Clean up docstring
caleb-johnson Mar 26, 2024
a0a5b8e
Improve docstring
caleb-johnson Mar 26, 2024
62ad832
Upeate release notes
ibrahim-shehzad Mar 26, 2024
62a1121
Merge branch 'LO-circuit-cuts-optimizer' of https://github.com/Qiskit…
ibrahim-shehzad Mar 26, 2024
3cf4c9b
Remove extraneous tutorial
ibrahim-shehzad Mar 26, 2024
f91fac0
Add test, edit docstrings.
ibrahim-shehzad Mar 27, 2024
4b73535
Fix docstring typo
ibrahim-shehzad Mar 27, 2024
e1d6660
Docstring
ibrahim-shehzad Mar 27, 2024
f64ca8a
Import test circuit from qasm, edit docstrings and release notes.
ibrahim-shehzad Mar 28, 2024
68b9c1c
Correct path to test circuit
ibrahim-shehzad Mar 29, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.10'
- name: Install tox
run: |
python -m pip install --upgrade pip
Expand Down
18 changes: 18 additions & 0 deletions circuit_knitting/cutting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
:toctree: ../stubs/
:nosignatures:

find_cuts
cut_wires
expand_observables
partition_circuit_qubits
Expand Down Expand Up @@ -60,6 +61,17 @@
qpd.decompose_qpd_instructions
qpd.qpdbasis_from_instruction

Automatic Cut Finding
=====================

.. autosummary::
:toctree: ../stubs/
:nosignatures:
:template: autosummary/class_no_inherited_members.rst

cut_finding.OptimizationParameters
cut_finding.DeviceConstraints

CutQC
=====

Expand All @@ -82,11 +94,15 @@
cut_gates,
PartitionedCuttingProblem,
)
from .find_cuts import find_cuts
from .cutting_experiments import generate_cutting_experiments
from .cutting_reconstruction import reconstruct_expectation_values
from .wire_cutting_transforms import cut_wires, expand_observables
from .cut_finding.quantum_device_constraints import DeviceConstraints
from .cut_finding.optimization_settings import OptimizationParameters

__all__ = [
"find_cuts",
"partition_circuit_qubits",
"partition_problem",
"cut_gates",
Expand All @@ -95,4 +111,6 @@
"PartitionedCuttingProblem",
"cut_wires",
"expand_observables",
"DeviceConstraints",
"OptimizationParameters",
]
15 changes: 15 additions & 0 deletions circuit_knitting/cutting/cut_finding/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Main automated cut finding functionality."""

from .optimization_settings import OptimizationParameters
from .quantum_device_constraints import DeviceConstraints

__all__ = ["DeviceConstraints", "OptimizationParameters"]
Loading