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

Removing unnecessary identity operation from exponential_map() #373

Closed
wants to merge 4 commits into from

Conversation

markf94
Copy link
Contributor

@markf94 markf94 commented Mar 30, 2018

The hardcoded implementation of the identity operation on the
0th qubit unnecessarily inflates circuits (even if it gets removed
later in the compiler) and leads to problems when using the new
embedding argument in the QAOA instance (see PR #143 in grove)

the hardcoded implementation of the identity operation on the
0th qubit unnecessarily inflates circuits (even if it gets removed
later in the compiler) and leads to problems when using the new
``embedding`` argument in the QAOA instance
@mpharrigan
Copy link
Contributor

@willzeng @ecp-rigetti and others. I think think there was a conscious decision to keep these phase factors in. It's unfortunate that it always hits the 0th qubit though.

@ncrubin
Copy link
Contributor

ncrubin commented Mar 30, 2018

@mpharrigan I think it's good to remove. It was original included for testing purposes. I agree with @markf94 that these terms only inflate the circuit.

@ecpeterson
Copy link
Contributor

I'm happy to see the debug PHASEs gone.

@mpharrigan
Copy link
Contributor

Hi @markf94

Sorry for the really long delay. This has spurred some confused discussion internally about what to do about these phases. The call was made to keep these phases. It's a real problem that it always applies to qubit 0, but I think we'll have to come up with another way around it cc #417

@mpharrigan mpharrigan closed this Apr 27, 2018
@ecpeterson
Copy link
Contributor

A year and a half later, I don't recall what people cared about this phase factor for, and I'm inclined to re-open this PR for consideration.

This PR doesn't get rid of the phase factor in the PauliSum itself — just in the conversion of its exponentiation to a circuit. Any interested party could still look at the PauliSum directly to discover the phase factor.

@ecpeterson ecpeterson reopened this Oct 23, 2019
@ecpeterson ecpeterson requested a review from a team as a code owner October 23, 2019 17:29
@ecpeterson
Copy link
Contributor

@markf94 If you update this to also kill the PHASE appearing in pyquil/tests/test_paulis_with_placeholders.py, then I think we're finally ready to merge this.

jlapeyre added a commit that referenced this pull request Feb 25, 2020
* exponential_map of the identity applies a PHASE gate and
its inverse. This was apparently for debugging purposes. This
PR replaces the PHASE gates with an empty Program.

* This PR moves conditionals on data that is closed over from
inside the closure to outside. That is, the gate that is exponentiated
is checked when the closure is created, but not when it is executed.

Closes #1055. This PR obsoletes PR #373.
jlapeyre added a commit that referenced this pull request Feb 25, 2020
* exponential_map of the identity applies a PHASE gate and
its inverse. This was apparently for debugging purposes. This
PR replaces the PHASE gates with an empty Program.

* This PR moves conditionals on data that is closed over from
inside the closure to outside. That is, the gate that is exponentiated
is checked when the closure is created, but not when it is executed.

Closes #1055. This PR obsoletes PR #373.
jlapeyre added a commit that referenced this pull request Feb 25, 2020
* exponential_map of the identity applies a PHASE gate and
its inverse. This was apparently for debugging purposes. This
PR replaces the PHASE gates with an empty Program.

* This PR moves conditionals on data that is closed over from
inside the closure to outside. That is, the gate that is exponentiated
is checked when the closure is created, but not when it is executed.

Closes #1055. This PR obsoletes PR #373.
jlapeyre added a commit that referenced this pull request Feb 25, 2020
* exponential_map of the identity applies a PHASE gate and
its inverse. This was apparently for debugging purposes. This
PR replaces the PHASE gates with an empty Program.

* This PR moves conditionals on data that is closed over from
inside the closure to outside. That is, the gate that is exponentiated
is checked when the closure is created, but not when it is executed.

Closes #1055. This PR obsoletes PR #373.
jlapeyre added a commit that referenced this pull request Feb 25, 2020
* exponential_map of the identity applies a PHASE gate and
its inverse. This was apparently for debugging purposes. This
PR replaces the PHASE gates with an empty Program.

* This PR moves conditionals on data that is closed over from
inside the closure to outside. That is, the gate that is exponentiated
is checked when the closure is created, but not when it is executed.

Closes #1055. This PR obsoletes PR #373.
jlapeyre added a commit that referenced this pull request Feb 25, 2020
* exponential_map of the identity applies a PHASE gate and
its inverse. This was apparently for debugging purposes. This
PR replaces the PHASE gates with an empty Program.

* This PR moves conditionals on data that is closed over from
inside the closure to outside. That is, the gate that is exponentiated
is checked when the closure is created, but not when it is executed.

Closes #1055. This PR obsoletes PR #373.
jlapeyre added a commit that referenced this pull request Feb 26, 2020
* exponential_map of the identity applies a PHASE gate and
its inverse. This was apparently for debugging purposes. This
PR replaces the PHASE gates with an empty Program.

* This PR moves conditionals on data that is closed over from
inside the closure to outside. That is, the gate that is exponentiated
is checked when the closure is created, but not when it is executed.

Closes #1055. This PR obsoletes PR #373.
@notmgsk
Copy link
Contributor

notmgsk commented Mar 11, 2020

See #1182

@notmgsk notmgsk closed this Mar 11, 2020
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.

5 participants