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

Delay support in Interleaved Randomized Benchmarking #776

Merged
merged 12 commits into from
Apr 27, 2022

Conversation

bicycle315
Copy link
Contributor

@bicycle315 bicycle315 commented Apr 21, 2022

Summary

Make Interleaved randomized benchmarking interleave the 'delay' instruction

Details and comments

Fixes #727 . Requires a fix in qiskit-terra : Qiskit/qiskit-terra#7850

@bicycle315 bicycle315 marked this pull request as ready for review April 24, 2022 14:35
if hasattr(group_elt_gate, "to_gate"):
group_elt_gate = group_elt_gate.to_gate()
if not isinstance(group_elt_gate, Instruction):
group_elt_gate = group_elt_gate.to_instruction()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has been already resolved with #762. Currently test is missing because support of Delay requires the latest terra which was unstable at the time I merged the PR. What is the point using to_instruction?

Copy link
Contributor

@itoko itoko Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix in #762 does not cover the case of interleaving a circuit with delays, which is tested in the test case below. If we interleave a QuantumCircuit object with delay, it fails in QuantumCircuit.to_gate method (as Delay is not a gate).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. I've forgotten the interleaved element typehint says QuantumCircuit is acceptable.

Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@chriseclectic chriseclectic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks straightforward, but I think this should count as a bugfix.

I think the tests require fixes from terra 0.20.1, so could you confirm that, and if so update the minimum terra req?

@@ -345,6 +346,39 @@ def test_non_clifford_interleaved_element(self):
lengths=lengths,
)

def test_interleaving_delay(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both these test requires qiskit-terra 0.20.1 to not error

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. All test passed in CI because it simply builds env with the latest version?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it will pull the latest stable in CI, but if someone updates an existing qiskit-experiment install from pip it wont automatically update terra unless we change the requirements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the minimum requirements in c5e66cd

@chriseclectic chriseclectic added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Apr 26, 2022
itoko and others added 4 commits April 27, 2022 08:18
Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
@chriseclectic chriseclectic added this to the Release 0.3 milestone Apr 27, 2022
@chriseclectic chriseclectic merged commit 129a8c6 into qiskit-community:main Apr 27, 2022
paco-ri pushed a commit to paco-ri/qiskit-experiments that referenced this pull request Jul 11, 2022
…y#776)

Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com>
Co-authored-by: Toshinari Itoko <itoko@jp.ibm.com>
Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InterleavedRB experiment does not support delay instruction
4 participants