I trying to visualize qubits state after amplitude encoding.
I have the following code which takes the 8 feature [1/2, 1/2, 1/2, 1/2,1/2, 1/2,1/2,1/2] and encodes into 3 qubits.
I now get the output [0.35355339+0.j 0.35355339+0.j 0.35355339+0.j 0.35355339+0.j 0.35355339+0.j 0.35355339+0.j 0.35355339+0.j 0.35355339+0.j].
How to get individual qubits state from overall state, so I can visualize it using Qiskit.
import pennylane as qml
import numpy as np
dev = qml.device('default.qubit', wires=3)
@qml.qnode(dev)
def circuit(f=None):
qml.AmplitudeEmbedding(features=f, wires=range(3))
return qml.expval(qml.PauliZ(0))
feature_vector= [1/2, 1/2, 1/2, 1/2,1/2, 1/2,1/2,1/2]
normalized_feature_vector = feature_vector / np.linalg.norm(feature_vector)
circuit(normalized_feature_vector)
print(dev.state)

