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

[BUG] Loading the MQT Bench dataset does not work as expected. #6035

Open
1 task done
vbrodeur opened this issue Jul 24, 2024 · 1 comment
Open
1 task done

[BUG] Loading the MQT Bench dataset does not work as expected. #6035

vbrodeur opened this issue Jul 24, 2024 · 1 comment
Labels
bug 🐛 Something isn't working

Comments

@vbrodeur
Copy link

Expected behavior

1 - Running qml.data.load("other", name="mqt-bench") returns the dataset.
2 - Running qml.data.load("other", name="mqt-bench", attributes=["ae"]) returns the "ae" algorithm from the dataset (same behavior for all algorithms)

These lines are from the MQT Bench dataset documentation, in the download button.

Actual behavior

1 - Running qml.data.load("other", name="mqt-bench") returns an array of 1 element where the element is the dataset.
2 - Running qml.data.load("other", name="mqt-bench", attributes=["ae"]) gives the error ValueError: 'ae' is an invalid attribute for 'other'. Valid attributes are: [] ( again, same behavior for all algorithms)

Additional information

To access a single algorithm, the way around this that I'm using is to first load the whole dataset by accessing the element of the array with ds=qml.data.load("other", name="mqt-bench")[0] and then select the algorithm from the dataset with ds.ae.

Downsides of this method :

  • It's not efficient to load the whole dataset (just under 17GB) if you only want one algorithm.
  • It doesn't directly allow the selection of the algorithms with a string variable.
  • It doesn't work for these 4 algorithms that contain a - in their name because the - is interpreted as a subtraction operator. ["grover-noancilla", "grover-v-chain", "qwalk-noancilla", "qwalk-v-chain"]

Source code

#working
ds = qml.data.load("other", name="mqt-bench")[0]
algo=ds.ae
print("dataset:", ds)
print("algo:", algo)

#not working
ds = qml.data.load("other", name="mqt-bench")
algo=qml.data.load("other", name="mqt-bench", attributes=["ae"])
print("dataset:", ds)
print("algo:", algo)

Tracebacks

No response

System information

Name: PennyLane
Version: 0.37.0
Summary: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
Home-page: https://github.com/PennyLaneAI/pennylane
Author:
Author-email:
License: Apache License 2.0
Location: C:\Users\Username\AppData\Roaming\Python\Python312\site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, semantic-version, toml, typing-extensions
Required-by: PennyLane-qiskit, pennylane-snowflurry, PennyLane_Lightning

Platform info:           Windows-10-10.0.19045-SP0
Python version:          3.12.2
Numpy version:           1.26.4
Scipy version:           1.13.1
Installed devices:
- default.clifford (PennyLane-0.37.0)
- default.gaussian (PennyLane-0.37.0)
- default.mixed (PennyLane-0.37.0)
- default.qubit (PennyLane-0.37.0)
- default.qubit.autograd (PennyLane-0.37.0)
- default.qubit.jax (PennyLane-0.37.0)
- default.qubit.legacy (PennyLane-0.37.0)
- default.qubit.tf (PennyLane-0.37.0)
- default.qubit.torch (PennyLane-0.37.0)
- default.qutrit (PennyLane-0.37.0)
- default.qutrit.mixed (PennyLane-0.37.0)
- default.tensor (PennyLane-0.37.0)
- null.qubit (PennyLane-0.37.0)
- qiskit.aer (PennyLane-qiskit-0.37.0)
- qiskit.basicaer (PennyLane-qiskit-0.37.0)
- qiskit.basicsim (PennyLane-qiskit-0.37.0)
- qiskit.ibmq (PennyLane-qiskit-0.37.0)
- qiskit.ibmq.circuit_runner (PennyLane-qiskit-0.37.0)
- qiskit.ibmq.sampler (PennyLane-qiskit-0.37.0)
- qiskit.remote (PennyLane-qiskit-0.37.0)
- lightning.qubit (PennyLane_Lightning-0.37.0)
- snowflurry.qubit (pennylane-snowflurry-0.2.1)

Existing GitHub issues

  • I have searched existing GitHub issues to make sure the issue does not already exist.
@vbrodeur vbrodeur added the bug 🐛 Something isn't working label Jul 24, 2024
@DSGuala
Copy link
Contributor

DSGuala commented Jul 24, 2024

Hi @vbrodeur! Thanks for putting this together!

We're aware of this issue, but enabling the attribute-download functionality requires making a few structural changes in how we store and access the datasets. We are planning to take this work on between now and the end of the year, along with other dataset improvements.

I will reply here again when we have a clearer timeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants