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

🐛 Installing via pip in clean environment gives numpy error on np.float? #356

Closed
MaximilianJanetschek opened this issue Jul 18, 2024 · 1 comment · Fixed by #357
Closed

Comments

@MaximilianJanetschek
Copy link

MaximilianJanetschek commented Jul 18, 2024

Environment information

  • mqt bench 1.1.3
  • python 3.11

Description

When installing and trying to use mqt.bench, the import functions throw an attribute error:
AttributeError: np.float_ was removed in the NumPy 2.0 release. Use np.float64 instead.

Referenced code:
from mqt.bench import get_benchmark

"get a benchmark circuit on algorithmic level representing the GHZ state with 5 qubits
qc_algorithmic_level = get_benchmark(benchmark_name="dj", level="alg", circuit_size=5)

"draw the circuit
print(qc_algorithmic_level.draw())

Expected behavior

Successful import

How to Reproduce

  1. Clean Environment
  2. pip install mqt.bench
  3. execute reference code
@burgholzer
Copy link
Member

Hey 👋🏻
Thanks for raising this issue. This is just another case of incompatibility with numpy 2.0.
You can work around this for now by installing any numpy version < 2.

pip install --force-reinstall "numpy<2"

I'll keep this issue open until we put a temporary upper cap on numpy in MQT Bench itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants