Add some utilities for T-rex error mitigation#8095
Conversation
obriente
left a comment
There was a problem hiding this comment.
Thanks for submitting! The code seems ok, but I'm worried about some forward-compatibility issues, as well as making the workflow as easy as possible to combine with other error mitigation techniques. Would defer to other people on the team whether this is a significant issue or something that we can deal with later.
|
@obriente Would you be willing to act as reviewer for this PR? I mean, you basically have been already :-). Can we assign you to this PR? |
obriente
left a comment
There was a problem hiding this comment.
All of my comments were addressed, LGTM
mhucka
left a comment
There was a problem hiding this comment.
Spotted some possible minor issues.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8095 +/- ##
========================================
Coverage 99.60% 99.60%
========================================
Files 1118 1118
Lines 100951 101213 +262
========================================
+ Hits 100551 100812 +261
- Misses 400 401 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@ddddddanni Thank you for working on this! I hate to be a nag, but could you click on the "Resolve conversation" button for those review items that are, in fact, resolved? I think they all are, but can't be 100% sure myself. |
Sure! I think this is resolved since Tom has approved the PR. |
mhucka
left a comment
There was a problem hiding this comment.
Thank you for working on this, and I'm sorry to make more requests …
mhucka
left a comment
There was a problem hiding this comment.
@ddddddanni Thank you for all the hard work on this and addressing my comments! LGTM.


This PR introduces the initial building blocks and helper functions required to support T-REX error mitigation in
pauli expectation calculation.
The change includes:
Implement
_get_trex_twirled_basis_gateto fetch the appropriate rotation gates (Rx, Ry, X, I) based on the target Pauli basis and flip state.Implement
_generate_random_boolean_choicesto generate randomized 2D boolean arrays for twirling operations.Implement
_build_trex_twirled_pauli_circuitsto append the appropriate basis twirling gates and joint measurements to a base circuit.