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 an option to build a PauliSum from a Sympy Boolean expression #4282

Merged
merged 16 commits into from Jul 9, 2021

Conversation

tonybruguier
Copy link
Contributor

As part of the the review #3989 we could use the ability to build a PauliSum from a Boolean expression. This PR makes available that function (smaller change).

@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Jul 2, 2021
@tonybruguier tonybruguier marked this pull request as ready for review July 3, 2021 05:31
@tonybruguier tonybruguier requested review from cduck, vtomole and a team as code owners July 3, 2021 05:31
@tonybruguier
Copy link
Contributor Author

@balopat This is one of the smaller PRs you suggested.

Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

LGTM with a little nit + it would be nice to add a little explanation in our docs/operators_and_observables.ipynb

cirq-core/cirq/ops/linear_combinations.py Outdated Show resolved Hide resolved
@balopat balopat changed the title Add an option to build a PauliSum from a Sympy Boolean expressions Add an option to build a PauliSum from a Sympy Boolean expression Jul 9, 2021
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@balopat
Copy link
Contributor

balopat commented Jul 9, 2021

Sorry for the linter checks - I am reverting that change.

"id": "ba00a12b9fbd"
},
"source": [
"A Pauli sum can also be constructed from a `Sympy` Boolean expression:"
Copy link
Contributor

Choose a reason for hiding this comment

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

Add in the reference here to the paper.

Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

LGTM with a final nit.

@tonybruguier
Copy link
Contributor Author

@balopat
Added the reference to the Jupyter notebook.

@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 9, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 9, 2021
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 9, 2021

Automerge cancelled: A required status check is not present.

Missing statuses: ['Format check']

@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jul 9, 2021
@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 9, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 9, 2021
@CirqBot
Copy link
Collaborator

CirqBot commented Jul 9, 2021

Automerge cancelled: A required status check is not present.

Missing statuses: ['Format check']

@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jul 9, 2021
@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 9, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 9, 2021
@CirqBot CirqBot merged commit ada1b09 into quantumlib:master Jul 9, 2021
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jul 9, 2021
@tonybruguier tonybruguier deleted the bool_ham_to_ps branch July 22, 2021 03:36
CirqBot pushed a commit that referenced this pull request Aug 6, 2021
Following #4282, the present PR would like to add a gate that allows computing the Hamiltonian from a Boolean expression. Note that while the decomposition is somewhat efficient, more optimizations are possible and planned in a follow-up PR.
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
…antumlib#4282)

As part of the the review quantumlib#3989 we could use the ability to build a PauliSum from a Boolean expression. This PR makes available that function (smaller change).
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Following quantumlib#4282, the present PR would like to add a gate that allows computing the Hamiltonian from a Boolean expression. Note that while the decomposition is somewhat efficient, more optimizations are possible and planned in a follow-up PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants