Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Fix Trotter evolution of sums with identity terms #1304

Merged

Conversation

jlapeyre
Copy link
Contributor

@jlapeyre jlapeyre commented Oct 2, 2020

Previously, Trotterization did not exclude any terms consisting of a scalar times the
identity from the list of terms to be repeated. Instead, if present, an identity term was
included in the resulting circuit as repeated identity gates, with the coefficient of the
identity operator discarded. But, this coefficient must be accounted for:
exp(-i * coeff * I) should introduce a global phase.

With this PR, we remove the scalar-multiple-of-identity terms from the SummedOp to be
Trotterized. We then set the global phase of the resulting circuit to account for the
removed identity terms.

Fixes #1269

This PR appears to solve the problem and not cause tests to fail. It requires tests and a release note.

Previously, Trotterization did not exclude any terms consisting of a scalar times the
identity from the list of terms to be repeated. Instead, if present, an identity term was
included in the resulting circuit as repeated identity gates, with the coefficient of the
identity operator discarded.  But, this coefficient must be accounted for: exp(-i * coeff
* I) should introduce a global phase.

With this PR, we remove the scalar-multiple-of-identity terms from the SummedOp to be
Trotterized. We then set the global phase of the resulting circuit to account for the
removed identity term.

Fixes qiskit-community#1269
@woodsp-ibm woodsp-ibm added the Changelog: Bugfix Include in the Fixed section of the changelog label Oct 2, 2020
@woodsp-ibm woodsp-ibm added this to the 0.8 milestone Oct 2, 2020
@jlapeyre jlapeyre changed the title [WIP] Fix Trotter evolution of sums with identity terms Fix Trotter evolution of sums with identity terms Oct 2, 2020
@jlapeyre jlapeyre force-pushed the fix-trotter-global-phase branch from fbda906 to c92b42f Compare October 2, 2020 19:35
@manoelmarques manoelmarques merged commit 0a1897a into qiskit-community:master Oct 2, 2020
mtreinish pushed a commit to mtreinish/qiskit-core that referenced this pull request Nov 20, 2020
…iskit-aqua#1304)

* Fix Trotter evolution of sums with identity terms

Previously, Trotterization did not exclude any terms consisting of a scalar times the
identity from the list of terms to be repeated. Instead, if present, an identity term was
included in the resulting circuit as repeated identity gates, with the coefficient of the
identity operator discarded.  But, this coefficient must be accounted for: exp(-i * coeff
* I) should introduce a global phase.

With this PR, we remove the scalar-multiple-of-identity terms from the SummedOp to be
Trotterized. We then set the global phase of the resulting circuit to account for the
removed identity term.

Fixes qiskit-community/qiskit-aqua#1269

* Add test for Trotter evolution of sums with identity terms

* Add release note for fix-trotter-global-phase

* Fix linter complaints

Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
manoelmarques pushed a commit to manoelmarques/qiskit-terra that referenced this pull request Dec 2, 2020
…iskit-aqua#1304)

* Fix Trotter evolution of sums with identity terms

Previously, Trotterization did not exclude any terms consisting of a scalar times the
identity from the list of terms to be repeated. Instead, if present, an identity term was
included in the resulting circuit as repeated identity gates, with the coefficient of the
identity operator discarded.  But, this coefficient must be accounted for: exp(-i * coeff
* I) should introduce a global phase.

With this PR, we remove the scalar-multiple-of-identity terms from the SummedOp to be
Trotterized. We then set the global phase of the resulting circuit to account for the
removed identity term.

Fixes qiskit-community/qiskit-aqua#1269

* Add test for Trotter evolution of sums with identity terms

* Add release note for fix-trotter-global-phase

* Fix linter complaints

Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
manoelmarques pushed a commit to manoelmarques/qiskit-terra that referenced this pull request Dec 7, 2020
…iskit-aqua#1304)

* Fix Trotter evolution of sums with identity terms

Previously, Trotterization did not exclude any terms consisting of a scalar times the
identity from the list of terms to be repeated. Instead, if present, an identity term was
included in the resulting circuit as repeated identity gates, with the coefficient of the
identity operator discarded.  But, this coefficient must be accounted for: exp(-i * coeff
* I) should introduce a global phase.

With this PR, we remove the scalar-multiple-of-identity terms from the SummedOp to be
Trotterized. We then set the global phase of the resulting circuit to account for the
removed identity term.

Fixes qiskit-community/qiskit-aqua#1269

* Add test for Trotter evolution of sums with identity terms

* Add release note for fix-trotter-global-phase

* Fix linter complaints

Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Changelog: Bugfix Include in the Fixed section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MatrixEvolution and PauliTrotterEvolution return different results for the same underlying operator.
3 participants