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

Qiskit / qiskit / 11710069263
88%

Build:
DEFAULT BRANCH: main
Ran 06 Nov 2024 07:18PM UTC
Jobs 1
Files 898
Run time 2min
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

06 Nov 2024 06:01PM UTC coverage: 88.814% (+0.001%) from 88.813%
11710069263

push

github

web-flow
Add Qiskit native QPY ParameterExpression serialization (#13356)

* Add Qiskit native QPY ParameterExpression serialization

With the release of symengine 0.13.0 we discovered a version dependence
on the payload format used for serializing symengine expressions. This
was worked around in #13251 but this is not a sustainable solution and
only works for symengine 0.11.0 and 0.13.0 (there was no 0.12.0). While
there was always the option to use sympy to serialize the underlying
symbolic expression (there is a `use_symengine` flag on `qpy.dumps` you
can set to `False` to do this) the sympy serialzation has several
tradeoffs most importantly is much higher runtime overhead. To solve
the issue moving forward a qiskit native representation of the parameter
expression object is necessary for serialization.

This commit bumps the QPY format version to 13 and adds a new
serialization format for ParameterExpression objects. This new format
is a serialization of the API calls made to ParameterExpression that
resulted in the creation of the underlying object. To facilitate this
the ParameterExpression class is expanded to store an internal "replay"
record of the API calls used to construct the ParameterExpression
object. This internal list is what gets serialized by QPY and then on
deserialization the "replay" is replayed to reconstruct the expression
object. This is a different approach to the previous QPY representations
of the ParameterExpression objects which instead represented the internal
state stored in the ParameterExpression object with the symbolic
expression from symengine (or a sympy copy of the expression). Doing
this directly in Qiskit isn't viable though because symengine's internal
expression tree is not exposed to Python directly. There isn't any
method (private or public) to walk the expression tree to construct
a serialization format based off of it. Converting symengine to a sympy
expression and then using sympy's API to walk the expression tr... (continued)

272 of 293 new or added lines in 5 files covered. (92.83%)

12 existing lines in 4 files now uncovered.

77563 of 87332 relevant lines covered (88.81%)

359923.93 hits per line

Jobs
ID Job ID Ran Files Coverage
1 11710069263.1 06 Nov 2024 07:18PM UTC 0
88.81
GitHub Action Run
Source Files on build 11710069263
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #11710069263
  • 0a7690d5 on github
  • Prev Build on gh-readonly-queue/main/pr-13368-6ed774395468b8992c2ea06d9b26f275b9632c11 (#11708837361)
  • Next Build on main (#11710853769)
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