0
$\begingroup$

I've encoded a basic 2x2 image into a quantum circuit using a ZZFeatureMap in Qiskit. Is there any way I can verify that this encoding was correctly done?

My first thought was to try to decode this ZZFeatureMap to get back my original image, though I can't find how to do this.

Here is the code I used:

image_matrix = np.array([[0.51171875, 0.12890625],
                         [0.04296875, 0.3671875 ]]) #normalized greyscale image

feature_map = ZZFeatureMap(4, reps=1)

encode = QuantumCircuit(4)
encode.compose(feature_map, range(num_features), inplace=True))
encode = encode.assign_parameters(image_matrix.flatten())

Thanks for your help.

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.