I am currently working on a project about Quantum Image Encoding, mainly with FRQI and NEQR algorithms. These codification methods use different circuit architectures (and not only parameters) depending on the image you are working with. My idea was to append an ansatz to these circuits and assess if it is possible to perform a classification task. However, the Qiskit functions that I have tried (VQC, QNN, TwoLayerQNN...) can only take classical data as inputs (as far as I know). I can't either use this encoding circuit as a feature map, as these circuits will change depending on the input (as I explained before). I was wondering if any of you know how to solve this problem, by taking the Quantum output of my encoding circuit and using it as an input for an ansatz. Thank you so much!!


1 Answer 1


To my knowledge, encoding of quantum machine learning is still a hot research topic. Hence, in short, I think you could propose your own new encoding method for this condition.

Here, we can make a simple example. Let's take FRQI as example.


After FRQI State quantum state representing the image, we could get a subcircuit. Then you could directly take this subcircuit as the encoding of quantum machine learning. For instance,


    def __init__(self, n_qubits, backend, shots):
        # --- Circuit definition ---
        self._circuit = qiskit.QuantumCircuit(n_qubits)
        all_qubits = [i for i in range(n_qubits)]
        self.theta = qiskit.circuit.Parameter('theta')
        self._circuit.ry(self.theta, all_qubits)
        # ---------------------------

        self.backend = backend
        self.shots = shots

You can replace the angle encoding here with the subcircuit of FRQI State you just made.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.