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

Qiskit / qiskit-terra / 5594201913 / 1
87%
main: 87%

Build:
DEFAULT BRANCH: main
Ran 19 Jul 2023 02:43AM UTC
Files 1265
Run time 17s
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

19 Jul 2023 12:06AM UTC coverage: 86.091% (+0.02%) from 86.072%
5594201913.1

push

github

web-flow
Add support for semantic equality checking of `Expr`s in `DAGCircuit` (#10367)

* Add support for semantic equality checking of `Expr`s in `DAGCircuit`s

This adds support to semantically check the variables of `Expr` nodes
that occur within `DAGCircuit` constructs, using similar logic to the
remapping done by the existing condition checks.  As a knock-on effect
of how the control-flow introspection was added to allow these checks,
the canonicalisation performed by
`qiskit.test._canonical.canonicalize_control_flow` is now inherent to
the `DAGCircuit` equality methods, largely removing the need for that
explicit canonical form in tests.

The dispatch of `QuantumCircuit.__eq__` to `DAGCircuit.__eq__` means
that direct comparisons of `QuantumCircuit`s will also benefit from this
change.

As a partial implementation detail, the semantic checking is achieved
and defined by the function `expr.structurally_equivalent`, with key
functions for mapping the variables.  The naming discrepancy (semantic
versus structural) is deliberate. Classical expressions are considered
"equal" if and only if their tree structures match exactly; there is no
attempt to move the classical expressions into some canonical form, as
this is not typically simple; even mathematically symmetric operations
typically impact the order of sub-expression evaluation, and we don't
want to get into the weeds of that.  Better to just define equality as
"structurally exactly equal", and have the key function just so
alpha-renaming-compatible variables can still be canonicalised into
something that can be compared between expressions.

* Add checking for bad `{qu,cl}bit_order` arguments

Co-authored-by: Kevin Hartman <kevin@hart.mn>

---------

Co-authored-by: Kevin Hartman <kevin@hart.mn>

72690 of 84434 relevant lines covered (86.09%)

59310.14 hits per line

Source Files on job 5594201913.1
  • Tree
  • List 0
  • Changed 26
  • Source Changed 0
  • Coverage Changed 26
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5594201913
  • f5f58522 on github
  • Prev Job for on main (#5594119978.1)
  • Next Job for on main (#5594502856.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