qiskit-algorithms icon indicating copy to clipboard operation
qiskit-algorithms copied to clipboard

ComputeUncompute fidelity - lack of transpilation option

Open rihartma opened this issue 7 months ago • 0 comments

What should we add?

When using ComputeUncompute, there is no option to transpile the final circuit for specific backend (using a PassManager), therefore it cannot be used sufficiently on real devices.

A possible solution (which is not sufficient!) would be to pass already transpiled circuits to create_fidelity_circuit method, but it is using the circuit .inverse() method, which contains inverse gates which might not be implemented on the specific quantum device, therefore it cannot be used.

I suggest adding a new optional parameter _pass_manager (of type PassManager) to ComputeUncompute with the following behavior:

  • If None, then the behavior would remain unchanged.
  • Otherwise, before the circuit is returned in create_fidelity_circuit, it would be transformed to satisfy the PassManager constraints.

I already have a basic local implementation and can submit a pull request.

rihartma avatar Jul 22 '24 14:07 rihartma