Skip to content
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

Merged
merged 3 commits into from
Oct 6, 2023
Merged

Add more arithmetic bloqs. #376

merged 3 commits into from
Oct 6, 2023

Conversation

fdmalone
Copy link
Collaborator

@fdmalone fdmalone commented Oct 5, 2023

  • Square real
  • Scale int by real
  • Multiply two reals

Fix bug with bitsize for sum of squares.

* Square real
* Scale int by real
* Multiply two reals

Fix bug with bitsize for sum of squares.
@fdmalone
Copy link
Collaborator Author

fdmalone commented Oct 5, 2023

Pulled out from #359

@fdmalone fdmalone requested a review from mpharrigan October 5, 2023 17:28
@fdmalone
Copy link
Collaborator Author

fdmalone commented Oct 5, 2023

Oh and an out of place adder which raised #375

return "c = a + b"

def t_complexity(self):
# TODO: This is just copied from adder above, not sure if correct.
Copy link
Contributor

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thanks!

Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

@mpharrigan mpharrigan left a 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

@fdmalone fdmalone merged commit ecdacc5 into main Oct 6, 2023
8 checks passed
@fdmalone fdmalone deleted the more_basic_bloqs branch October 6, 2023 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants