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

Default set to turn off approximation_degree #8595

Merged
merged 13 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
2 changes: 1 addition & 1 deletion qiskit/compiler/transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def transpile(
scheduling_method: Optional[str] = None,
instruction_durations: Optional[InstructionDurationsType] = None,
dt: Optional[float] = None,
approximation_degree: Optional[float] = None,
approximation_degree: Optional[float] = 1.0,
timing_constraints: Optional[Dict[str, int]] = None,
seed_transpiler: Optional[int] = None,
optimization_level: Optional[int] = None,
Expand Down
16 changes: 16 additions & 0 deletions releasenotes/notes/turn-off-approx-degree-df3d39eb69f7f09f.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
upgrade:
- |
The implicit use of ``approximation_degree!=1.0`` by default in
in the :func:`~.transpile` function when ``optimization_level=3`` is set has been disabled. The transpiler should, by default,
preserve unitarity of the input up to known transformations such as one-sided permutations
and similarity transformations. This was broken by the previous use of ``approximation_degree=None``
leading to incorrect results in cases such as Trotterized evolution with many time steps where
unitaries were being overly approximated leading to incorrect results. It was decided that
transformations that break unitary equivalence should be explicitly activated by the user.
If you desire the previous default behavior where synthesized :class:`~UnitaryGate` instructions
are approximated up to the error rates of the target backend's native instructions you can explicitly
set ``approximation_degree=None` when calling :func:`~.transpile` with ``optimization_level=3`, for
mtreinish marked this conversation as resolved.
Show resolved Hide resolved
example::

transpile(circuit, backend, approximation_degree=None, optimization_level=3)