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

Update datasets to use API #6126

Merged
merged 66 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
da38e02
add dataset queries
anthayes92 Aug 21, 2024
94c2cae
update query
anthayes92 Aug 21, 2024
29acd12
update url
anthayes92 Aug 23, 2024
b6f799e
update list tests
anthayes92 Aug 23, 2024
c5c89f9
fix existing tests
anthayes92 Aug 26, 2024
c253c6d
fix tests
anthayes92 Aug 26, 2024
9eb725a
fmt
anthayes92 Aug 26, 2024
7eb42a4
fmt
anthayes92 Aug 26, 2024
898766d
appease codefactor
anthayes92 Aug 26, 2024
1bdd34f
fix docstrings
anthayes92 Aug 26, 2024
2254fa4
update docstrings
anthayes92 Aug 27, 2024
0da7c2c
fmt
anthayes92 Aug 27, 2024
156268c
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Sep 12, 2024
fa31d22
update interactive download, update tests
anthayes92 Sep 13, 2024
4b339da
fmt
anthayes92 Sep 13, 2024
8986ea0
fmt
anthayes92 Sep 13, 2024
20c9d09
fmt
anthayes92 Sep 13, 2024
56f8662
fix val
anthayes92 Sep 13, 2024
b1f5ca3
fmt
anthayes92 Sep 13, 2024
361f7a2
fmt
anthayes92 Sep 13, 2024
1234ff3
add graphql tests
anthayes92 Sep 16, 2024
e2d329f
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Sep 16, 2024
b00fc0c
add edge case tests
anthayes92 Sep 16, 2024
2b0b1c4
Merge branch 'sc-70918-pennylane-oss-uses-new-datasets-api' of github…
anthayes92 Sep 16, 2024
6b67f33
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Sep 16, 2024
9b41d1c
clean docstrings
anthayes92 Sep 16, 2024
2026898
fmt tests
anthayes92 Sep 16, 2024
dfcceab
fix queries
anthayes92 Sep 19, 2024
b7e2544
format
anthayes92 Sep 19, 2024
b1e7534
fix import
anthayes92 Sep 19, 2024
4d9d9b3
update doc example
anthayes92 Sep 19, 2024
10d2903
fix doc import
anthayes92 Sep 19, 2024
c5ee35b
add feedback
anthayes92 Oct 15, 2024
6e90383
restructure graphql module
anthayes92 Oct 15, 2024
6887b91
add integration tests
anthayes92 Oct 15, 2024
111da06
fix codecov
anthayes92 Oct 15, 2024
195354f
update param formatting
anthayes92 Oct 16, 2024
063f8b4
fmt
anthayes92 Oct 16, 2024
8e04a3e
add feedback
anthayes92 Oct 16, 2024
c1274db
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Oct 16, 2024
86fefe5
update attr choice
anthayes92 Oct 16, 2024
edf5d4e
Merge branch 'sc-70918-pennylane-oss-uses-new-datasets-api' of github…
anthayes92 Oct 16, 2024
14e1faf
update docs
anthayes92 Oct 16, 2024
d791f63
update load for 'other' dsets
anthayes92 Oct 16, 2024
be92f93
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
doctorperceptron Oct 21, 2024
ec7d51f
bring back list_datasets func and test
anthayes92 Oct 21, 2024
51f92c0
Merge branch 'sc-70918-pennylane-oss-uses-new-datasets-api' of github…
anthayes92 Oct 21, 2024
e349e0c
update docs
anthayes92 Oct 21, 2024
f19f3c8
add tests
anthayes92 Oct 21, 2024
77c655c
format
anthayes92 Oct 21, 2024
158a0ae
remove unused logic
anthayes92 Oct 22, 2024
a9070d0
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Oct 22, 2024
2418cf9
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Oct 22, 2024
a84d5e2
fmt
anthayes92 Oct 22, 2024
2e88015
Merge branch 'sc-70918-pennylane-oss-uses-new-datasets-api' of github…
anthayes92 Oct 22, 2024
5f6eaf8
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Oct 22, 2024
24d5f08
remove url escaping
anthayes92 Oct 22, 2024
f74a3ef
Merge branch 'sc-70918-pennylane-oss-uses-new-datasets-api' of github…
anthayes92 Oct 22, 2024
a5700e6
handle default query params
anthayes92 Oct 23, 2024
8b4c8a7
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Oct 23, 2024
e4925dc
add error message, handle full params
anthayes92 Oct 23, 2024
6e93c62
Merge branch 'sc-70918-pennylane-oss-uses-new-datasets-api' of github…
anthayes92 Oct 23, 2024
34bcd29
add feedback
anthayes92 Oct 23, 2024
7467c0b
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Oct 25, 2024
47dfc10
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Oct 25, 2024
ef8c82f
Merge branch 'master' into sc-70918-pennylane-oss-uses-new-datasets-api
anthayes92 Oct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion doc/introduction/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,36 @@ use them directly in a PennyLane circuits as follows:
>>> print(circuit())
-1.0791430411076344

Viewing Available Dataset Names
-------------------------------

We can call the
:func:`~pennylane.data.list_data_names` function to get a snapshot of the names of the currently available datasets.
This function returns a list of strings as shown below.

>>> qml.data.list_data_names()
["bars-and-stripes",
"downscaled-mnist",
"hamlib-max-3-sat",
"hamlib-maxcut",
"hamlib-travelling-salesperson-problem",
"hidden-manifold",
"hyperplanes",
"ketgpt",
"learning-dynamics-incoherently",
"linearly-separable",
"mnisq",
"mqt-bench",
"plus-minus",
"qchem",
"qspin",
"rydberggpt",
"two-curves"]

Note that this example limits the results
of the function calls for clarity and that as more data becomes available, the results of these
function calls will change.

