Open cvjjm opened 8 months ago
Thanks @cvjjm! This has always been a tricky one to manage during release, because we have pennylane
and pennylane-lightning
being co-dependent. We're discussing how to better manage this, but for now as you point out it's probably best to do
pip install pennylane==0.32 pennylane-lightning==0.32
That being said, we did a big performance fix in v0.33.1
, so if possible it'd be great for you to upgrade to v0.33
or v0.34
.
Wouldn't it be quire easy to declare in pennylane-lighthing 0.33 that it is no longer compatible with PL 0.32 by changing one line in it's setup.py as follows:
requirements = [
"pennylane>=0.33",
]
And, yes, I understand that it is always preferred to use the latest version, but testing our rather extensive code stack against a range of PL version has lead to the discovery of several noteworthy (performance) regressions and bugs, so I would definitely appreciate if all old versions could still be installed in a straight forward way.
Is pip install pennylane==${version} pennylane-lightning==${version%.*}
going to work for every minor version, i.e. for ${version}
in 0.29.1, 0.30.0, 0.31.0, 0.32.0, .... ?
Hey @cvjjm That should work. The bugfix release version number (Z.Y.X) should be fine for all minor release versions of pennylane (Z.Y). In this case, assuming you are giving the full pennylane version (Z.Y.X) string you can use pennylane-lightning~=${version}
and it should pull in the latest version at that release number.
For example, assuming you want a release of PennyLane in the interval 0.[21, 34].0, and the associated latest version of Lightning with each release, you can do the following:
#!/bin/bash
for min_ver in $(seq 21 34); do
python -m venv pyenv_${min_ver};
source ./pyenv_${min_ver}/bin/activate;
python -m pip install pennylane==0.${min_ver}.0 pennylane-lightning~=0.${min_ver}.0
deactivate
done
Feel free to let us know if you need any additional help here.
Thanks! This is useful.
I still consider it a bug that pennylane-lighthing 0.33 does not declare that is is incompatible with pennylane < 0.33.
Hey @cvjjm, I think you're right and we're thinking about how to make it better in the future 👍
@mlxd are there any implications/issues to pinning PennyLane to pennylane-lightning~=0.X
in the setup.py
?
My instinct is that this could lead to pip resolving errors, so best to not do this?
Hey @cvjjm, asked around internally and the general conclusion is that the setup.py
PL + Lightning interdependency is hard to solve as the packages aren't released together. If we pin, we cannot test as the CI breaks, since the dev/RC versions won't be recognized. It requires a redesign of how we cut a release to solve this problem. For that reason, we won't fix this issue for now. I will leave this issue open but will label it with "won't fix" 🙂. Feel free to close this if you wish!
Expected behavior
When installing a specific version of pennylane and pennylane-lightning with pip I expect them to "just work".
Actual behavior
When I pip install pennylane v0.32 like this
pip install pennylane==0.32 pennylane-lightning
, I end up withwhich is expected since in
setup.py
PL 0.32 declares that it needs:and pennylane-lightning 0.33.1 also claims to be compatible with PL 0.32 in it's setup.py:
However, if I then try to use pennylane-lightning, I get:
Manually downgrading
pip install -U pennylane-lightning==0.32
fixes the problem.But this makes it hard to test my code in a CI pipeline with different PL versions. It would be awesome if an effort could be made to ensure that incompatibilities between pennylane and pennylane-lightning versions could always be declared correctly. Thanks!
Additional information
No response
Source code
No response
Tracebacks
No response
System information
Existing GitHub issues