-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Remove list argument broadcasting and simplify transpile() #10291
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
094fb0f
Remove list argument broadcasting and simplify transpile()
mtreinish e416792
Fix _skip_target logic
mtreinish 99ee51a
Merge remote-tracking branch 'origin/main' into better-transpile
mtreinish 9becdfb
Fix InstructionScheduleMap handling with backendv2
mtreinish a8b51a7
Fix test failure caused by exception being raised later
mtreinish 34cb5e3
Fix indentation error
mtreinish 2d20bdb
Update qiskit/providers/fake_provider/fake_backend.py
mtreinish b5ded69
Merge branch 'main' into better-transpile
mtreinish 88abdb0
Fix standalone dt argument handling
mtreinish 3cfb059
Merge branch 'main' into better-transpile
mtreinish bb91c43
Remove unused code
mtreinish 966003b
Fix lint
mtreinish ad0e404
Merge branch 'main' into better-transpile
mtreinish 8a04ed3
Remove duplicate import in set_layout.py
mtreinish a1f7072
Merge branch 'main' into better-transpile
mtreinish ffd1019
Update release notes
mtreinish 0ea2eda
Adjust logic for _skip_transpile to check if None
mtreinish 75c918b
Simplify check cmap code
mtreinish 87df8cc
Merge branch 'main' into better-transpile
mtreinish 04bcd2c
Only check backend if it exists
mtreinish a47e108
Merge branch 'main' into better-transpile
mtreinish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
releasenotes/notes/remove-transpile-broadcast-1dfde28d508efa0d.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
upgrade: | ||
- | | ||
Support for passing in lists of argument values to the :func:`~.transpile` | ||
function is removed. This functionality was deprecated as part of the | ||
0.23.0 release and is now being removed. You are still able to pass in a | ||
list of :class:`~.QuantumCircuit` objects for the first positional argument, | ||
what has been removed is the broadcasting lists of the other arguments to | ||
each circuit in that input list. Removing this functionality was necessary | ||
to greatly reduce the overhead for parallel execution for transpiling | ||
multiple circuits at once. If you’re using this functionality | ||
currently you can call :func:`~.transpile` multiple times instead. For | ||
example if you were previously doing something like:: | ||
|
||
from qiskit.transpiler import CouplingMap | ||
from qiskit import QuantumCircuit | ||
from qiskit import transpile | ||
|
||
qc = QuantumCircuit(2) | ||
qc.h(0) | ||
qc.cx(0, 1) | ||
qc.measure_all() | ||
|
||
cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] | ||
results = transpile([qc] * 6, coupling_map=cmaps) | ||
|
||
instead you should now run something like:: | ||
|
||
from qiskit.transpiler import CouplingMap | ||
from qiskit import QuantumCircuit | ||
from qiskit import transpile | ||
|
||
qc = QuantumCircuit(2) | ||
qc.h(0) | ||
qc.cx(0, 1) | ||
qc.measure_all() | ||
|
||
cmaps = [CouplingMap.from_heavy_hex(d) for d in range(3, 15, 2)] | ||
results = [transpile(qc, coupling_map=cm) for cm in cmap] | ||
|
||
You can also leverage :func:`~.parallel_map` or ``multiprocessing`` from | ||
the Python standard library if you want to run this in parallel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the new error message significantly worse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was when I modified this test, but @1ucian0 added a real error message in
SetLayout
as part of #10344 so it'll say:now. (I glossed over
<>
in my review we should change that to actually say1024 qubits in the layout != 2 qubits in the circuit
or something more explicit instead)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just stick
from __future__ import barry_as_FLUFL
at the top of the file lol