-
Notifications
You must be signed in to change notification settings - Fork 48
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
add conditional parameter to gate counting #1662
Conversation
@@ -1119,6 +1119,7 @@ class Circuit { | |||
std::map<OpType, unsigned> op_counts() const; | |||
|
|||
unsigned count_gates(const OpType &op_type) const; | |||
unsigned count_gates_conditional(const OpType &op_type) const; |
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.
I think we should just add an optional argument to count_gates()
to make it count conditionals as well.
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.
done in 127a9cc
"type: The operation type to search for\n:return: the " | ||
"number of operations matching `type`", | ||
py::arg("type")) | ||
"type: The operation type to search for\n:param " |
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.
"type: The operation type to search for\n:param " | |
"type: The operation type to search for\n\n:param " |
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.
done in 127a9cc
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.
Added this for the return, too.
"number of operations matching `type`", | ||
py::arg("type")) | ||
"type: The operation type to search for\n:param " | ||
"conditional: if set to true, conditional gates will " |
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.
I think include_conditional
would be a better name.
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.
done in 127a9cc
Description
Solves #1477
Related issues
Please mention any github issues addressed by this PR.
Checklist