Closed dakk closed 4 months ago
I would like to try to solve this issue @dakk Could you assign that to me
@Youngcius according to rules, an Issue is assigned to a contributor if contributor's PR gets successfully approved by the maintainer. I'm sorry for the confusion.
I see! Thanks for your info
@tomv42 thank you for the contribution, I merged the pull request after I made just a tiny edit, by using Qtype.fill
instead of pad_operand
(https://github.com/dakk/qlasskit/commit/d8b299efc40205cc1f6a75a39b9cc192fcc092d0).
Please comment this issue so I'm able to assign it to you.
@dakk Thanks for merging the pull request! I enjoyed working on it and found the project very interesting.
Great to hear that, if you will encounter a situation where qlasskit could be useful, please suggest or use it!
If you want, there are other open issues for the unitary hack: https://unitaryhack.dev/projects/qlasskit/
Implement the
ast.Pow
operator () between a variable and an integer constant. Since a n == a a ... * a, we implement this operator with a rewriting rule inast2ast
.The rewriting rule should be placed in the class
AstRewriter
(https://github.com/dakk/qlasskit/blob/master/qlasskit/ast2ast.py#L137), overriding the methodvisit_Pow
, and rewriting the pow as multiplications.n
is an ast.Constant, positive integervisit_Pow
won't work, overridevisit_BinOp
instead and check if the expression is aast.Pow
Please read CONTRIBUTING.md before contributing.