-
Notifications
You must be signed in to change notification settings - Fork 50
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 more arithmetic bloqs. #376
Conversation
* Square real * Scale int by real * Multiply two reals Fix bug with bitsize for sum of squares.
Pulled out from #359 |
Oh and an out of place adder which raised #375 |
qualtran/bloqs/arithmetic.py
Outdated
return "c = a + b" | ||
|
||
def t_complexity(self): | ||
# TODO: This is just copied from adder above, not sure if correct. |
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.
T count is correct. Clifford count should be inceased by bitsize
.
the decomposition would be
yield CNOT.on_each(zip(b, c))
yield Add(a, c)
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.
Awesome thanks!
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.
can we capture this somehow? i.e. by using bloq_counts of n
cnots and an Add
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
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.
giving approval, but try to incorporate nour's comment
Fix bug with bitsize for sum of squares.