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

Qiskit / qiskit-terra / 5594201913
87%

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

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

Jobs
ID Job ID Ran Files Coverage
1 5594201913.1 19 Jul 2023 02:43AM UTC 0
86.09
GitHub Action Run
Source Files on build 5594201913
Detailed source file information is not available for this build.
  • Back to Repo
  • f5f58522 on github
  • Prev Build on main (#5594119978)
  • Next Build on main (#5594502856)
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