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 insert_barrier argument to UnitaryOverlap #12321

Merged
merged 2 commits into from
May 17, 2024

Conversation

kevinsung
Copy link
Contributor

Summary

Fixes #12319

Details and comments

@kevinsung kevinsung requested a review from a team as a code owner May 1, 2024 14:29
@qiskit-bot
Copy link
Collaborator

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

  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia

@kevinsung kevinsung added this to the 1.1.0 milestone May 1, 2024
@mtreinish mtreinish added Changelog: New Feature Include in the "Added" section of the changelog mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels May 1, 2024
@mtreinish mtreinish modified the milestones: 1.1.0, 1.2.0 May 1, 2024
@kevinsung
Copy link
Contributor Author

Strange, I can't reproduce the CI test failures locally...

==============================
Failed 1 tests - output below:
==============================

test.python.circuit.library.test_overlap.TestUnitaryOverlap.test_insert_barrier
-------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/tmp/terra-tests/test/python/circuit/library/test_overlap.py", line 140, in test_insert_barrier
    self.assertEqual(

      File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/unittest/case.py", line 912, in assertEqual
    assertion_func(first, second, msg=msg)

      File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/unittest/case.py", line 1292, in assertMultiLineEqual
    self.fail(self._formatMessage(msg, standardMsg))

      File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)

    AssertionError: '┌───[35 chars]─┐ ░ »\nq: ┤ EfficientSU2(p1[0],p1[1],p1[2],p1[206 chars]───┘' != '┌───[35 chars]─┐ ░ ┌────────────────────────────────────────[185 chars]───┘'
+ ┌───────────────────────────────────────┐ ░ ┌──────────────────────────────────────────┐
+ q: ┤ EfficientSU2(p1[0],p1[1],p1[2],p1[3]) ├─░─┤ EfficientSU2_dg(p2[0],p2[1],p2[2],p2[3]) ├
+    └───────────────────────────────────────┘ ░ └──────────────────────────────────────────┘- ┌───────────────────────────────────────┐ ░ »
- q: ┤ EfficientSU2(p1[0],p1[1],p1[2],p1[3]) ├─░─»
-    └───────────────────────────────────────┘ ░ »
- «   ┌──────────────────────────────────────────┐
- «q: ┤ EfficientSU2_dg(p2[0],p2[1],p2[2],p2[3]) ├
- «   └──────────────────────────────────────────┘

Copy link
Contributor

@raynelfss raynelfss left a comment

Choose a reason for hiding this comment

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

Thank you for working on this. This looks good, however, I believe your assertion issue is due to the way the instance of Overlap is being drawn. There is an easy way to fix this though. Check my comment below.

test/python/circuit/library/test_overlap.py Outdated Show resolved Hide resolved
@coveralls
Copy link

Pull Request Test Coverage Report for Build 9133373485

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

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 979 unchanged lines in 56 files lost coverage.
  • Overall coverage increased (+0.07%) to 89.612%

Files with Coverage Reduction New Missed Lines %
qiskit/circuit/classical/expr/constructors.py 1 91.82%
qiskit/primitives/backend_estimator_v2.py 1 98.29%
qiskit/transpiler/passes/layout/apply_layout.py 1 98.25%
qiskit/primitives/statevector_sampler.py 1 99.08%
qiskit/circuit/store.py 1 94.44%
qiskit/passmanager/passmanager.py 1 92.63%
qiskit/circuit/library/data_preparation/initializer.py 1 93.75%
crates/accelerate/src/sabre/mod.rs 1 75.0%
qiskit/circuit/classical/expr/expr.py 1 93.51%
qiskit/transpiler/passes/routing/commuting_2q_gate_routing/commuting_2q_gate_router.py 1 99.11%
Totals Coverage Status
Change from base Build 8912008593: 0.07%
Covered Lines: 62302
Relevant Lines: 69524

💛 - Coveralls

Copy link
Contributor

@raynelfss raynelfss left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for the quick updates

@raynelfss raynelfss added this pull request to the merge queue May 17, 2024
Merged via the queue into Qiskit:main with commit 581f247 May 17, 2024
15 checks passed
@kevinsung kevinsung deleted the unitary-overlap-barrier branch May 18, 2024 15:07
ElePT pushed a commit to ElePT/qiskit that referenced this pull request May 31, 2024
* add insert_barrier argument to UnitaryOverlap

* set fold=-1 in circuit drawing
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 mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add insert_barrier argument to UnitaryOverlap
5 participants