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

Disable approximate synthesis based on device gate error. #7348

Closed
Changes from all 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
19 changes: 15 additions & 4 deletions qiskit/transpiler/passes/synthesis/unitary_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,21 @@ def _synth_natural_direction(
"could be determined from coupling map or "
"gate lengths."
)
if approximation_degree is not None:
basis_fidelity = approximation_degree
else:
basis_fidelity = physical_gate_fidelity

# GH-6581 introduced a behavior of setting the basis_fidelity used
# by decomposer2q from the reported device gate_error of the
# corresponding 2q gate. GH-7341 reported a case where this
# approximation removed small but significant interactions
# resulting in an non-equivalent output circuit. As a workaround,
# revert to the prior behavior of using decomposer2q's default
# basis_fidelity (1, no approximation).

# if approximation_degree is not None:
# basis_fidelity = approximation_degree
# else:
# basis_fidelity = physical_gate_fidelity
basis_fidelity = approximation_degree

synth_circ = decomposer2q(su4_mat, basis_fidelity=basis_fidelity)
synth_dag = circuit_to_dag(synth_circ)

Expand Down