• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 12677480117
88%

Build:
DEFAULT BRANCH: main
Ran 08 Jan 2025 07:46PM UTC
Jobs 1
Files 913
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Jan 2025 06:25PM UTC coverage: 88.941% (+0.02%) from 88.917%
12677480117

push

github

web-flow
Fix phase of `pauli_list.insert(..., qubit=True)` for length-1 `pauli_list` (#13624)

* switch order of if-clauses

`len(value) == 1` is the simplest case, and is also the case where the problematic clause `len(value) == size` fails.

This commit switches the order, so we check for `len(value) == 1` first.

This ensures that when the `len(value) == size` clause runs, we know that `size != 1`, avoiding the bug in #13623.

* add test

* Simplify `value.phase` broadcasting

Here, `phase` should be a 1D array. `np.vstack()` docs say explicitly output will be at least 2D, so we should not use that to create `phase`.

The intent of using `np.vstack()` was essentially to broadcast `phase` to properly add to `self.phase`. But, this happens automatically and correctly if we just add as-is. So this commit simplifies the code accordingly.

* Verify that `phase` is 1D in `from_symplectic()`

Verifying the input arg `phase`, since otherwise `from_symplectic()` will silently create PauliLists with malformed `phase` attributes (i.e. not 1D).

Zero-dimensional is OK (e.g. `phase` defaults to `0`) since that can broadcast per the shape of the `z` and `x` arrays.

* remove vestigial line

* lint

* release note

* Update releasenotes/notes/fix-paulilist-length1-phase-688d0e3a64ec9a9f.yaml

Co-authored-by: Jake Lishman <jake@binhbar.com>

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>

6 of 7 new or added lines in 1 file covered. (85.71%)

6 existing lines in 3 files now uncovered.

79443 of 89321 relevant lines covered (88.94%)

367336.76 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
82.93
-0.27% qiskit/quantum_info/operators/symplectic/pauli_list.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
92.13
-0.05% crates/accelerate/src/two_qubit_decompose.rs
1
93.18
0.0% crates/accelerate/src/unitary_synthesis.rs
4
92.23
-0.25% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 12677480117.1 08 Jan 2025 07:46PM UTC 913
88.94
GitHub Action Run
Source Files on build 12677480117
  • Tree
  • List 913
  • Changed 73
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #12677480117
  • 408741ca on github
  • Prev Build on gh-readonly-queue/main/pr-13622-8b2f6bd83ce8839c3efcb24d784dbb5f888db307 (#12676393848)
  • Next Build on main (#12687984222)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc