-
Notifications
You must be signed in to change notification settings - Fork 1
Properly implement fidelity analysis with SCF #640
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
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just one comment on the implementation of IfElse. Also I would add a test to make sure that you execute only one branch if the branch value is known at compile time.
It depends on the situation, the short has is |
|
@weinbe58 Thanks for the review. The IfElse impls was somewhat left over from a previous version. It was also missing the return values. I fixed that, added the constant condition evaluation and a test.
I suppose it's fine then. Basically, the fidelity analysis will give up whenever there is any qubit without a known address. Technically, we could update the fidelity at least for the known qubits, but something's bound to go wrong in this case anyway since at least for one qubit the fidelity will be off. |
weinbe58
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #592 .
We are now mostly re-using the
AddressAnalysisfor walking the IR. Except forIfElsestatements, where we need to take care when merging results from branches.To do this, I had to make a small change to
AddressAnalysis, but that shouldn't affect anything else.Probably needs more tests, but basics seem to work quite well.
Also, we might need some wrapper around running this analysis to have a decent UX when trying to study the fidelity of a given program.
@weinbe58 I'm also not sure if I'm being to strict about expecting an
AddressRegforqubtis: IList[Qubit]arguments.