Viewing Available Datasets
--------------------------

Expand Down Expand Up @@ -161,8 +191,9 @@ Quantum Datasets Functions and Classes
.. autosummary::
:nosignatures:

~pennylane.data.list_datasets
astralcai marked this conversation as resolved.
Show resolved Hide resolved
~pennylane.data.list_attributes
~pennylane.data.list_data_names
~pennylane.data.list_datasets
~pennylane.data.load
~pennylane.data.load_interactive
~pennylane.data.Dataset
Expand Down
54 changes: 54 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,59 @@
[Haldane](https://journals.aps.org/prl/pdf/10.1103/PhysRevLett.61.2015) models on a lattice.
[(#6201)](https://github.com/PennyLaneAI/pennylane/pull/6201/)

* A `has_sparse_matrix` property is added to `Operator` to indicate whether a sparse matrix is defined.
[(#6278)](https://github.com/PennyLaneAI/pennylane/pull/6278)
[(#6310)](https://github.com/PennyLaneAI/pennylane/pull/6310)

<h3>Improvements 🛠</h3>

* RTD support for `qml.labs` added to API.
[(#6397)](https://github.com/PennyLaneAI/pennylane/pull/6397)

* Module-level sandboxing added to `qml.labs` via pre-commit hooks.
[(#6369)](https://github.com/PennyLaneAI/pennylane/pull/6369)

* `qml.matrix` now works with empty objects (such as empty tapes, `QNode`s and quantum functions that do
not call operations, single operators with empty decompositions).
[(#6347)](https://github.com/PennyLaneAI/pennylane/pull/6347)

* PennyLane is now compatible with NumPy 2.0.
[(#6061)](https://github.com/PennyLaneAI/pennylane/pull/6061)
[(#6258)](https://github.com/PennyLaneAI/pennylane/pull/6258)
[(#6342)](https://github.com/PennyLaneAI/pennylane/pull/6342)

* PennyLane is now compatible with Jax 0.4.28.
[(#6255)](https://github.com/PennyLaneAI/pennylane/pull/6255)

* `qml.qchem.excitations` now optionally returns fermionic operators.
[(#6171)](https://github.com/PennyLaneAI/pennylane/pull/6171)

* The `diagonalize_measurements` transform now uses a more efficient method of diagonalization
when possible, based on the `pauli_rep` of the relevant observables.
[(#6113)](https://github.com/PennyLaneAI/pennylane/pull/6113/)

* The `QuantumScript.copy` method now takes `operations`, `measurements`, `shots` and
`trainable_params` as keyword arguments. If any of these are passed when copying a
tape, the specified attributes will replace the copied attributes on the new tape.
[(#6285)](https://github.com/PennyLaneAI/pennylane/pull/6285)
[(#6363)](https://github.com/PennyLaneAI/pennylane/pull/6363)

* Datasets are now downloaded via Dataset API.
[(#6126)](https://github.com/PennyLaneAI/pennylane/pull/6126)

* The `Hermitian` operator now has a `compute_sparse_matrix` implementation.
[(#6225)](https://github.com/PennyLaneAI/pennylane/pull/6225)

* All PL templates are now unit tested to ensure JIT compatibility.
[(#6309)](https://github.com/PennyLaneAI/pennylane/pull/6309)

* `qml.QutritBasisStatePreparation` is now JIT compatible.
[(#6308)](https://github.com/PennyLaneAI/pennylane/pull/6308)

* `qml.AmplitudeAmplification` is now compatible with QJIT.
[(#6306)](https://github.com/PennyLaneAI/pennylane/pull/6306)


<h4>Calculating Polynomials 🔢</h4>

<h4>Readout Noise 📠</h4>
Expand Down Expand Up @@ -426,6 +479,7 @@ Diksha Dhawan,
Lillian M. A. Frederiksen,
Pietropaolo Frisoni,
Emiliano Godinez,
Anthony Hayes,
Austin Huang,
Soran Jahangiri,
Jacob Kitchen,
Expand Down
14 changes: 12 additions & 2 deletions pennylane/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
load
load_interactive
list_attributes
list_data_names
list_datasets

In addition, various dataset types are provided
Expand Down Expand Up @@ -207,16 +208,24 @@ class QuantumOscillator(qml.data.Dataset, data_name="quantum_oscillator", identi
DatasetMolecule,
DatasetNone,
DatasetOperator,
DatasetPyTree,
DatasetScalar,
DatasetSparseArray,
DatasetString,
DatasetTuple,
DatasetPyTree,
)
from .base import DatasetNotWriteableError
from .base.attribute import AttributeInfo, DatasetAttribute, attribute
from .base.dataset import Dataset, field
from .data_manager import DEFAULT, FULL, list_attributes, list_datasets, load, load_interactive
from .data_manager import (
DEFAULT,
FULL,
list_attributes,
list_datasets,
list_data_names,
load,
load_interactive,
)

__all__ = (
"AttributeInfo",
Expand All @@ -240,6 +249,7 @@ class QuantumOscillator(qml.data.Dataset, data_name="quantum_oscillator", identi
"load",
"load_interactive",
"list_attributes",
"list_data_names",
"list_datasets",
"DEFAULT",
"FULL",
Expand Down
2 changes: 1 addition & 1 deletion pennylane/data/attributes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
from .molecule import DatasetMolecule
from .none import DatasetNone
from .operator import DatasetOperator
from .pytree import DatasetPyTree
from .scalar import DatasetScalar
from .sparse_array import DatasetSparseArray
from .string import DatasetString
from .tuple import DatasetTuple
from .pytree import DatasetPyTree

__all__ = (
"DatasetArray",
Expand Down
Empty file added pennylane/data/base/graphql.py
Empty file.
Loading