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

Qiskit / qiskit / 15169980222
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: substitute_pi4_rotations
DEFAULT BRANCH: main
Ran 21 May 2025 07:18PM UTC
Jobs 1
Files 811
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

21 May 2025 06:16PM UTC coverage: 88.328% (+0.02%) from 88.311%
15169980222

push

github

web-flow
Avoid using string parsing for ParameterExpression.sympify() (#14391)

* Avoid using string parsing for ParameterExpression.sympify()

In the recently merged #13278 the implementation for the sympify
method for ParameterExpression was changed because we no longer rely on
symengine internally. Previously we would just return the inner
symengine object used to represent the symbolic expression. Without
symengine available #13278 updated the implementation of the method to
generate a string representation of the expression and pass that to
sympify which has a "parser" for converting that expression string to a
sympy object. However, sympify() method is insecure as it internally
relies on Python's eval() to parse the string and can't be used for
untrusted input. While this doesn't have the same exact exposure as
in https://github.com/Qiskit/qiskit/security/advisories/GHSA-6m2c-76ff-6vrf
because you have to opt-in to using this function with input that is
untrusted and the degrees of freedom are less because it has to go
through the rust symbolic expression it is still a potential
vulnerability waiting to happen. This commit reworks the sympify
implementation to avoid using sympy's parser and instead just builds
the sympy expression from the internal state directly.

* Remove unused Rust functions that support sympy string generation

* Add test coverage for all of parameter expression

* Add .sign() to the megaexpression

47 of 47 new or added lines in 2 files covered. (100.0%)

9 existing lines in 2 files now uncovered.

78479 of 88850 relevant lines covered (88.33%)

468382.79 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
3
92.98
0.25% crates/qasm2/src/lex.rs
6
75.07
-0.56% crates/circuit/src/symbol_expr.rs
Jobs
ID Job ID Ran Files Coverage
1 15169980222.1 21 May 2025 07:18PM UTC 811
88.33
GitHub Action Run
Source Files on build 15169980222
  • Tree
  • List 811
  • Changed 6
  • Source Changed 4
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #15169980222
  • 8970b83e on github
  • Prev Build on gh-readonly-queue/main/pr-14364-83d85a01566044c00bcfde45647d3daf034c1276 (#15168839272)
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

© 2025 Coveralls, Inc