Skip to content

Conversation

caleb-johnson
Copy link
Contributor

@caleb-johnson caleb-johnson commented Mar 15, 2024

Summary

In the LieTrotter class, during creation of the evolution circuit, QuantumCircuit.compose is called num_reps * num_pauli_terms times. We can reduce the number of calls to compose to num_pauli_terms by creating one step of the circuit and using QuantumCircuit.repeat to add the remaining steps.

Details and comments

  • For a 115q operator with 741 terms for 2 reps, this yields a run time improvement of 33% (18s to 12s)
  • For a 291q operator with 1893 terms for 2 reps, this yields a run time improvement of ~60% (181s to 73s)

@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@coveralls
Copy link

coveralls commented Mar 15, 2024

Pull Request Test Coverage Report for Build 8361056840

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 4 of 5 (80.0%) changed or added relevant lines in 1 file are covered.
  • 118 unchanged lines in 8 files lost coverage.
  • Overall coverage remained the same at 89.308%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/synthesis/evolution/lie_trotter.py 4 5 80.0%
Files with Coverage Reduction New Missed Lines %
qiskit/primitives/containers/estimator_pub.py 1 97.59%
qiskit/primitives/containers/sampler_pub.py 2 97.26%
crates/qasm2/src/lex.rs 5 92.7%
crates/qasm2/src/parse.rs 6 97.15%
qiskit/synthesis/two_qubit/two_qubit_decompose.py 16 95.03%
qiskit/pulse/builder.py 23 89.11%
crates/accelerate/src/euler_one_qubit_decomposer.rs 26 91.05%
crates/accelerate/src/two_qubit_decompose.rs 39 90.86%
Totals Coverage Status
Change from base Build 8301646147: 0.0%
Covered Lines: 59813
Relevant Lines: 66974

💛 - Coveralls

@ShellyGarion ShellyGarion added this to the 1.1.0 milestone Mar 20, 2024
@ShellyGarion ShellyGarion self-assigned this Mar 20, 2024
Copy link
Member

@ShellyGarion ShellyGarion left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @caleb-johnson and @mrossinek

@ElePT ElePT added this pull request to the merge queue Mar 21, 2024
Merged via the queue into Qiskit:main with commit c6f4d46 Mar 21, 2024
@sbrandhsn sbrandhsn added the Changelog: New Feature Include in the "Added" section of the changelog label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants