You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fall back to op.decompose if op is unsolved in decomposition graph (#8156)
**Context:**
The DecompositionGraph currently errors out completely if any of the
operators is unsolved for, and as a result, with graph enabled, if a
circuit contains a single operator/template that is not yet integrated
with the new decomposition system, the entire thing fails, and the user
is forced to turn off graph mode and use the old decomposition system.
We want to change this behaviour, make it so that the DecompositionGraph
raise a warning instead of an error if certain operators are unsolved
for, and fall back to using op.decomposition for those operators.
**Description of the Change:**
- Downgrade error to a warning when certain operators are unsolved in
the graph.
- Add sensible warning for when the graph failed to find a solution due
to GlobalPhase.
- When the new system is enabled, operators without a decomposition will
be left undecomposed with a warning.
**Benefits:**
- The user can use the new system for the rest of the circuit even if it
contains templates that are not yet integrated with the new graph-based
system.
**Possible Drawbacks:**
**Related GitHub Issues:**
[sc-98390]
---------
Co-authored-by: Yushao Chen (Jerry) <[email protected]>
Co-authored-by: Isaac De Vlugt <[email protected]>
Co-authored-by: Pietropaolo Frisoni <[email protected]>
Copy file name to clipboardExpand all lines: doc/releases/changelog-dev.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -502,6 +502,13 @@
502
502
* A :class:`~.decomposition.decomposition_graph.DecompGraphSolution` class is added to store the solution of a decomposition graph. An instance of this class is returned from the `solve` method of the :class:`~.decomposition.decomposition_graph.DecompositionGraph`.
* With the graph-based decomposition system enabled (:func:`~.decomposition.enable_graph()`), if a decomposition cannot be found for an operator in the circuit, it no longer
506
+
raises an error. Instead, a warning is raised, and `op.decomposition()` (the current default method for decomposing gates) is
507
+
used as a fallback, while the rest of the circuit is still decomposed with
508
+
the new graph-based system. Additionally, a special warning message is
509
+
raised if the circuit contains a `GlobalPhase`, reminding the user that
510
+
`GlobalPhase` is not assumed to have a decomposition under the new system.
0 commit comments