Skip to content

[WIP] Readd support for directed basis gates to RB experiments#957

Closed
itoko wants to merge 2 commits into
qiskit-community:feature/rb_speedupfrom
itoko:readd-directed-basis-support
Closed

[WIP] Readd support for directed basis gates to RB experiments#957
itoko wants to merge 2 commits into
qiskit-community:feature/rb_speedupfrom
itoko:readd-directed-basis-support

Conversation

@itoko
Copy link
Copy Markdown
Contributor

@itoko itoko commented Oct 27, 2022

Summary

This PR fixes a feature regression introduced in #922 by re-adding the support of directed basis gates to RB module.

Details and comments

#922 accidentally dropped the support of backends with directed basis gates since it replaced the call of transpile(circ, backend) with transpile(circ, basis_gates=basis_gates). This commit re-add the support.
For that, it newly introduces ReducedTarget class that is a custom Target class sufficient for basis translation in RB circuit generation. So that enables a call transpile(circ, target=target) and caches the resulting circuit.

Alternative solution

We might to need to discuss more if ReducedTarget is the right object to represent directed basis gates. It's essentially a set of (op_name, qargs) tuple, e.g. ("cx", (0, 1)) etc. The developer of translator may want to get Instruction object corresponding to the op_name string. Target does provide such a function. That's why I introduce ReducedTarget inheriting Target instead of having yet-another type similar to Target. However, it would take much more time than we thought to think of the best interface data class. So for now, it might be better to have a logic to check if available operations on the physical qubits are directed or not and if all are directed, fall back to call transpile as before. It means we give up a speed up for some cases with directed basis. #960 is an implementation taking this alternative approach.

@itoko itoko added the on hold On hold until something else is done. label Oct 28, 2022
@itoko itoko changed the title Readd support for directed basis gates to RB experiments [WIP] Readd support for directed basis gates to RB experiments Oct 28, 2022
@itoko
Copy link
Copy Markdown
Contributor Author

itoko commented Nov 16, 2022

Close in favor of #960

@itoko itoko closed this Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on hold On hold until something else is done.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant