Thanks to visit codestin.com
Credit goes to github.com

Skip to content

optimized QubitOperator subtraction#132

Merged
damiansteiger merged 1 commit into
ProjectQ-Framework:developfrom
babbush:qubit_op_subtraction
Jul 13, 2017
Merged

optimized QubitOperator subtraction#132
damiansteiger merged 1 commit into
ProjectQ-Framework:developfrom
babbush:qubit_op_subtraction

Conversation

@babbush

@babbush babbush commented Jul 13, 2017

Copy link
Copy Markdown
Contributor

I improved the implementation of the isub and sub routines in QubitOperator so that several unnecessary copies are avoided. Surprisingly, this optimization led to significantly better performance in some code that Ian and I are working on. One should not simply implement isub as += - QubitOp because that causes an unnecessary copy. In cases where these operators are large, this can create problems. I also added a few spaces to some of the docs as there was inconsistent spacing.

@babbush

babbush commented Jul 13, 2017

Copy link
Copy Markdown
Contributor Author

I might add that I basically just copied the structure of how I previously implemented iadd.

@damiansteiger damiansteiger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Ryan 👍

@damiansteiger damiansteiger merged commit 7455fc8 into ProjectQ-Framework:develop Jul 13, 2017
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.

2 participants