This dataset contains a portion of MNISQ: a dataset that encodes data from MNIST, Fashion-MNIST, and Kuzushiji-MNIST into quantum circuits. Here, we have included some of the MNIST training circuits at 90% fidelity, adapted to facilitate use with PennyLane. The original data can be downloaded from the authors' source.
Description of the dataset
MNIST contains images of hand-written digits in 28x28 pixel grayscale format and the correct labels identifying the digits. MNISQ encodes these images into quantum circuits. Each circuit amplitude-encodes an image from MNIST. This means that the final state of the qubits affected by the circuit can be read to recover the image.
In this dataset, the states are encoded with approximately 90% fidelity. 90% fidelity here means that the circuit implements a state ∣ψ⟩ and that ⟨ψtarget∣ψ⟩≈0.90, where ψtarget is a state whose amplitudes exactly encode the pixel values of the image, up to a normalization factor.
Additional details
Example usage
import numpy as np
import matplotlib.pyplot as plt
import pennylane as qml
ds= qml.data.load("mnisq")
@qml.qnode(qml.device("default.qubit"))
def circuit():
for op in ds.circuits[0]:
qml.apply(op)
return qml.state()
image_array = np.reshape(np.abs(circuit()[:784]), [28,28])
#show the encoded image
plt.imshow(image_array)
Leonardo Placidi, Ryuichiro Hataya, Toshio Mori, Koki Aoyama, Hayata Morisaki, Kosuke Mitarai, Keisuke Fujii
version 0.1 : initial public release