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

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

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

pending completion
5613344415

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

23 of 23 new or added lines in 3 files covered. (100.0%)

72958 of 84762 relevant lines covered (86.07%)

58840.38 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5613344415.1 20 Jul 2023 04:35PM UTC 0
86.07
GitHub Action Run
Source Files on build 5613344415
Detailed source file information is not available for this build.
  • Back to Repo
  • fcd7766f on github
  • Prev Build on gh-readonly-queue/main/pr-10284-2616602a548007c20fd1f230887c9c696822ac84 (#5612493343)
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