Skip to content

Commit

Permalink
fix(sk_synthesis): Remove cz & ccz from synth gates
Browse files Browse the repository at this point in the history
We used to apply the SK synthesis algorithm to the CZ & CCZ gates.
This behaviour was inappropriate as these gates are discrete gates,
and should not be approximated like a continuous one (e.g.: rZ(theta)).

The CZ & CCZ should rather be replaced by CX & CCX respectively in the
"Basis Translation" step of transpilation instead.

This commit does this by removing CZ & CCZ from the list of gates to
synthesize, so they will be ignored by the SK synthesis step.
  • Loading branch information
Maxence Drutel committed Feb 16, 2024
1 parent be4a264 commit 74b7d91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qiskit_alice_bob_provider/plugins/sk_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def pass_manager(
'measure',
'measure_x',
'delay',
'cz',
'ccz',
}:
continue
if instr.num_qubits == 1:
Expand All @@ -95,7 +97,7 @@ def pass_manager(
# List gates to synthesize (all gates except basis gates)
synth_gates: Set[str] = set()
for name, instr in get_standard_gate_name_mapping().items():
if name in {'measure', 'measure_x', 'reset', 'delay'}:
if name in {'measure', 'measure_x', 'reset', 'delay', 'cz', 'ccz'}:
continue
synth_gates.add(name)
synth_gates -= set(discrete_basis_gates)
Expand Down

0 comments on commit 74b7d91

Please sign in to comment.