Environment
- Qiskit version: 2.5.0.dev0
What is happening?
The current condition of lines 267-271 in inverse_cancellation.rs is
if inst.qubits == next_inst.qubits
&& (inst.op.try_standard_gate() == Some(gate_0)
&& next_inst.op.try_standard_gate() == Some(gate_1))
|| (inst.op.try_standard_gate() == Some(gate_1)
&& next_inst.op.try_standard_gate() == Some(gate_0))
The a && b || c should be a && (b || c) here.
How can we reproduce the issue?
If nodes[i]'s gate is gate_1 and nodes[i+1]'s gate is gate_0, but their qubits are different,
then function std_inverse_pairs will still remove them.
What should happen?
The condition of lines 267-271 in inverse_cancellation.rs should be
if inst.qubits == next_inst.qubits
&& ((inst.op.try_standard_gate() == Some(gate_0)
&& next_inst.op.try_standard_gate() == Some(gate_1))
|| (inst.op.try_standard_gate() == Some(gate_1)
&& next_inst.op.try_standard_gate() == Some(gate_0)))
Any suggestions?
No response
Environment
What is happening?
The current condition of lines 267-271 in inverse_cancellation.rs is
The
a && b || cshould bea && (b || c)here.How can we reproduce the issue?
If
nodes[i]'s gate isgate_1andnodes[i+1]'s gate isgate_0, but theirqubitsare different,then function
std_inverse_pairswill still remove them.What should happen?
The condition of lines 267-271 in inverse_cancellation.rs should be
Any suggestions?
No response