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

Qiskit / qiskit / 7033895831 / 1
87%
main: 88%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/main/pr-15621-84179f09c239b245d8d868f8204d09edca8b019f
DEFAULT BRANCH: main
Ran 29 Nov 2023 02:40PM UTC
Files 987
Run time 35s
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

29 Nov 2023 02:19PM UTC coverage: 87.403% (-0.04%) from 87.44%
7033895831.1

push

github

web-flow
Decomposition of single R gate in RR basis should be one R gate, not two (#11304)

* Decomposition of single R gate in RR basis should be one R gate, not two

Currently, a single R gate may come out of RR-decomposition as two R gates, which is obviously not ideal.

For example, `RGate(0.1, 0.2)` is currently decomposed (in RR basis) as

```
   ┌────────────────┐┌──────────┐
0: ┤ R(-3.0416,0.2) ├┤ R(π,0.2) ├
   └────────────────┘└──────────┘
```

Two `R(𝜗, 𝜑)` gates with the same 𝜑 parameter can be combined into one by simply adding up the 𝜗 values (giving us `R(0.1, 0.2)`, unsurprisingly).

In terms of `U(𝜗, 𝜑, 𝜆)`, it is the case when `𝜑 = -𝜆` that the two R-gates we construct have the same second parameter and therefore should be expressed as a single R gate.
For example, `U3Gate(0.1, 0.2, -0.2)` currently produces this RR-decomposition:

```
   ┌───────────────────┐┌─────────────┐
0: ┤ R(-3.0416,1.7708) ├┤ R(π,1.7708) ├
   └───────────────────┘└─────────────┘
```

which also unnecessarily consists of two R gates instead of just one.

This commit adds the two examples above as unit tests, ensuring they RR-decompose two just one R gate, as well as the code changes to make these two new tests pass, along with all existing tests, of course.

The condition for this special case is that the 𝜑 parameters of the two R-gates we would emit are the same (thus `mod_2pi(PI / 2. - lam)=mod_2pi(0.5 * (phi - lam + PI)`, simplified as `mod_2pi((phi + lam) / 2)=0`).

* Add release note

59740 of 68350 relevant lines covered (87.4%)

270778.07 hits per line

Source Files on job 7033895831.1
  • Tree
  • List 0
  • Changed 26
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 7033895831
  • 35567401 on github
  • Prev Job for on gh-readonly-queue/main/pr-11304-2e640b2bae84bc775659a715eb64a6de274111a6 (#7029868266.1)
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

© 2026 Coveralls, Inc