Skip to content

Commit 2066c39

Browse files
fkiwitDSGuala
andauthored
Fashion-MNIST, CIFAR-10 and Imagenette (#72)
* Added Fashion-MNIST, CIFAR-10 and Imagenette to low-depth-circuits * Add file size disclaimer * Removed hyphen from dataset name to fix linting error * Removed hyphen from dataset name to fix linting error * Changed to MNIST images for all datasets to check linting * update thumbnails * update code examples * thumbnail and dates --------- Co-authored-by: Diego <[email protected]> Co-authored-by: Diego <[email protected]>
1 parent 7663263 commit 2066c39

21 files changed

+538
-3
lines changed
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@misc{kiwit2025efficientdata,
2+
title={Low-Depth MNIST},
3+
author={Florian Kiwit and Bernhard Jobst and Andre Luckow and Frank Pollmann and Carlos Riofrío},
4+
howpublished = {\url{https://pennylane.ai/datasets/low-depth-mnist}}
5+
year={2025}}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"slug": "low-depth-cifar-10",
3+
"class": {
4+
"slug": "low-depth-cifar-10",
5+
"name": "LowDepthCIFAR10",
6+
"attributeList": [
7+
{
8+
"name": "circuit_layout_d4",
9+
"pythonType": "list",
10+
"doc": "Circuits layout consiting of CNOTs and RY gates defined as lists of operations and wires they act on with a circuit depth of 4."
11+
},
12+
{
13+
"name": "circuit_layout_d8",
14+
"pythonType": "list",
15+
"doc": "Circuits layout consiting of CNOTs and RY gates defined as lists of operations and wires they act on with a circuit depth of 8."
16+
},
17+
{
18+
"name": "params_d4",
19+
"pythonType": "list",
20+
"doc": "Circuit parameters as list of RY angles. When plugged in to the circuit layout with a depth of 8, the circuit approximates the flexible representation of quantum images (FRQI)."
21+
},
22+
{
23+
"name": "params_d8",
24+
"pythonType": "list",
25+
"doc": "Circuit parameters as list of RY angles. When plugged in to the circuit layout with a depth of 8, the circuit approximates the flexible representation of quantum images (FRQI)."
26+
},
27+
{
28+
"name": "exact_state",
29+
"pythonType": "list[np.ndarray]",
30+
"doc": "A list of numpy arrays. Each numpy array defines a quantum state that exactly encodes an CIFAR-10 image."
31+
},
32+
{
33+
"name": "labels",
34+
"pythonType": "list",
35+
"doc": "A list of the correct labels for each image."
36+
}
37+
]
38+
},
39+
"collection": {
40+
"$path": "/other/low-depth-image-circuits/_meta/collection.json"
41+
},
42+
"data": [
43+
{
44+
"dataUrl": "https://datasets.cloud.pennylane.ai/user/d9948558-2bea-4c31-99c6-13fa3208ff75",
45+
"parameters": {
46+
"name": "low-depth-cifar-10"
47+
},
48+
"extra": {}
49+
}
50+
],
51+
"downloadName": "low-depth-cifar-10",
52+
"features": [
53+
{
54+
"slug": "dataset-attributes",
55+
"title": "Dataset Attributes",
56+
"type": "DATA",
57+
"content": {
58+
"$path": "features/dataset-attributes.md"
59+
}
60+
}
61+
],
62+
"meta": {
63+
"$path": "meta.json"
64+
},
65+
"extra": {
66+
"defaultParameters": {
67+
"name": "low-depth-cifar-10"
68+
}
69+
}
70+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
|Name|Type|Description|
2+
|-|-|-|
3+
|`circuit_layout_d4`|`list`|Circuits layout defined as lists of operations and wires they act on with a circuit depth of 4.|
4+
|`circuit_layout_d8`|`list`|Circuits layout defined as lists of operations and wires they act on with a circuit depth of 8.|
5+
|`params_d4`|`list`|Circuit parameters as list of RY angles. When plugged in to the circuit layout with a depth of 8, the circuit approximates the flexible representation of quantum images (MCRQI).|
6+
|`params_d8`|`list`|Circuit parameters as list of RY angles. When plugged in to the circuit layout with a depth of 8, the circuit approximates the flexible representation of quantum images (MCRQI).|
7+
|`labels`|`list`|A list of the correct labels for each image.|
8+
|`exact_state`|`list`|A list of numpy arrays. Each numpy array defines an MCRQI state that exactly encodes a CIFAR-10 image.|
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"abstract": null,
3+
"authors": [
4+
{
5+
"name": "Florian Kiwit",
6+
"username": "flokiwit"
7+
},
8+
{
9+
"name": "Bernhard Jobst"
10+
},
11+
{
12+
"name": "Andre Luckow"
13+
},
14+
{
15+
"name": "Frank Pollmann"
16+
},
17+
{
18+
"name": "Carlos Riofrío"
19+
}
20+
],
21+
"based_on_papers": true,
22+
"citation": {
23+
"$path": "citation.txt"
24+
},
25+
"changelog": [
26+
"version 0.1 : initial public release"
27+
],
28+
"license": "[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/deed.en)",
29+
"sourceCodeUrl": null,
30+
"tags": [
31+
"Other"
32+
],
33+
"title": "Low-Depth CIFAR-10",
34+
"description": "This dataset contains images from the CIFAR-10 dataset encoded as quantum states.",
35+
"usingThisDataset": {
36+
"$path": "using_this_dataset.md"
37+
},
38+
"heroImage": "https://assets.cloud.pennylane.ai/datasets/generic/hero/Datasets_GenericHero_2.png",
39+
"thumbnail": "Dataset_CIFAR10_thumb.png",
40+
"extra": {},
41+
"dateOfLastModification": "2025-04-23",
42+
"dateOfPublication": "2025-04-23"
43+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Data for benchmarking machine learning models, generated for an upcoming paper: *Typical Machine Learning Datasets as Low-Depth Quantum Circuits*.
2+
3+
**Description of the dataset**
4+
5+
The [CIFAR-10 dataset](https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf) contains 60,000 32×32 color images across 10 categories (e.g., airplanes, cars, birds, and cats), with 6,000 images per category. Here, we provide circuit parameters that approximate the [Multi-Channel Representation of Quantum Images (MCRQI)](https://ieeexplore.ieee.org/document/6051718) of each image in the CIFAR-10 dataset.
6+
7+
**Additional details**
8+
9+
- The class labels are integers from 0 to 9.
10+
- Implementing the circuits in this dataset and obtaining the final state with PennyLane's `qml.state()` outputs a state vector. This state vector must be processed to recover the original image.
11+
- The dataset contains two circuits per image: those with a depth of four, which are shallower, and those with a depth of eight, which provide more accurate approximations of the exact state.
12+
- The `exact_state` entry contains a list of numpy arrays representing MCRQI states that exactly encode Imagenette images. This significantly increases the file size and can be omitted during download if not needed.
13+
14+
**Example usage**
15+
16+
```python
17+
import pennylane as qml
18+
import jax
19+
20+
[dataset_params] = qml.data.load("low-depth-cifar-10")
21+
22+
def get_circuit(circuit_layout):
23+
dev = qml.device("default.qubit", wires=13)
24+
@jax.jit
25+
@qml.qnode(dev)
26+
def circuit(params):
27+
counter = 0
28+
for gate, wire in circuit_layout:
29+
30+
if gate == "RY":
31+
qml.RY(params[counter], wire)
32+
counter += 1
33+
34+
elif gate == "CNOT":
35+
qml.CNOT(wire)
36+
37+
return qml.state()
38+
39+
return circuit
40+
41+
# Example for running the circuit with depth 4
42+
circuit_layout_d4 = dataset_params.circuit_layout_d4
43+
circuit_d4 = get_circuit(circuit_layout_d4)
44+
state_d4 = circuit_d4(dataset_params.params_d4[0])
45+
46+
# Example for running the circuit with depth 8
47+
circuit_layout_d8 = dataset_params.circuit_layout_d8
48+
circuit_d8 = get_circuit(circuit_layout_d8)
49+
state_d8 = circuit_d8(dataset_params.params_d8[0])
50+
```
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@misc{kiwit2025efficientdata,
2+
title={Low-Depth MNIST},
3+
author={Florian Kiwit and Bernhard Jobst and Andre Luckow and Frank Pollmann and Carlos Riofrío},
4+
howpublished = {\url{https://pennylane.ai/datasets/low-depth-mnist}}
5+
year={2025}}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"slug": "low-depth-fashion-mnist",
3+
"class": {
4+
"slug": "low-depth-fashion-mnist",
5+
"name": "LowDepthFashionMNIST",
6+
"attributeList": [
7+
{
8+
"name": "circuit_layout_d4",
9+
"pythonType": "list",
10+
"doc": "Circuits layout consiting of CNOTs and RY gates defined as lists of operations and wires they act on with a circuit depth of 4."
11+
},
12+
{
13+
"name": "circuit_layout_d8",
14+
"pythonType": "list",
15+
"doc": "Circuits layout consiting of CNOTs and RY gates defined as lists of operations and wires they act on with a circuit depth of 8."
16+
},
17+
{
18+
"name": "params_d4",
19+
"pythonType": "list",
20+
"doc": "Circuit parameters as list of RY angles. When plugged in to the circuit layout with a depth of 8, the circuit approximates the flexible representation of quantum images (FRQI)."
21+
},
22+
{
23+
"name": "params_d8",
24+
"pythonType": "list",
25+
"doc": "Circuit parameters as list of RY angles. When plugged in to the circuit layout with a depth of 8, the circuit approximates the flexible representation of quantum images (FRQI)."
26+
},
27+
{
28+
"name": "exact_state",
29+
"pythonType": "list[np.ndarray]",
30+
"doc": "A list of numpy arrays. Each numpy array defines a quantum state that exactly encodes an Fashion-MNIST image."
31+
},
32+
{
33+
"name": "labels",
34+
"pythonType": "list",
35+
"doc": "A list of the correct labels for each image."
36+
}
37+
]
38+
},
39+
"collection": {
40+
"$path": "/other/low-depth-image-circuits/_meta/collection.json"
41+
},
42+
"data": [
43+
{
44+
"dataUrl": "https://datasets.cloud.pennylane.ai/user/54d8b630-61c9-4e32-a0a5-2aceac9b278f",
45+
"parameters": {
46+
"name": "low-depth-fashion-mnist"
47+
},
48+
"extra": {}
49+
}
50+
],
51+
"downloadName": "low-depth-fashion-mnist",
52+
"features": [
53+
{
54+
"slug": "dataset-attributes",
55+
"title": "Dataset Attributes",
56+
"type": "DATA",
57+
"content": {
58+
"$path": "features/dataset-attributes.md"
59+
}
60+
}
61+
],
62+
"meta": {
63+
"$path": "meta.json"
64+
},
65+
"extra": {
66+
"defaultParameters": {
67+
"name": "low-depth-fashion-mnist"
68+
}
69+
}
70+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
|Name|Type|Description|
2+
|-|-|-|
3+
|`circuit_layout_d4`|`list`|Circuits layout defined as lists of operations and wires they act on with a circuit depth of 4.|
4+
|`circuit_layout_d8`|`list`|Circuits layout defined as lists of operations and wires they act on with a circuit depth of 8.|
5+
|`params_d4`|`list`|Circuit parameters as list of RY angles. When plugged in to the circuit layout with a depth of 8, the circuit approximates the flexible representation of quantum images (FRQI).|
6+
|`params_d8`|`list`|Circuit parameters as list of RY angles. When plugged in to the circuit layout with a depth of 8, the circuit approximates the flexible representation of quantum images (FRQI).|
7+
|`labels`|`list`|A list of the correct labels for each image.|
8+
|`exact_state`|`list`|A list of numpy arrays. Each numpy array defines an FRQI state that exactly encodes a Fashion-MNIST image.|
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"abstract": null,
3+
"authors": [
4+
{
5+
"name": "Florian Kiwit",
6+
"username": "flokiwit"
7+
},
8+
{
9+
"name": "Bernhard Jobst"
10+
},
11+
{
12+
"name": "Andre Luckow"
13+
},
14+
{
15+
"name": "Frank Pollmann"
16+
},
17+
{
18+
"name": "Carlos Riofrío"
19+
}
20+
],
21+
"based_on_papers": true,
22+
"citation": {
23+
"$path": "citation.txt"
24+
},
25+
"changelog": [
26+
"version 0.1 : initial public release"
27+
],
28+
"license": "[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/deed.en)",
29+
"sourceCodeUrl": null,
30+
"tags": [
31+
"Other"
32+
],
33+
"title": "Low-Depth Fashion-MNIST",
34+
"description": "This dataset contains images from the Fashion-MNIST dataset encoded as quantum states.",
35+
"usingThisDataset": {
36+
"$path": "using_this_dataset.md"
37+
},
38+
"heroImage": "https://assets.cloud.pennylane.ai/datasets/generic/hero/Datasets_GenericHero_2.png",
39+
"thumbnail": "Dataset_FashionMNIST_thumb.png",
40+
"extra": {},
41+
"dateOfLastModification": "2025-04-23",
42+
"dateOfPublication": "2025-04-23"
43+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Data for benchmarking machine learning models, generated for an upcoming paper: *Typical Machine Learning Datasets as Low-Depth Quantum Circuits*.
2+
3+
**Description of the dataset**
4+
5+
The [Fashion-MNIST dataset](https://arxiv.org/abs/1708.07747) has 28x28 grayscale images of 70,000 fashion items across 10 categories (e.g., T-shirts, trousers, shoes), with 7,000 images per category. Here, we provide circuit parameters that approximate the [Flexible Representation of Quantum Images (FRQI)](https://link.springer.com/article/10.1007/s11128-010-0177-y) of each image in the Fashion-MNIST dataset.
6+
7+
**Additional details**
8+
9+
- The class labels are integers from 0 to 9.
10+
- Implementing the circuits in this dataset and obtaining the final state with PennyLane's `qml.state()` outputs a state vector. This state vector must be processed to recover the original image.
11+
- The dataset contains two circuits per image: those with a depth of four, which are shallower, and those with a depth of eight, which provide more accurate approximations of the exact state.
12+
- The `exact_state` entry contains a list of numpy arrays representing FRQI states that exactly encode Imagenette images. This significantly increases the file size and can be omitted during download if not needed.
13+
14+
**Example usage**
15+
16+
```python
17+
import pennylane as qml
18+
import jax
19+
20+
[dataset_params] = qml.data.load("low-depth-fashion-mnist")
21+
22+
def get_circuit(circuit_layout):
23+
dev = qml.device("default.qubit", wires=11)
24+
@jax.jit
25+
@qml.qnode(dev)
26+
def circuit(params):
27+
counter = 0
28+
for gate, wire in circuit_layout:
29+
30+
if gate == "RY":
31+
qml.RY(params[counter], wire)
32+
counter += 1
33+
34+
elif gate == "CNOT":
35+
qml.CNOT(wire)
36+
37+
return qml.state()
38+
39+
return circuit
40+
41+
# Example for running the circuit with depth 4
42+
circuit_layout_d4 = dataset_params.circuit_layout_d4
43+
circuit_d4 = get_circuit(circuit_layout_d4)
44+
state_d4 = circuit_d4(dataset_params.params_d4[0])
45+
46+
# Example for running the circuit with depth 8
47+
circuit_layout_d8 = dataset_params.circuit_layout_d8
48+
circuit_d8 = get_circuit(circuit_layout_d8)
49+
state_d8 = circuit_d8(dataset_params.params_d8[0])
50+
```
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@misc{kiwit2025efficientdata,
2+
title={Low-Depth MNIST},
3+
author={Florian Kiwit and Bernhard Jobst and Andre Luckow and Frank Pollmann and Carlos Riofrío},
4+
howpublished = {\url{https://pennylane.ai/datasets/low-depth-mnist}}
5+
year={2025}}

0 commit comments

Comments
 (0)