Closed isaacdevlugt closed 1 month ago
BasisEmbedding's decomp should match BasisStatePreparation.
BasisEmbedding
BasisStatePreparation
It provides the wrong decomp.
No response
import pennylane as qml from pennylane import numpy as np n = np.array([0, 1, 1]) wires = [0, 1, 2] basis_state_prep = qml.BasisStatePreparation.compute_decomposition(n, wires) basis_embed = qml.BasisEmbedding.compute_decomposition(n, wires) print(basis_state_prep) # [X(1), X(2)] print(basis_embed) # [X(1)]
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: /Users/isaac/.virtualenvs/pennylane-catalyst/lib/python3.11/site-packages Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, semantic-version, toml, typing-extensions Required-by: PennyLane-Catalyst, PennyLane_Lightning Platform info: macOS-14.5-arm64-arm-64bit Python version: 3.11.8 Numpy version: 1.26.4 Scipy version: 1.12.0 Installed devices: - default.clifford (PennyLane-0.38.0.dev0) - default.gaussian (PennyLane-0.38.0.dev0) - default.mixed (PennyLane-0.38.0.dev0) - default.qubit (PennyLane-0.38.0.dev0) - default.qubit.autograd (PennyLane-0.38.0.dev0) - default.qubit.jax (PennyLane-0.38.0.dev0) - default.qubit.legacy (PennyLane-0.38.0.dev0) - default.qubit.tf (PennyLane-0.38.0.dev0) - default.qubit.torch (PennyLane-0.38.0.dev0) - default.qutrit (PennyLane-0.38.0.dev0) - default.qutrit.mixed (PennyLane-0.38.0.dev0) - default.tensor (PennyLane-0.38.0.dev0) - null.qubit (PennyLane-0.38.0.dev0) - lightning.qubit (PennyLane_Lightning-0.37.0) - nvidia.custatevec (PennyLane-Catalyst-0.7.0) - nvidia.cutensornet (PennyLane-Catalyst-0.7.0) - oqc.cloud (PennyLane-Catalyst-0.7.0) - softwareq.qpp (PennyLane-Catalyst-0.7.0)
Closing as this was resolved in https://github.com/PennyLaneAI/pennylane/pull/6021
Expected behavior
BasisEmbedding
's decomp should matchBasisStatePreparation
.Actual behavior
It provides the wrong decomp.
Additional information
No response
Source code
Tracebacks
No response
System information
Existing GitHub issues