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

Qiskit / qiskit-terra / 5613344415 / 1
86%
main: 87%

Build:
Build:
LAST BUILD BRANCH: sparsepauliop_default_init
DEFAULT BRANCH: main
Ran 20 Jul 2023 04:35PM UTC
Files 1266
Run time 16s
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

20 Jul 2023 04:08PM UTC coverage: 86.074% (+0.007%) from 86.067%
5613344415.1

push

github

web-flow
Add flatten option to the NLocal family (#10269)

* Add flatten option to the NLocal family

This commit adds a new flag `flatten` to the circuit library elements in
the NLocal family. This flag is used to avoid the nested wrapping of the
output that is done by default in the output of these gates. This is
done primarily in the interest of performance. The runtime
performance of bind_parameters() is vastly improved with a flattened
output compared to the nested object. For example, running:

```
qc = EfficientSU2(100, entanglement="linear", reps=100)
qc.measure_all()
qc.bind_parameters({x: math.pi / 2 for x in qc.parameters})
```

the runtime of `bind_parameters()` went from ~390 seconds with the
wrapped output to ~0.5 seconds with the flattened output. I think given
these results longer term we might want to flip the default behavior to
only wrap on user request (likely for visualization as that's the only
use case I can think of for the wrapped output). The default value
is set to `None` in this PR to facilitate this change. In 0.26/0.45 we
can emit a warning if `flatten` is `None` to warn that the default will
change in a future release.

* Add missing nlocal subclasses

* Add setter

* Fix lint

* Fix flatten for EvolvedOperatorAnsatz

72958 of 84762 relevant lines covered (86.07%)

58840.38 hits per line

Source Files on job 5613344415.1
  • Tree
  • List 0
  • Changed 31
  • Source Changed 0
  • Coverage Changed 31
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5613344415
  • fcd7766f on github
  • Prev Job for on gh-readonly-queue/main/pr-10269-7c1b8ee4fedb4c3b6011a69fd3091c83e5fc3828 (#5612493343.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