Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second tutorial fails with development version of Qiskit #714

Open
garrison opened this issue Nov 28, 2024 · 2 comments
Open

Second tutorial fails with development version of Qiskit #714

garrison opened this issue Nov 28, 2024 · 2 comments

Comments

@garrison
Copy link
Member

garrison commented Nov 28, 2024

The second tutorial fails in CI with the development version of Qiskit.

It must be a recent change causing this, because the first cron-job CI failure was today. I am guessing Qiskit/qiskit#13482 is the culprit. EDIT: I have since verified this.

Example failure at https://github.com/Qiskit/qiskit-addon-cutting/actions/runs/12060889091/job/33635443761#step:6:407

@mtreinish
Copy link
Member

I'm pretty sure that error can only be raised by the basis translator or equivalence library. Tracing through the code it will come up if a parameter expression being assigned a new value (either a float or new param) in an equivalence rule isn't found in the circuit from the rule. Looking through Qiskit/qiskit#13482 my guess is that it's probably a Python side shared ref issue. The PR substitutes the param in place on cached instances of standard gates on parameter assignment but if that python object was added to more than one circuit the param from the pycache is going to mismatch with the parameter table of the other circuit. This could be coming up somehow in the basis translator/equivance library after running it multiple times somehow. But this is just a guess. My gut feeling in Qiskit/qiskit#13482 was to invalidate the py cache instead of trying to update it, but the update seemed to work and all the tests passed so I figured it was fine. It might be worth trying to just clear the py cache on parameter assignment instead to see if that fixes the issue. @Cryoris can you give that a try?

@Cryoris
Copy link
Contributor

Cryoris commented Nov 29, 2024

FYI this is tracked in Qiskit/qiskit#13504. We found a potential fix, which is not included in 1.3.0 yet though. Until then, this can be resolved by turning off disabling parallel processing in Qiskit, i.e.

export QISKIT_PARALLEL=FALSE

or by disabling caching of Python gates in Rust, by

export QISKIT_NO_CACHE_GATES=1
python setup.py build_rust --inplace --release

garrison added a commit that referenced this issue Nov 30, 2024
See discussion in #714.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants