-
Notifications
You must be signed in to change notification settings - Fork 47
Implement ppm_specs
pass
#1794
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
base: main
Are you sure you want to change the base?
Implement ppm_specs
pass
#1794
Conversation
Hello. You may have forgotten to update the changelog!
|
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.
Thank you @ritu-thombre99
4d2af1b
to
ef174bf
Compare
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.
Nice works, @ritu-thombre99! I left some comments here. Thanks for PR.
struct CountPPMSpecsPass : public impl::CountPPMSpecsPassBase<CountPPMSpecsPass> { | ||
using CountPPMSpecsPassBase::CountPPMSpecsPassBase; | ||
|
||
void print_specs() |
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.
The function works; however, I would recommend breaking it into functions. Example: countPPM(op)
, countPPR(op)
, countLogicalQubit(op)
.
#define GEN_PASS_DECL_COUNTPPMSPECSPASS | ||
#include "QEC/Transforms/Passes.h.inc" | ||
|
||
struct CountPPMSpecsPass : public impl::CountPPMSpecsPassBase<CountPPMSpecsPass> { |
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.
Could you change the variable name using CamelCase, as well?
Context:
Description of the Change: Count the following PPR/PPM specs after
qec
transformation and print it using passppm_specs
(with functioncircuit.get_ppm_spec()
in python frontend) or--ppm_specs
in the Catalyst CLIBenefits: Useful for resource estimation
Possible Drawbacks:
Running Catalyst CLI with
--ppm_specs
will output both MLIR output and ppm_specs.Related GitHub Issues:
TODO
Example:
Prints the following output:
[sc-92003]