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

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

Build:
DEFAULT BRANCH: main
Ran 14 Jul 2023 01:43AM UTC
Files 1266
Run time 13s
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

13 Jul 2023 09:49PM UTC coverage: 86.037% (+0.03%) from 86.004%
5549427939.1

push

github

web-flow
Add initial representation of classical expressions (#10332)

* Add initial representation of classical expressions

This adds a method of representing a classical type system and
expression tree in Qiskit.  This initial version contains only simple
bitwise, logical and relational operations on Booleans and sized
unsigned integers.  This is largely in line with

    https://github.com/Qiskit/RFCs/blob/0dd13344/0010-simple-classical-representations.md

Some of the details surrounding construction and representation have
been changed slightly from that design, but the type system described is
the same.

Perhaps the largest forwards-facing change is that there is a split
between `Var` and `Value`.  The intention here is that `Var` will become
the type for a general variable with defined storage, while `Value` is
for (currently) literal-like values.

This commit slightly modifies the representation of the
tree; instead of individual tree items for each unary and binary
operation, they are part of the `Unary` and `Binary` nodes with a
respective enumeration discriminator in the node.  This was done to make
visitors to the expression tree require less boilerplate and be easier
to maintain by exploiting the natural similarities between all these
operations of the same type.  One can still discriminate on the
particular operations by using a jump table based on the enumeration
values, if desired.

Secondly, a series of constructor functions was added that is separate
to the representation form.  This is for both efficiency and user
convenience.  The tree form is _purely_ a data format; it does no
type-checking on creation so that manipulations of the tree do not need
to pay runtime costs when the manipulators are the ones who will be
ensuring that the type system is fulfilled anyway.  The more user
friendly constructors _do_ resolve all this type information as part of
their construction.  They also infer typing information for Qiskit
scalar values, and inser... (continued)

72185 of 83900 relevant lines covered (86.04%)

45774.66 hits per line

Source Files on job 5549427939.1
  • Tree
  • List 0
  • Changed 25
  • Source Changed 0
  • Coverage Changed 25
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5549427939
  • 93500140 on github
  • Prev Job for on main (#5548967359.1)
  • Next Job for on main (#5549582782.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